{equation}
environment has a short form similar to that of {displaymath}
and {math}
into $$
and $
respectively?{equation}
environment has a short form similar to that of {displaymath}
and {math}
into $$
and $
respectively?Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
$$ … $$
. This is TeX syntax and causes some unwanted side effects. The correct LaTeX syntax is \[ … \]
.Code: Select all
\documentclass{article}
\begin{document}
\tableofcontents
\section{The variable $x$}
\section{The variable \(y\)}
\end{document}
\protect
in front of a fragile command inside the moving argument:Code: Select all
\documentclass{article}
\begin{document}
\tableofcontents
\section{The variable $x$}
\section{The variable \protect\(y\protect\)}
\end{document}
\robustify
and forget about the matter:
Code: Select all
\documentclass{article}
\usepackage{etoolbox}
\robustify\(
\robustify\)
\begin{document}
\tableofcontents
\section{The variable $x$}
\section{The variable \(y\)}
\end{document}
As far as I know the fixltx2e package does this job, too. But it might cause other problems.cgnieder wrote:[…] n alternative would be to load etoolbox, use its\robustify
and forget about the matter: […]
Indeed, it does! I did not know that, but »fixltx2e« defines alocalghost wrote:As far as I know the fixltx2e package does this job, too. But it might cause other problems.cgnieder wrote:[…] n alternative would be to load etoolbox, use its\robustify
and forget about the matter: […]
\MakeRobust
and contains the linesCode: Select all
\MakeRobust\(
\MakeRobust\)
\protected
. This difference once bit me unexpectedly.\[ ... \]
and \( ...\)
. It's also better to read in the source, because there's an opening command and a closing command. That makes it easier to find a mistake in opening and closing math mode, better than with a lot of $
which open and close.$ ... $
can be used without problems,$$ ... $$
should not be used because of inconsistent vertical spacing.Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis