LaTeX How can I create PDFs using LaTeX?

  • Thread starter Thread starter Dustinsfl
  • Start date Start date
  • Tags Tags
    Latex
AI Thread Summary
Creating PDFs using LaTeX can be enhanced by defining custom operators like \arctanh for mathematical functions, which can be done with \DeclareMathOperator. To reference itemized cases effectively, users should implement phantom sections in the preamble to allow for linking. When referencing figures, adjustments may be necessary to ensure that hyperlinks direct to the figure itself rather than the caption, which can be resolved by using the hypcap package. It's recommended to avoid the caption package in favor of float and subfig for better compatibility, especially with two-column layouts like IEEEtran. Proper delimiter usage is crucial in LaTeX, with inline math requiring specific delimiters instead of dollar signs to prevent compilation errors.
Dustinsfl
Messages
2,217
Reaction score
5
This works when making your own pdf files. On site, I don't know. If you can set it in the background of Math Jax, then it would be good here too.

Latex doesn't have a \arctanh. That probably means there is no sinh, cosh, etc versions as well.

I only know for a fact about arctanh because I use that one a lot.

Before you start you document, add

Code:
\DeclareMathOperator\arctanh{arctanh}

Now \arctanh works.
 
Physics news on Phys.org
Latex tip #3 references itemize cases

Have you ever done

Code:
\begin{enumerate}[{Case} 1:]
\item
blah
\item
blah
...

and then wanted to reference to one of your itemized cases? Well I have and here is how you do this. Add the following in your preamble before you start your document.

Code:
%  phantom sections for itemize linking use hyperref and name                       
\AtBeginEnvironment{itemize}{\apptocmd{\item}{\phantomsection}{}{
    \errmessage{couldn't patch item}}}

Now you can do this

Code:
\item
\label{case1}

some time later

See Case~\ref{case1}
 
Latex tip #4 referencing figure but the jump is never center on the figure

Have you ever referenced a figure, and when you click the hyper link, it jumps to the caption and not the figure?

Well if you haven't adjusted the caption package or added hypcap, this is what happens.

Your options to correct this are:

I recommend not using the caption package though see tip 5.
You can load the package caption. The default setting is hypcap=true.

If you don't load the package caption, you can load the package hypcap. Load this after hyperref
\usepackage[all]{hypcap}
 
Latex tip #5 don't use the caption package

Instead of the caption package use float and subfig.

For subfig, you want to set

\usepackage[caption = false]{subfig}

This will be valuable to you if you ever use the IEEEtran two column class.
 
Re: Latex tip #2

Or, if you prefer the function inverse notation, you could go

Code:
\DeclareMathOperator\arctanh{tanh^{-1}}
 
Re: Latex tip #2

Ackbach said:
Or, if you prefer the function inverse notation, you could go

Code:
\DeclareMathOperator\arctanh{tanh^{-1}}

You wouldn't need to define that one. Just do \tanh^{-1} and you have it.
 
Latex tip #6 the use of dollar signs

This is for preparing your own pdfs. In $\LaTeX3$, I believe the use of dollar signs will be removed since they are a $\TeX$ delimiter.
If you have ever had a compiling error and the information didn't help or make sense, it may be because you are using dollar delimiters over the $\LaTeX$ delimiters unless you already use the appropriate delimiters.

In $\LaTeX$, you should never the dollar sign or double dollar sign.

For inline math, you should use \({\verb|\(\)|}\) as the delimiters, and for displaymath, you should use \({\verb|\[ \]|}\) or
Code:
\begin{displaymath}\end{displaymath}

Note: this is in regards to document preparation not the forum.
 
Last edited by a moderator:
Re: Latex tip #2

dwsmith said:
You wouldn't need to define that one. Just do \tanh^{-1} and you have it.

Oh, yeah. Right. It might be a tad faster to type the definition, though. Or you could use something like \at as a shortcut.
 
Back
Top