summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/onlyamsmath/onlyamsmathtest.tex
blob: 9f7d29afda7aeaf48b126cc5a53726473f28bcef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
\documentclass[fleqn]{article}
\usepackage[all,warning]{onlyamsmath}
%\usepackage[all]{onlyamsmath}

\begin{document}
\author{Harald Harders}
\title{Test of the package onlyamsmath.sty}

\maketitle
\tableofcontents
\listoffigures

\section{A section title with an embedded equation $\alpha$}

Normal inlined equations $a^2+b^2=c^2$ should work.

Formulae in figures were a problem in version 0.1 and 0.2. 
Test wheather they work now in Fig.~\ref{fig:example}.
\begin{figure}
  \centering
  Test
  \caption{Here we have formulae $\alpha$, $\beta$, $\vec{a}$.\dots}
  \label{fig:example}
\end{figure}

\subsection{Allowed \texttt{amsmath} environments}

The \verb|align| environment is part of \verb|amsmath.sty| and
therefor works, too:
\begin{align}
  \sin^2x + \cos^2x &=1\,,\\
  \tan\alpha &= \frac{\sin\alpha}{\cos\alpha}\,.
\end{align}
\verb|equation| is redefined and allowed:
\begin{equation}
  \sin^2x + \cos^2x = 1\,.
\end{equation}
\verb|equation*| is defined by \verb|amsmath.sty| and allowed:
\begin{equation*}
  \sin^2x + \cos^2x = 1\,.
\end{equation*}
\verb|gather|:
\begin{gather}
  \sin^2x + \cos^2x =1\,,\\
  \tan\alpha = \frac{\sin\alpha}{\cos\alpha}\,.
\end{gather}
\verb|gather*|:
\begin{gather*}
  \sin^2x + \cos^2x =1\,,\\
  \tan\alpha = \frac{\sin\alpha}{\cos\alpha}\,.
\end{gather*}
\verb|multiline|:
\begin{multline}
  \sin^2x +  0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 \\
  + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 +  \cos^2x =1\,.
\end{multline}
\verb|multiline*|:
\begin{multline*}
  \sin^2x +  0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 \\
  + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 +  \cos^2x =1\,.
\end{multline*}
\verb|\[| is redefined and works:
\[
  \sin^2x + \cos^2x = 1\,.
\]



\subsection{Forbidden \TeX\ and \LaTeX\ environments}

\verb|eqnarray| is forbidden:
\begin{eqnarray}
  \sin^2x + \cos^2x &=& 1\,.
\end{eqnarray}
\verb|eqnarray*| is also forbidden:
\begin{eqnarray*}
  \sin^2x + \cos^2x &=& 1\,.
\end{eqnarray*}
Same for \verb|displaymath|:
\begin{displaymath}
  \sin^2x + \cos^2x = 1\,.
\end{displaymath}
And of course \verb|$$| (thanks to David Kastrup):
$$
  \sin^2x + \cos^2x = 1\,.
$$

\end{document}