Debian Codegraph @

texmf-dist/doc/latex/onlyamsmath/onlyamsmathtest.tex

raw
1 \documentclass[fleqn]{article}
2 \usepackage[all,warning]{onlyamsmath}
3 %\usepackage[all]{onlyamsmath}
4
5 \begin{document}
6 \author{Harald Harders}
7 \title{Test of the package onlyamsmath.sty}
8
9 \maketitle
10 \tableofcontents
11 \listoffigures
12
13 \section{A section title with an embedded equation $\alpha$}
14
15 Normal inlined equations $a^2+b^2=c^2$ should work.
16
17 Formulae in figures were a problem in version 0.1 and 0.2.
18 Test wheather they work now in Fig.~\ref{fig:example}.
19 \begin{figure}
20 \centering
21 Test
22 \caption{Here we have formulae $\alpha$, $\beta$, $\vec{a}$.\dots}
23 \label{fig:example}
24 \end{figure}
25
26 \subsection{Allowed \texttt{amsmath} environments}
27
28 The \verb|align| environment is part of \verb|amsmath.sty| and
29 therefor works, too:
30 \begin{align}
31 \sin^2x + \cos^2x &=1\,,\\
32 \tan\alpha &= \frac{\sin\alpha}{\cos\alpha}\,.
33 \end{align}
34 \verb|equation| is redefined and allowed:
35 \begin{equation}
36 \sin^2x + \cos^2x = 1\,.
37 \end{equation}
38 \verb|equation*| is defined by \verb|amsmath.sty| and allowed:
39 \begin{equation*}
40 \sin^2x + \cos^2x = 1\,.
41 \end{equation*}
42 \verb|gather|:
43 \begin{gather}
44 \sin^2x + \cos^2x =1\,,\\
45 \tan\alpha = \frac{\sin\alpha}{\cos\alpha}\,.
46 \end{gather}
47 \verb|gather*|:
48 \begin{gather*}
49 \sin^2x + \cos^2x =1\,,\\
50 \tan\alpha = \frac{\sin\alpha}{\cos\alpha}\,.
51 \end{gather*}
52 \verb|multiline|:
53 \begin{multline}
54 \sin^2x + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 \\
55 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + \cos^2x =1\,.
56 \end{multline}
57 \verb|multiline*|:
58 \begin{multline*}
59 \sin^2x + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 \\
60 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + \cos^2x =1\,.
61 \end{multline*}
62 \verb|\[| is redefined and works:
63 \[
64 \sin^2x + \cos^2x = 1\,.
65 \]
66
67
68
69 \subsection{Forbidden \TeX\ and \LaTeX\ environments}
70
71 \verb|eqnarray| is forbidden:
72 \begin{eqnarray}
73 \sin^2x + \cos^2x &=& 1\,.
74 \end{eqnarray}
75 \verb|eqnarray*| is also forbidden:
76 \begin{eqnarray*}
77 \sin^2x + \cos^2x &=& 1\,.
78 \end{eqnarray*}
79 Same for \verb|displaymath|:
80 \begin{displaymath}
81 \sin^2x + \cos^2x = 1\,.
82 \end{displaymath}
83 And of course \verb|$$| (thanks to David Kastrup):
84 $$
85 \sin^2x + \cos^2x = 1\,.
86 $$
87
88 \end{document}