How can I create PDFs using LaTeX?

  • Context: LaTeX 
  • Thread starter Thread starter Dustinsfl
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion revolves around creating PDFs using LaTeX, focusing on various tips and techniques for document preparation, referencing, and formatting within LaTeX. Participants share insights on specific commands, packages, and best practices for effective use of LaTeX in generating PDF documents.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • Some participants discuss the lack of a built-in \arctanh function in LaTeX and suggest defining it using \DeclareMathOperator.
  • One participant shares a method for referencing itemized cases using the itemize environment and hyperref package.
  • Another participant addresses issues with figure referencing, noting that hyperlinks may jump to captions instead of figures, and offers solutions involving the caption and hypcap packages.
  • There is a suggestion to avoid the caption package in favor of float and subfig for better compatibility with certain document classes.
  • Some participants propose alternative notations for the inverse hyperbolic tangent function, discussing the efficiency of defining it versus using existing notation.
  • A participant mentions upcoming changes in LaTeX3 regarding the use of dollar signs for math delimiters, emphasizing the importance of using appropriate delimiters to avoid compilation errors.

Areas of Agreement / Disagreement

Participants express differing opinions on the use of specific packages and commands, particularly regarding the definition of mathematical functions and the choice of packages for figure handling. There is no consensus on the best practices, as multiple viewpoints are presented.

Contextual Notes

Some discussions involve assumptions about the user's familiarity with LaTeX packages and commands, and there are unresolved questions about the implications of using certain packages over others.

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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
3
Views
8K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K