Debian Codegraph @

texmf-dist/doc/latex/eqnlines/eqnlines.tex

raw
1 %%
2 %% This is file `eqnlines.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% eqnlines.dtx (with options: `manual')
8 %%
9 %% Copyright (C) 2024-2026 Niklas Beisert
10 %%
11 %% Based on the latex package amsmath:
12 %% Copyright (C) 1995, 2000, 2013 American Mathematical Society.
13 %% Copyright (C) 2016-2024 LaTeX Project and American Mathematical Society.
14 %%
15 %% This work may be distributed and/or modified under the
16 %% conditions of the LaTeX Project Public License, either version 1.3
17 %% of this license or (at your option) any later version.
18 %% The latest version of this license is in
19 %% https://www.latex-project.org/lppl.txt
20 %% and version 1.3c or later is part of all distributions of LaTeX
21 %% version 2008 or later.
22 %%
23 \ProvidesFile{eqnlines.tex}[2026-03-23 v1.0.1 eqnlines reference manual]
24 \def\thepkg/{eqnlines}\def\thedate/{2026-03-23}\def\theversion/{v1.0.1}
25 \def\thecopyright/{2024\texorpdfstring{--}{-}2026 Niklas Beisert}
26 \PassOptionsToClass{10pt,a4paper}{article}
27 \documentclass{ltxdoc}
28
29 \usepackage[margin=35mm]{geometry}
30 \usepackage[hyperindex=false]{hyperref}
31 \usepackage{hyperxmp}
32 \usepackage[usenames]{color}
33 \usepackage{longtable}
34
35 \title{The \markpkg{\thepkg/} Package\\Reference Manual}
36 \hypersetup{pdftitle={The \thepkg/ Package -- Reference Manual}}
37 \hypersetup{pdfsubject={Reference Manual for the LaTeX2e Package \thepkg/}}
38 \author{Niklas Beisert\\[2ex]
39 Institut f\"ur Theoretische Physik\\
40 Eidgen\"ossische Technische Hochschule Z\"urich\\
41 Wolfgang-Pauli-Strasse 27, 8093 Z\"urich, Switzerland\\[1ex]
42 \href{mailto:[email protected]}
43 {\texttt{[email protected]}}}
44 \hypersetup{pdfauthor={Niklas Beisert}}
45 \date{\theversion/: \markdate{\thedate/}\\[1ex]
46 \url{https://ctan.org/pkg/\thepkg/}\\[0.5ex]
47 \url{https://github.com/nbeisert/latex-pkg-nb}}
48
49 \hypersetup{pdflang={en-UK}}
50 \hypersetup{pdfurl={https://ctan.org/pkg/\thepkg/}}
51 \hypersetup{pdfcopyright={Copyright \thecopyright/.
52 This work may be distributed and/or modified under the
53 conditions of the LaTeX Project Public License, either version 1.3
54 of this license or (at your option) any later version.}}
55 \hypersetup{pdflicenseurl={https://www.latex-project.org/lppl.txt}}
56 \hypersetup{pdfcontactaddress={ETH Zurich, ITP, HIT K,
57 Wolfgang-Pauli-Strasse 27}}
58 \hypersetup{pdfcontactpostcode={8093}}
59 \hypersetup{pdfcontactcity={Zurich}}
60 \hypersetup{pdfcontactcountry={Switzerland}}
61 \hypersetup{pdfcontactemail={[email protected]}}
62 \hypersetup{pdfcontacturl={https://people.phys.ethz.ch/\xmptilde nbeisert/}}
63
64 \hypersetup{keeppdfinfo=true}
65 \hypersetup{pdfsource={}}
66 \AddToHook{begindocument/before}{\hypersetup{colorlinks=false}}
67 \hypersetup{urlbordercolor={.5 1 1}}
68 \hypersetup{linkbordercolor={1 .7 .7}}
69 \AddToHook{begindocument/before}{\hypersetup{pdfstartview=FitH}}
70
71 \parskip1ex
72 \parindent0pt
73 \edef\itemize{\unexpanded\expandafter{\itemize}\parskip0pt}
74
75 \newcommand{\markpkg}[1]{\textsf{#1}}
76 \newcommand{\markdate}[1]{\textsf{#1}}
77 \newcommand{\secref}[1]{\hyperref[#1]{section \ref*{#1}}}
78 \newcommand{\ctanref}[2]{\href{https://ctan.org/#1}{#2}}
79 \newcommand{\ctanpkg}[1]{\ctanref{pkg/#1}{\markpkg{#1}}}
80
81 \def\verbbar{\texttt{\char"7C}}
82 \def\verbpkg{\texttt{\thepkg/}}
83 \def\thepkgctan/{\ctanpkg{\thepkg/}}
84
85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86
87 \RenewDocElement[macrolike = true ,
88 toplevel = false,
89 idxtype = ,
90 idxgroup = LaTeX commands\actualchar\latex/ commands ,
91 printtype =
92 ]{Macro}{macro}
93 \RenewDocElement[macrolike = false ,
94 toplevel = false,
95 idxtype = env. ,
96 idxgroup = Package environments,
97 printtype = \textit{env.}
98 ]{Env}{environment}
99 \NewDocElement[macrolike = true ,
100 toplevel = false,
101 idxtype = ,
102 idxgroup = Package commands,
103 printtype =
104 ]{InterfaceMacro}{imacro}
105 \NewDocElement[macrolike = true ,
106 toplevel = false,
107 idxtype = ,
108 idxgroup = Package commands (obsolete),
109 printtype =
110 ]{ObsoleteInterfaceMacro}{omacro}
111 \NewDocElement[macrolike = false ,
112 toplevel = false,
113 idxtype = key ,
114 idxgroup = Package keys ,
115 printtype = \textit{key}
116 ]{Key}{key}
117 \NewDocElement[macrolike = false ,
118 toplevel = false,
119 idxtype = mod ,
120 idxgroup = Command modifiers ,
121 printtype = \textit{mod.}
122 ]{Mod}{modifier}
123 \NewDocElement[macrolike = false ,
124 toplevel = false,
125 idxtype = ctrl ,
126 idxgroup = Control key ,
127 printtype = \textit{ctrl.}
128 ]{Control}{controlkey}
129 \NewDocElement[macrolike = false ,
130 toplevel = false,
131 idxtype = setup ,
132 idxgroup = Setup key ,
133 printtype = \textit{setup}
134 ]{Setup}{setupkey}
135 \NewDocElement[macrolike = false ,
136 toplevel = false,
137 idxtype = opt ,
138 idxgroup = Option key ,
139 printtype = \textit{opt.}
140 ]{Option}{optionkey}
141 \NewDocElement[macrolike = true ,
142 toplevel = false,
143 idxtype = counter ,
144 idxgroup = TeX counters\actualchar \protect\tex/ counters ,
145 printtype = \textit{counter}
146 ]{TeXCounter}{tcounter}
147 \NewDocElement[macrolike = false ,
148 toplevel = false,
149 idxtype = counter ,
150 idxgroup = LaTeX counters\actualchar \latex/ counters ,
151 printtype = \textit{counter}
152 ]{LaTeXCounter}{lcounter}
153 \NewDocElement[macrolike = true ,
154 toplevel = false,
155 idxtype = skip ,
156 idxgroup = LaTeX length\actualchar \latex/ length (skip) ,
157 printtype = \textit{skip}
158 ]{LaTeXSkip}{lskip}
159 \NewDocElement[macrolike = true ,
160 toplevel = false,
161 idxtype = dimen ,
162 idxgroup = LaTeX length\actualchar \latex/ length (dimen) ,
163 printtype = \textit{dimen}
164 ]{LaTeXDimen}{ldimen}
165 \NewDocElement[macrolike = true ,
166 toplevel = false,
167 idxtype = box ,
168 idxgroup = LaTeX box\actualchar \latex/ box ,
169 printtype = \textit{box}
170 ]{LaTeXBox}{lbox}
171 \NewDocElement[macrolike = true ,
172 toplevel = false,
173 idxtype = bool ,
174 idxgroup = eqnlines bool\actualchar eqnlines bool ,
175 printtype = \textit{bool}
176 ]{eqnlinesBool}{ebool}
177 \NewDocElement[macrolike = true ,
178 toplevel = false,
179 idxtype = bool ,
180 idxgroup = LaTeX conditional\actualchar \latex/ conditional ,
181 printtype = \textit{bool}
182 ]{LaTeXConditional}{lcond}
183
184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
185
186 \usepackage{verbatim}
187 \makeatletter
188 \def\example@addline#1{%
189 \g@addto@macro\example@dbuf{#1 }%
190 \g@addto@macro\example@pbuf{\item|#1|}}
191 \def\scanexample{%
192 \gdef\example@dbuf{}%
193 \gdef\example@pbuf{}%
194 \begingroup
195 \@bsphack
196 \let\do\@makeother\dospecials
197 \catcode`\^^M\active
198 \def\verbatim@processline{\expandafter\example@addline\expandafter%
199 {\the\verbatim@line}}%
200 \verbatim@start}
201 \def\endscanexample{\@esphack\endgroup\ignorespacesafterend}
202 \def\printexample{\begingroup
203 \topsep\z@skip\parsep\z@skip\itemsep\z@skip\partopsep\z@skip\parskip\z@skip
204 \trivlist
205 \expandafter\scantokens\expandafter{\example@pbuf}%
206 \endtrivlist
207 \endgroup}
208 \def\doexample{\expandafter\scantokens\expandafter{\example@dbuf}}
209 \newcommand{\showexampleh}[1][0.5]{\par%
210 \parbox{\dimexpr#1\textwidth\relax}{\printexample}%
211 \parbox{\dimexpr\textwidth-#1\textwidth\relax}{\doexample}%
212 \par\medskip\ignorespaces}
213 \newcommand{\showexamplev}{%
214 \printexample
215 \par\medskip
216 \parbox{\textwidth}{\doexample}%
217 \par\medskip\ignorespaces}
218 \newenvironment{example}
219 {\parskip\z@skip\par\medskip\hrule\medskip}
220 {\par\hrule\par\medskip}
221 \makeatother
222
223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
224
225 \newcommand{\TODO}{\textbf{\textcolor{red}{TODO:}} }
226
227 \def\tex/{\TeX}
228 \def\latex/{\LaTeX}
229 \def\amsmath/{\ctanpkg{amsmath}}
230
231 \usepackage{eqnlines}
232 \eqnlinesset{belowtopmode=top,belowtopskip=0pt}
233 \def\pstrut{\vphantom{(}}
234 \def\bstrut{\vphantom{b}}
235
236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
239 \begin{document}
240
241 \maketitle
242
243 \begin{abstract}\noindent
244 \markpkg{eqnlines} is a \LaTeXe{} package providing
245 a framework for typesetting single- and multi-line equations
246 which extends the established equation environments
247 of \latex/ and the \markpkg{amsmath} package
248 with many options for convenient adjustment of the intended layout.
249 In particular, the package adds flexible schemes for numbering,
250 horizontal alignment and semi-automatic punctuation, and it improves
251 upon the horizontal and vertical spacing options. The extensions can
252 be used and adjusted through optional arguments and modifiers to the
253 equation environments as well as global settings.
254 \end{abstract}
255
256 \begingroup
257 \parskip0ex
258 \tableofcontents
259 \endgroup
260
261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263 \section{Introduction}
264
265 Typesetting mathematical equations is an undisputed strength of \tex/.
266 \latex/ improved the overall management of display equations,
267 for instance by providing optional numbering.
268 It also added elementary functionality for multi-line equations
269 with alignment. Some of its deficiencies were addressed by
270 the multi-line equation environments of the package \amsmath/
271 which have become an established standard for these purposes.
272
273 The package \ctanpkg{eqnlines} builds upon and extends
274 the functionality of the \latex/ and \amsmath/
275 equation environments with some new features
276 as well as convenient options to adjust the layout where needed.
277 The main additions are as follows:
278 \begin{itemize}
279 \item
280 Equation numbers can be assigned to individual lines
281 (as for |align| and |gather|)
282 or once for the multi-line equation block
283 (as for |multline|).
284 In the former case,
285 a sub-numbering scheme can be applied (as through |subequations|).
286 In the latter case, the position can be assigned to a specific line
287 (first/middle/last/chosen).
288 Moreover, equation numbers can be turned on and off by commands,
289 and they can be triggered by setting a label.
290 \item
291 The vertical spacing above and below single- and multi-line equations
292 of \latex/ and \amsmath/ can be somewhat variable,
293 hard to control and even resistive in certain situations.
294 The package implements clearer structures controlling the vertical spacing,
295 including proper dependency on the text line above
296 and ways to adjust the spacing.
297 \item
298 The framework introduces a scheme which semi-automatically inserts punctuation,
299 e.g.\ `.' or `,', at the end of the following (or every) equation environment.
300 Punctuation can also be inserted at every alignment column or equation line
301 including the possibility to prepend a certain spacing.
302 \item
303 Next to |\[|\,\ldots|\]| as an alias for the single-line |equation| environment,
304 the package uses |\<|\,\ldots|\>| as an alias multi-line equations.
305 \item
306 The horizontal alignment and indentation of equation lines
307 can be adjusted via a scheme or on a line-by-line basis.
308 \item
309 The alignment marker can be placed
310 before or after the equation signs while maintaining proper spacing
311 to symbols before and after it.
312 This simplifies the construction of continuing equations
313 in an aligned context.
314 \item
315 Equation lines are subject to shrinking of space
316 if the available space does not suffice
317 (analogously to single-line equations).
318 \item
319 Most settings can be controlled via optional arguments and modifiers to the
320 equation environment or via global settings.
321 This includes switching between different types of equation environments,
322 enabling or disabling numbering, adjusting vertical spacing, etc.
323 This feature simplifies the adjustment and fine-tuning of equations
324 towards the intended layout.
325 \item
326 Last but not least, the underlying \amsmath/ code,
327 originating from the \tex/ era and early \latex/ years,
328 has been redesigned with emphasis
329 on clarity, readability, adjustability and maintainability
330 (but at the cost of moderately higher resource consumption
331 and moderately lower efficiency).
332 Nevertheless, it remains original \LaTeXe{} code
333 without using the \markpkg{expl3} layer.
334 \end{itemize}
335
336 The package represents a stand-alone implementation
337 of an equations environment
338 which is largely compatible with the established \latex/ and \amsmath/
339 environments |equation|, |multline|, |gather|, |align|
340 and their variants.
341 Hence, the package can be used instead of \amsmath/
342 with no or minor modifications to the \latex/ sources for
343 single- and multi-line equations.
344 It can also be used alongside \amsmath/
345 including the \ctanpkg{mathtools} extensions
346 to make use of the additional maths typesetting features
347 provided by these packages.
348 In the latter case,
349 the equation environments of \latex/ and \amsmath/
350 are either replaced or left in place while the \ctanpkg{eqnlines}
351 environments can be accessed using the alternate name |equations|.
352
353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355 \section{Usage}
356 \label{sec:usage}
357
358 To use the \ctanpkg{eqnlines} package add the command
359 \begin{center}
360 |\usepackage{eqnlines}|
361 \end{center}
362 to the preamble of the \latex/ document.
363 To use unrelated features of the \amsmath/ package
364 or of the \ctanpkg{mathtools} extension,
365 it makes sense to load these packages \emph{before} \ctanpkg{eqnlines}.
366
367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
368 \subsection{Equations Environment}
369 \label{sec:equations}
370
371 The package provides the principal environment |equations|:
372 \begin{center}
373 \begin{tabular}{l}
374 |\begin{equations}[|\textit{opts}|]|
375 \\
376 \textit{math content}
377 \\
378 |\end{equations}|
379 \end{tabular}
380 \end{center}
381 It combines and generalises the \latex/ environments
382 |displaymath| and |equation|
383 with the \amsmath/ environments |multline|, |gather| and |align|
384 to display \textit{math content} consisting of single or multiple
385 equation lines and/or columns.
386
387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388 \paragraph{Options.}
389
390 \DescribeEnv{equations}
391 The environment |equations|
392 accepts a comma-separated list of optional parameters \textit{opts}
393 to adjust the math content display in various ways
394 or to invoke special features.
395 Note that the combination `|[|\textit{opts}|]|'
396 must follow |{equations}| immediately without whitespaces.
397
398 \DescribeInterfaceMacro{\eqnlinesset}
399 Most options, but not all, can be set permanently by the macro:
400 \begin{center}
401 |\eqnlinesset{|\textit{opts}|}|
402 \end{center}
403 \DescribeInterfaceMacro{\eqnaddopt}
404 Options for the following equations block only are set by the macro:
405 \begin{center}
406 |\eqnaddopt{|\textit{opts}|}|
407 \end{center}
408 \DescribeInterfaceMacro{\eqncontrol}
409 Some options can be controlled
410 for individual lines or cells within the equations block by the macro:
411 \begin{center}
412 |\eqncontrol{|\textit{ctrls}|}|
413 \end{center}
414 The |\eqncontrol| interface also provides several features
415 for which no other macro definitions exist.
416
417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
418 \paragraph{Modes of Operation.}
419
420 The main maths environment |equations|
421 has three principal modes of operation.
422 It can display a single-line equation
423 just as the \latex/ environments |equation| or |displaymath|:
424 \[*
425 \framebox[8cm]{\pstrut single line}
426 \]
427 It can display a stack of equations
428 analogous to the \amsmath/ environments |gather| and |multline|:
429 \unskip\footnote{Arguably, a single-line equation is
430 just a stack of equations of height 1.
431 Nevertheless, there is a single-line mode
432 which prohibits line breaks and which works slightly more efficiently:
433 For example, the multi-line modes will process the input
434 twice which is not needed for the single-line mode.
435 Apart from that, the package takes care that the layout and spacing
436 of single-line equations and multi-line equations consisting of a single line
437 is the same.}
438 \<=*[pad]
439 \framebox[4cm]{\pstrut stacked line 1}
440 \\
441 \framebox[7cm]{\pstrut stacked line 2}
442 \\
443 \framebox[5cm]{\pstrut stacked line 3}
444 \\
445 \shoveright\framebox[5cm]{\pstrut stacked line 4}
446 \>
447 It can also display one or several columns of aligned equations
448 analogous to the \amsmath/ environment family |align|:
449 \<*
450 \framebox[1.0cm]{\pstrut 1a-L}\hskip-0.5pt&\framebox[3.0cm]{\pstrut 1a-R}
451 &
452 \framebox[1.5cm]{\pstrut 1b-L}\hskip-0.5pt&\framebox[3.5cm]{\pstrut 1b-R}
453 \\
454 \framebox[2.5cm]{\pstrut 2a-L}\hskip-0.5pt&\framebox[4.5cm]{\pstrut 2a-R}
455 &
456 &\framebox[2cm]{\pstrut 2b-R}
457 \\
458 &\framebox[4cm]{\pstrut 3a-R}
459 \>
460
461 \DescribeOption{single}
462 \DescribeOption{lines}
463 \DescribeOption{columns}
464 The three modes of operation
465 are selected by setting an optional argument as follows:
466 \begin{center}
467 \begin{tabular}{llll}
468 purpose & single-line equation & stacked equation(s) & aligned equations \\
469 \hline
470 name & |single| & |lines| & |columns| \\
471 alt.\ names & |equation|, |eq|, |1|
472 & |gather|, |ga|, |ln|
473 & |align|, |al|, |col| \\
474 symbolic & |\[|\textvisiblespace\,\ldots|\]|\textvisiblespace
475 & |\<=|\textvisiblespace\,\ldots|\>|\textvisiblespace
476 & |\<|\textvisiblespace\,\ldots|\>|\textvisiblespace \\
477 \amsmath/ env. & |equation| & |gather|, |multline| & |align| \\
478 \hline
479 columns & --- & single & multiple, aligned \\
480 alignment & adjustable & adjustable & alternating right/left \\
481 parsing & single, direct & two passes & two passes \\
482 numbering & on/off & off/single/multiple & off/single/multiple \\
483 \end{tabular}
484 \end{center}
485 The aligned mode more or less encompasses all three modes,
486 and the stacked mode with only a single line
487 is more or less just a single equation.
488 However, the more complex forms also come along with some restrictions,
489 hence, it makes sense to use the appropriate mode
490 for the intended equation content.
491 For instance, a single equation simply reads the equation input once,
492 while the multi-line equation environments parse the environment body twice
493 which can potentially disrupt some other functionality
494 that is included in the body.
495 Furthermore, the horizontal adjustment options are very restricted
496 in aligned mode, and therefore the aligned form can automatically reduce
497 to the stacked form (with right alignment) if only a single column is provided
498 (no `|&|'s).
499
500 \begin{example}
501 \begin{scanexample}
502 \begin{equations}[single]
503 x=\cos\phi
504 \end{equations}
505 \end{scanexample}
506 \showexampleh
507 \begin{scanexample}
508 \begin{equations}[lines]
509 x=\cos\phi \\ \phi=\arccos x
510 \end{equations}
511 \end{scanexample}
512 \showexampleh
513 \begin{scanexample}
514 \begin{equations}[columns]
515 x&=\cos\phi & \phi&=\arccos x \\
516 &=(z+z^{-1})/2 & &=-i\log z
517 \end{equations}
518 \end{scanexample}
519 \showexampleh
520 \end{example}
521
522 \DescribeInterfaceMacro{\\}
523 \DescribeInterfaceMacro{&}
524 As usual, lines are separated by `|\\|[|*|]|[|\textit{skip}|]|'
525 and columns by `|&|'.
526 The optional argument |[|\textit{skip}|]| to `|\\|' introduces
527 additional glue between the lines;
528 the modifier `|*|' inhibits a page break.
529 \DescribeInterfaceMacro{\&}
530 Furthermore, the package overloads the combination `|\&|'
531 to describe a column break
532 It may be used to distinguish
533 the beginning of a new column (second of a pair of `|&|')
534 from the alignment within a column (first of a pair of `|&|').
535 In particular, it will always skip to the left cell of the next column,
536 even if no alignment has been specified;
537 for example, a sequence of `|\&|'
538 can be used to describe some blank columns
539 (with half as many `|&|' required).
540 The syntax of the line and column breaks `|\\|' and `|\&|'
541 is expanded in the symbolic notation described below
542 to conveniently describe equation relations
543 and adjustments to numbering and punctuation.
544
545 \DescribeInterfaceMacro{\&/}
546 \DescribeSetup{amp}
547 Note that the original \latex/ definition `|\&|' for the
548 ampersand character `\&' must be escaped as `|\&/|'
549 within the \ctanpkg{eqnlines} equations blocks.
550 The overloading of `|\&|' can be inhibited by the
551 global option |amp=off|.
552
553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
554 \paragraph{Abbreviated Symbolic Notation.}
555
556 \DescribeInterfaceMacro{\[...\string\]}
557 \DescribeInterfaceMacro{\<...\string\>}
558 The package offers an abbreviated symbolic notation
559 extending the \latex/ display equation structure |\[|\,\ldots|\]|
560 as well as a variant |\<|\,\ldots|\>| dedicated to multi-line equations:
561 \begin{center}
562 \begin{tabular}[c]{l}
563 |\[|\textit{mod}\texttt{\textvisiblespace}
564 \\
565 \textit{math line}
566 \\
567 |\]|\textit{mod}\texttt{\textvisiblespace}
568 \end{tabular}
569 \qquad\qquad
570 \begin{tabular}[c]{l}
571 |\<|\textit{mod}\texttt{\textvisiblespace}
572 \\
573 \textit{math line}\ |\\|\textit{mod}\texttt{\textvisiblespace}
574 \\
575 \textit{math line}\ |\\|\textit{mod}\texttt{\textvisiblespace}
576 \\
577 \ldots
578 \\
579 \textit{math line}
580 \\
581 |\>|\textit{mod}\texttt{\textvisiblespace}
582 \end{tabular}
583 \end{center}
584 This symbolic notation accepts a sequence of modifiers \textit{mod}
585 (analogous to the star modifier `|*|' for many other \latex/ macros)
586 acting as shortcuts for particular options.
587 There can be any number of modifiers and they can be specified in any order.
588 \DescribeMod{[...]}
589 In most cases, a square bracket construct `|[|\ldots|]|'
590 can act as a modifier to specify optional arguments or some dimension.
591 Modifiers can be applied to the opening statements and closing statements
592 (|\[|, |\]|, |\<|, |\>|) as well as the line and column breaks (|\\|, |\&|).
593 Each symbolic command has an associated set of applicable modifiers
594 depending on its context.
595
596 Note that modifiers \textit{mod} must immediately follow
597 the symbolic macros without intermediary whitespaces (space, tab, new line).
598 The sequence of modifiers (even if empty)
599 should be terminated by a whitespace character
600 (`\texttt{\textvisiblespace}' in the above syntax)
601 which marks a clear separation from following math content.
602 Any character or token without a proper meaning in the respective context
603 will also terminate the modifier scanning
604 (while producing a warning message).
605 Future versions of the package may extend the syntax of modifiers,
606 and thus a separation by whitespace is strongly advertised.
607
608 \DescribeMod{[...]}
609 \DescribeMod{-}
610 \DescribeMod{=}
611 \DescribeMod{\verbbar}
612 The opening statements admit a large collection of modifiers
613 which are introduced in their proper context.
614 All optional arguments \textit{opts}
615 can be specified directly using square brackets `|[|\textit{opts}|]|',
616 and the three modes have dedicated selectors `|-|', `|=|' and `\verbbar':
617 \begin{center}
618 \begin{tabular}{cccc}
619 \textit{mod} & corresponding option & description
620 \\\hline
621 |[|\textit{opts}|]| & \textit{opts} & specify options \\
622 |-| & |single| & single-line mode \\
623 |=| & |lines| & lines mode \\
624 \verbbar & |columns| & columns mode \\
625 \end{tabular}
626 \end{center}
627 When a mode is selected explicitly,
628 the choice of |\[|\,\ldots|\]| vs.\ |\<|\,\ldots|\>| does not matter.
629 Hence it is easy to switch between the modes,
630 but it makes good sense to distinguish
631 between the single-line and multi-line modes
632 via the symbolic form.
633
634 \DescribeMod{[...]}
635 \DescribeMod{*}
636 The modifiers for line breaks and closing statements will be discussed later.
637 For example,
638 the modifier `|*|' for the line break `|\\|' inhibits a page break
639 and `|[|\textit{skip}|]|' introduces additional glue between the lines.
640
641 \begin{example}
642 \begin{scanexample}
643 \[
644 x=\cos\phi
645 \]
646 \end{scanexample}
647 \showexampleh
648 \begin{scanexample}
649 \<=
650 x=\cos\phi \\[0.5ex] \phi=\arccos x
651 \>
652 \end{scanexample}
653 \showexampleh
654 \begin{scanexample}
655 \<
656 x&=\cos\phi & \phi&=\arccos x \\
657 &=(z+z^{-1})/2 & &=-i\log z
658 \>
659 \end{scanexample}
660 \showexampleh
661 \begin{scanexample}
662 \eqnlinesset{sqropt={nonumber}}
663 \[ x=\cos\phi \]
664 \end{scanexample}
665 \showexampleh
666 \end{example}
667
668 \DescribeKey{modifier...}
669 Note that modifiers are disabled by default
670 for the |equations| environment (and its derivatives).
671 They can be enabled by the global setting |modifiereqnenv|.
672 Similar global settings to control the scanning of modifiers
673 exist for the symbolic forms as well as for breaks and ends.
674
675 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
676 \paragraph{Alternative and Custom Environments.}
677
678 \DescribeEnv{displaymath}
679 \DescribeEnv{equation}
680 \DescribeEnv{gather}
681 \DescribeEnv{multline}
682 \DescribeEnv{align}
683 The package also supplies or overwrites the \amsmath/
684 environments |equation|, |gather|, |multline|, |align| and |flalign|
685 including their |x|-, -|at| and starred variants
686 (but not the |split| construction).
687 Hence, documents designed for the \amsmath/ framework
688 can be translated to the \ctanpkg{eqnlines} framework
689 with little or no adjustments.
690 \DescribeKey{defaults}
691 Some layout choices may turn out slightly different in
692 the default package settings (|defaults=eqnlines|).
693 For a closer imitation of the classic \latex//\amsmath/ layout,
694 one may specify the global option |defaults=classic|;
695 this also disables most of the advanced notation
696 involving `|\\|', `|\&|' and modifiers.
697
698 It is possible to define further equation environments \textit{env}
699 with a predefined set of options \textit{opts} using:
700 \begin{center}
701 |\|[|re|]|newenvironment{|\textit{env}|}|%
702 |{\eqnaddopt{|\textit{opts}|}\equations}{\endequations}|
703 \end{center}
704 Shortcuts to frequently used control features could be installed by
705 user definitions such as:
706 \begin{center}
707 |\newcommand{\|\textit{shortcut}|}[1]{\eqncontrol{|\textit{key}|={#1}}}|
708 \end{center}
709 \DescribeSetup{sqropt}
710 \DescribeSetup{angopt}
711 The two short forms |\[|\,\ldots|\]| and |\<|\,\ldots|\>| can be customised
712 by setting default arguments via the global options
713 |sqropt={|\textit{opts}|}| and |angopt={|\textit{opts}|}|.
714
715 \begin{example}
716 \begin{scanexample}
717 \begin{equation}
718 x=\cos\phi
719 \end{equation}
720 \end{scanexample}
721 \showexampleh
722 \begin{scanexample}
723 \begin{gather}
724 x=\cos\phi \\ \phi=\arccos x
725 \end{gather}
726 \end{scanexample}
727 \showexampleh
728 \begin{scanexample}
729 \begin{align}
730 x&=\cos\phi & \phi&=\arccos x \\
731 &=(z+z^{-1})/2 & &=-i\log z
732 \end{align}
733 \end{scanexample}
734 \showexampleh
735 \begin{scanexample}
736 \newenvironment{eqnlist}
737 {\eqnaddopt{lines,shape=left}\equations}
738 {\endequations}
739 \begin{eqnlist}[nonumber]
740 x=\cos\phi \\ \phi=\arccos x
741 \end{eqnlist}
742 \end{scanexample}
743 \showexampleh[0.65]
744 \end{example}
745
746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
747 \subsection{Numbering}
748 \label{sec:numbering}
749
750 The package extends the established interface of \latex/
751 and the \amsmath/ package for labelling equations
752 with numbers or with manually assigned tags.
753 The mode of numbering can be set globally via |\eqnlinesset|
754 or locally via the options of an equation block.
755 By default, numbering is turned off for |equations|
756 as well as for the symbolic notation |\[|\,\ldots|\]| and |\<|\,\ldots|\>|.
757
758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
759 \paragraph{Numbering Schemes.}
760
761 \DescribeKey{numberline}
762 \DescribeKey{n}
763 For multi-line equations, there are two distinct modes of operations:
764 individual labelling of the equation lines or
765 one overall number/tag for the whole block of equations.
766 The modes are selected by an optional argument
767 |numberline=|\textit{mode} (alternatively |nline| or just |n|)
768 as follows:
769 \begin{longtable}{llll}
770 name & alt. & description & preset \\
771 \hline
772 |all| & |a| & individual & all lines \\
773 |sub| & |s| & lines & subequations (a,\,b,\,c,\,\ldots) \\
774 \hline
775 |first| & |f| & & first line \\
776 |last| & |l| & & last line \\
777 |out| & |o| & & last/first line for right/left tags \\
778 |in| & |i| & single line & first/last line for right/left tags \\
779 |middle| & |m*| & & middle line (rounded down/up for right/left tags) \\
780 |here| & |h| & & line indicated by |\numberhere| \\
781 |best| & |+| & & line with most available space \\
782 \hline
783 |top| & |t| & & at top \\
784 |bottom| & |b| & & at bottom \\
785 |center| & |c| & between & at vertical centre (single line at baseline) \\
786 |center!| & |c!| & lines & at vertical centre (also single line) \\
787 |median| & |m| & & middle line (at baseline or between lines) \\
788 |center*| & |c*| & & tag baseline centred between outer baselines \\
789 \hline
790 |multi| & |@| & & individual lines, numbering on \\
791 |none| & |-| & mode switch & individual lines, numbering off \\
792 |single| & |1| & & previous single-line mode, numbering on \\
793 \hline
794 |on| & |!| & activation & turn numbering on \\
795 |off| & |*| & & turn numbering off \\
796 \end{longtable}
797
798 \begin{example}
799 \eqnlinesset{number=on}
800 \eqnlinesset{evadetag=false}
801 \begin{scanexample}
802 \eqnlinesset{number=on}
803 \begin{equations}[numberline=...]
804 x &= \cos\phi \\ &= (z+z^{-1})/2 \\
805 \phi &= \arccos x \\ &= -i\log z
806 \end{equations}
807 \end{scanexample}
808 \qquad\parbox{0.8\textwidth}{\printexample}
809 \par\bigskip
810 \makebox[0.33\textwidth]{|all|:}\hfil
811 \makebox[0.33\textwidth]{|sub|:}\hfil
812 \makebox[0.33\textwidth]{|best|:}\par\nobreak\smallskip
813 \begin{minipage}{0.33\textwidth}
814 \begin{equations}[numberline=all]
815 x &= \cos\phi \\ &= (z+z^{-1})/2 \\
816 \phi &= \arccos x \\ &= -i\log z
817 \end{equations}
818 \end{minipage}\vrule\hfil
819 \begin{minipage}{0.33\textwidth}
820 \begin{equations}[numberline=sub]
821 x &= \cos\phi \\ &= (z+z^{-1})/2 \\
822 \phi &= \arccos x \\ &= -i\log z
823 \end{equations}
824 \end{minipage}\vrule\hfil
825 \begin{minipage}{0.33\textwidth}
826 \begin{equations}[numberline=best]
827 x &= \cos\phi \\ &= (z+z^{-1})/2 \\
828 \phi &= \arccos x \\ &= -i\log z
829 \end{equations}
830 \end{minipage}
831 \par\bigskip
832 \makebox[0.33\textwidth]{|first|:}\hfil
833 \makebox[0.33\textwidth]{|last|:}\hfil
834 \makebox[0.33\textwidth]{|middle|:}\par\nobreak\smallskip
835 \begin{minipage}{0.33\textwidth}
836 \begin{equations}[numberline=first]
837 x &= \cos\phi \\ &= (z+z^{-1})/2 \\
838 \phi &= \arccos x \\ &= -i\log z
839 \end{equations}
840 \end{minipage}\vrule\hfil
841 \begin{minipage}{0.33\textwidth}
842 \begin{equations}[numberline=last]
843 x &= \cos\phi \\ &= (z+z^{-1})/2 \\
844 \phi &= \arccos x \\ &= -i\log z
845 \end{equations}
846 \end{minipage}\vrule\hfil
847 \begin{minipage}{0.33\textwidth}
848 \begin{equations}[numberline=middle]
849 x &= \cos\phi \\ &= (z+z^{-1})/2 \\
850 \phi &= \arccos x \\ &= -i\log z
851 \end{equations}
852 \end{minipage}
853 \par\bigskip
854 \makebox[0.33\textwidth]{|top|:}\hfil
855 \makebox[0.33\textwidth]{|bottom|:}\hfil
856 \makebox[0.33\textwidth]{|center!|:}\par\nobreak\smallskip
857 \begin{minipage}{0.33\textwidth}
858 \begin{equations}[1,numberline=top]
859 1+\frac{1}{\displaystyle 1+\frac{1}{\displaystyle 1+\ldots}}
860 \end{equations}
861 \end{minipage}\vrule\hfil
862 \begin{minipage}{0.33\textwidth}
863 \begin{equations}[1,numberline=bottom]
864 1+\frac{1}{\displaystyle 1+\frac{1}{\displaystyle 1+\ldots}}
865 \end{equations}
866 \end{minipage}\vrule\hfil
867 \begin{minipage}{0.33\textwidth}
868 \begin{equations}[1,numberline=center!]
869 1+\frac{1}{\displaystyle 1+\frac{1}{\displaystyle 1+\ldots}}
870 \end{equations}
871 \end{minipage}
872 \par\bigskip
873 \makebox[0.33\textwidth]{|median|:}\hfil
874 \makebox[0.33\textwidth]{|center*|:}\hfil
875 \makebox[0.33\textwidth]{|center|:}\par\nobreak\smallskip
876 \begin{minipage}{0.33\textwidth}
877 \begin{equations}[numberline=median]
878 x &= -\int \sin\phi\,\mathrm{d}\phi \\
879 &= \cos\phi
880 \end{equations}
881 \end{minipage}\vrule\hfil
882 \begin{minipage}{0.33\textwidth}
883 \begin{equations}[numberline=center*]
884 x &= -\int \sin\phi\,\mathrm{d}\phi \\
885 &= \cos\phi
886 \end{equations}
887 \end{minipage}\vrule\hfil
888 \begin{minipage}{0.33\textwidth}
889 \begin{equations}[numberline=center]
890 x &= -\int \sin\phi\,\mathrm{d}\phi \\
891 &= \cos\phi
892 \end{equations}
893 \end{minipage}
894 \end{example}
895
896 \DescribeKey{evadetag}
897 Note that the mode |best| (line with most available space)
898 is activated automatically if the (single) tagged line
899 does not have sufficient space to hold the tag.
900 This feature can be controlled by the setting
901 |evadetag=|\textit{bool}.
902
903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
904 \paragraph{Activation and Selection.}
905
906 \DescribeKey{number}
907 \DescribeKey{nonumber}
908 \DescribeKey{donumber}
909 The default numbering of equation blocks (initially off) is controlled by:
910 \begin{center}
911 |\eqnlinesset{number=|\textit{bool}|}|
912 \qquad or\qquad
913 |\eqnlinesset{donumber|\textbar|nonumber}|
914 \end{center}
915 with \textit{bool} either |on| or |off| (among several alternative forms).
916 This applies equally to the environment |equations|
917 and to the symbolic forms |\[|\,\ldots|\]| and |\<|\,\ldots|\>|.
918 If numbering is to be used for |equations| only,
919 but not for the symbolic forms,
920 one can suppress it for the latter by
921 declaring |nonumber| as their default option:
922 \begin{center}
923 |\eqnlinesset{sqropt=nonumber,angopt=nonumber}|
924 \end{center}
925
926 \DescribeInterfaceMacro{\nonumber}
927 \DescribeInterfaceMacro{\donumber}
928 Numbering can be turned on and off
929 (for individual lines or for the block as a whole depending on the mode)
930 by means of:
931 \begin{center}
932 |\nonumber|
933 \qquad and \qquad
934 |\donumber|
935 \end{center}
936 \DescribeKey{nonumber}
937 \DescribeKey{donumber}
938 \DescribeKey{number}
939 \DescribeKey{nn,*}
940 \DescribeKey{dn,!}
941 \DescribeMod{*}
942 \DescribeMod{!}
943 The numbering can be disabled or enabled for the block
944 by the keys |nonumber| or |donumber| (`|nn|'=`|*|' or `|dn|'=`|!|' for short)
945 or by |number=|\textit{bool}.
946 In the symbolic notation, the number can be switched by using modifiers:
947 \begin{center}
948 |\[*|\textvisiblespace\,\ldots|\]|
949 \qquad and \qquad
950 |\[!|\textvisiblespace\,\ldots|\]|
951 \end{center}
952 Altogether, this allows to define a default behaviour
953 and specify exceptions where they may occur.
954 The optional argument `|[*]|'
955 or the star modifier `|*|' following directly the symbolic opening statement
956 replaces the starred form of environments (|equation*|, etc.)
957 and there is no need to adjust the closing statement.
958 If numbering is disabled by default,
959 the optional argument `|[!]|' or the modifier `|!|'
960 can be used to enable numbering for the block.
961
962 \DescribeInterfaceMacro{\numberhere}
963 \DescribeInterfaceMacro{\numbernext}
964 The placement of a single number for an equation block can be adjusted by:
965 \begin{center}
966 |\numberhere|
967 \qquad and \qquad
968 |\numbernext|
969 \end{center}
970 The former macro overrides the position to the present line,
971 the latter macro defers the number to the next line.
972 For example, if an equation is broken into several lines
973 one may use the combination |\numbernext \\|
974 to assign the number to the last line within the set.
975 \DescribeMod{/}
976 Note that the modified newline `|\\/|' combines
977 |\numbernext| and |\\|
978 \begin{center}
979 |\\/|\quad\textrightarrow\quad|\numbernext \\|\quad(or |\nonumber \\|)
980 \end{center}
981
982 \begin{example}
983 \eqnlinesset{number=on}
984 \begin{scanexample}
985 \begin{equations}
986 x &= \cos\phi \nonumber \\
987 &= (z+z^{-1})/2 \\
988 \phi &= \arccos x \nonumber \\
989 &= -i\log z
990 \end{equations}
991 \end{scanexample}
992 \showexampleh
993 \begin{scanexample}
994 \begin{equations}[nonumber]
995 x &= \cos\phi \donumber \\
996 &= (z+z^{-1})/2 \\
997 \phi &= \arccos x \donumber \\
998 &= -i\log z
999 \end{equations}
1000 \end{scanexample}
1001 \showexampleh
1002 \begin{scanexample}
1003 \eqnlinesset{numberline=last}
1004 \< x &= \cos\phi \\
1005 \phi &= \arccos x \>
1006 \end{scanexample}
1007 \showexampleh
1008 \begin{scanexample}
1009 \eqnlinesset{angopt=nonumber}
1010 \<! x &= \cos\phi \\
1011 \phi &= \arccos x \>
1012 \end{scanexample}
1013 \showexampleh
1014 \begin{scanexample}
1015 \< x &= \cos\phi \\/
1016 &= (z+z^{-1})/2 \\
1017 \phi &= \arccos x \\/
1018 &= -i\log z \>
1019 \end{scanexample}
1020 \showexampleh
1021 \begin{scanexample}
1022 \eqnlinesset{numberline=here}
1023 \< x &= \cos\phi \\
1024 &= (z+z^{-1})/2 \\
1025 \phi &= \arccos x \numberhere \\
1026 &= -i\log z \>
1027 \end{scanexample}
1028 \showexampleh
1029 \begin{scanexample}
1030 \eqnlinesset{numberline=first}
1031 \< x &= \cos\phi \\/
1032 &= (z+z^{-1})/2 \\
1033 \phi &= \arccos x \\/
1034 &= -i\log z \>
1035 \end{scanexample}
1036 \showexampleh
1037 \end{example}
1038
1039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1040 \paragraph{Labels and Tags.}
1041
1042 \DescribeInterfaceMacro{\label}
1043 \DescribeInterfaceMacro{\tag}
1044 Equation numbers can be equipped with \latex/ labels as usual,
1045 and they can be turned into manually assigned tags
1046 using the established macros:
1047 \begin{center}
1048 |\label[|\textit{name}|]{|\textit{label}|}|
1049 \qquad and \qquad
1050 |\tag|[|*|]|[|\textit{ref}|]{|\textit{tag}|}|
1051 \end{center}
1052 The optional parameter \textit{name} for |\label| assigns
1053 a name to the label which can be referenced by |\nameref|.
1054 A |\tag| replaces the equation number,
1055 |\tag*| will drop the decoration by parentheses.
1056 The optional parameter \textit{ref} for |\tag|
1057 defines the representation of references by |\ref|.
1058
1059 Note that a label and a tag will always apply to the
1060 next number that will be printed, and only a single label
1061 and/or tag may be specified for it. For example, if the present line
1062 has no numbering, but the following line does,
1063 |\label| or |\tag| will apply to the following line.
1064
1065 The macros |\label| and |\tag|
1066 can also be instructed to automatically enable numbering/tagging
1067 for the present line or block via |\donumber|, see below.
1068 By default, numbering/tagging is triggered for |\tag|,
1069 but not for |\label| reflecting the behaviour set forth by \amsmath/.
1070 By enabling triggering for |\label|, numbers will be produced
1071 only if they have a chance of being referenced.
1072
1073 \DescribeOption{label}
1074 \DescribeOption{tag}
1075 \DescribeKey{labelname}
1076 \DescribeKey{taglabel}
1077 The |equations| environment provides an alternative means
1078 to specify labels and tags within the optional arguments |[|\textit{opts}|]|
1079 \begin{center}
1080 |label={|\textit{label}|}|,
1081 \qquad
1082 |tag|[|*|]|={|\textit{tag}|}|,
1083 \qquad
1084 |labelname={|\textit{name}|}|,
1085 \qquad
1086 |taglabel={|\textit{ref}|}|,
1087 \end{center}
1088 \DescribeMod{@}
1089 or via the modifier |@{|\textit{label}|}|:
1090 \begin{center}
1091 |\[@{|\textit{label}|}|\,\ldots|\]|
1092 \end{center}
1093 In particular, in subequations mode (|sub|),
1094 the optional argument |label| can be used to assign
1095 a label to the parent number addressing the whole equation block.
1096
1097 The above macros may also be used via the keys
1098 |label|, |labelname|, |tag| and |taglabel|
1099 of the interface |\eqncontrol|.
1100
1101 \DescribeInterfaceMacro{\eqref}
1102 The macro |\eqref| is the standard method for referring
1103 to equation numbers via their label.
1104 This method also uses the layout defined below.
1105 \begin{center}
1106 |\eqref{|\textit{label}|}|.
1107 \end{center}
1108 \DescribeInterfaceMacro{\tagform}
1109 \DescribeInterfaceMacro{\tagbox}
1110 \DescribeInterfaceMacro{\tagboxed}
1111 For custom typesetting of numbers and tags,
1112 |\tagform| encloses a number/tag with some decoration,
1113 |\tagbox| puts the decorated number in a box
1114 and |\tagboxed| combines the two for use in a single macro call.
1115
1116 \DescribeSetup{tagbox}
1117 \DescribeSetup{tagform}
1118 \DescribeSetup{tagform*}
1119 The typesetting of equation numbers and tags passes through two macros
1120 (which are exposed by |\tagbox| and |\tagform|),
1121 one which defines the layout
1122 and another one which adds a decoration by parentheses.
1123 These two methods can be adjusted via the options:
1124 \begin{center}
1125 |tagbox|[|*|]|={|\textit{code}|}|
1126 \quad and\quad
1127 |tagform={|\textit{l}|{|\textit{code}|}|\textit{r}|}|
1128 \quad or\quad
1129 |tagform*={|\textit{code}|}|
1130 \end{center}
1131 Here, \textit{code} is some macro code
1132 that references the argument `|#1|' containing the
1133 number or tag, and \textit{l} and \textit{r}
1134 can be opening and closing parentheses for the tag presentation.
1135
1136 The above setting may also be changed for individual lines
1137 by the corresponding keys of the interface |\eqncontrol|.
1138
1139 \begin{example}
1140 \eqnlinesset{number=on}
1141 \begin{scanexample}
1142 \eqnlinesset{tagform=[{#1}]}
1143 \eqnlinesset{tagbox={\textcolor{blue}{#1}}}
1144 \<[numberline=last]
1145 x &= \cos\phi \\
1146 &= (z+z^{-1})/2 \\
1147 \phi &= \arccos x \\
1148 &= -i\log z
1149 \>
1150 \end{scanexample}
1151 \showexampleh[0.6]
1152 \end{example}
1153
1154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1155 \subsection{Horizontal Placement}
1156 \label{sec:adjustment}
1157
1158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1159 \paragraph{Overall Layout.}
1160
1161 \DescribeKey{layout}
1162 \DescribeKey{center}
1163 \DescribeKey{left}
1164 First of all, the overall layout can be adjusted
1165 between central and left alignment
1166 via |layout=center|, |layout=left| or |center|, |left| for short.
1167
1168 \begin{example}
1169 \begin{scanexample}
1170 \<[layout=center]
1171 x &= \cos\phi \\
1172 &= (z+z^{-1})/2 \\
1173 \phi &= \arccos x \\
1174 &= -i\log z
1175 \>
1176 \end{scanexample}
1177 \showexampleh[0.35]
1178 \begin{scanexample}
1179 \<[layout=left]
1180 x &= \cos\phi \\
1181 &= (z+z^{-1})/2 \\
1182 \phi &= \arccos x \\
1183 &= -i\log z
1184 \>
1185 \end{scanexample}
1186 \showexampleh[0.35]
1187 \end{example}
1188
1189 \DescribeKey{tags}
1190 \DescribeKey{tagsright}
1191 \DescribeKey{tagsleft}
1192 Furthermore, numbers and/or tags may be placed
1193 on the right or left margin
1194 via |tags=right|, |tags=left| or |tagsright|, |tagsleft| for short.
1195
1196 \begin{example}
1197 \eqnlinesset{number=on}
1198 \begin{scanexample}
1199 \<[tags=right]
1200 x &= \cos\phi \\
1201 &= (z+z^{-1})/2 \\
1202 \phi &= \arccos x \\
1203 &= -i\log z
1204 \>
1205 \end{scanexample}
1206 \showexampleh[0.35]
1207 \begin{scanexample}
1208 \<[tags=left]
1209 x &= \cos\phi \\
1210 &= (z+z^{-1})/2 \\
1211 \phi &= \arccos x \\
1212 &= -i\log z
1213 \>
1214 \end{scanexample}
1215 \showexampleh[0.35]
1216 \end{example}
1217
1218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1219 \paragraph{Margins.}
1220
1221 \DescribeKey{margin}
1222 \DescribeKey{marginleft}
1223 \DescribeKey{marginright}
1224 \DescribeKey{linewidth}
1225 For both layout choices,
1226 the margins and line width of an equation block can be adjusted
1227 by |margin|, |marginleft|, |marginright| or |linewidth|.
1228 The equations and corresponding numbers or tags will be fit
1229 within these bounds. This feature can be used within
1230 lists or enumerations to undo an indentation.
1231
1232 \begin{example}
1233 \def\indicate#1{%
1234 \framebox[\dimexpr\displaywidth-2\fboxsep-2\fboxrule\relax]{\mbox{#1}}}
1235 \begin{scanexample}
1236 \[ \indicate{line width} \]
1237 \end{scanexample}
1238 \showexampleh[0.5]
1239 \begin{scanexample}
1240 \[[margin=2em] \indicate{reduced} \]
1241 \end{scanexample}
1242 \showexampleh[0.5]
1243 \begin{scanexample}
1244 \begin{itemize}
1245 \item first level
1246 \[ \indicate{default width} \]
1247 \[[marginleft=0pt]
1248 \indicate{full width} \]
1249 \end{itemize}
1250 \end{scanexample}
1251 \showexampleh[0.5]
1252 \end{example}
1253
1254 \DescribeKey{tagmargin}
1255 \DescribeKey{tagmargin*}
1256 \DescribeKey{tagmarginratio}
1257 In central alignment layout, one can impose a tag margin
1258 |tagmargin={|\textit{dimen}|}|
1259 which allocates some space to the tag
1260 such that equation content is centred in the remaining horizontal space.
1261 The margin can also be set to the width of some text by
1262 |tagmargin*={|\textit{text}|}| or it can be calculated
1263 as the maximum width of tags by |tagmargin| without parameter (default).
1264 The option |tagmarginratio={|\textit{ratio}|}|
1265 uses the tag margin only for equation blocks
1266 with a ratio of tags to rows above the given (decimal) ratio
1267 (a value above 1 uses the tag margin only for single equations with tags;
1268 default is |0.334|).
1269 The option |tagmarginthreshold={|\textit{threshold}|}|
1270 uses the tag margin only if the ratio of spacings would be below
1271 the given (decimal) threshold (very much off balance;
1272 default is |0.5|).
1273 The latter two options together with some tag margin
1274 can produce a more appealing layout for equation blocks of mixed filling.
1275 In the following example, the former two equations are centred
1276 on all horizontal space
1277 while the latter two equations are centred on the space left of the tag
1278 (the ratio of spacings without tag margin would be very small here):
1279
1280 \begin{example}
1281 \eqnlinesset{number=on}
1282 \begin{scanexample}
1283 \eqnlinesset{tagmarginthreshold=0.7}
1284 \[ \framebox[4em]{} \]
1285 \[ \framebox[8em]{} \]
1286 \[ \framebox[12em]{} \]
1287 \[ \framebox[16em]{} \]
1288 \end{scanexample}
1289 \showexampleh
1290 \end{example}
1291
1292 \DescribeKey{leftmargin}
1293 \DescribeKey{leftmargin*}
1294 \DescribeKey{minleftmargin}
1295 \DescribeKey{maxleftmargin}
1296 In left alignment layout, all equations are left aligned to a left margin
1297 (|leftmargin| is initialised
1298 to the first level of enumerations and itemisations).
1299 It can be set to the width of some text by |leftmargin*={|\textit{text}|}|.
1300 Depending on the situation, the left margin may be
1301 reduced or extended to |minleftmargin| or |maxleftmargin|, respectively.
1302
1303 \begin{example}
1304 \eqnlinesset{number=on}
1305 \eqnlinesset{layout=left}
1306 \begin{scanexample}
1307 \eqnlinesset{layout=left}
1308 \<*
1309 x &= \cos\phi \\
1310 &= (z+z^{-1})/2 \\
1311 \phi &= \arccos x \\
1312 &= -i\log z
1313 \>
1314 \end{scanexample}
1315 \showexampleh[0.35]
1316 \begin{scanexample}
1317 \<[tags=left]
1318 x &= \cos\phi \\
1319 &= (z+z^{-1})/2 \\
1320 \phi &= \arccos x \\
1321 &= -i\log z
1322 \>
1323 \end{scanexample}
1324 \showexampleh[0.35]
1325 \end{example}
1326
1327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1328 \paragraph{Column Separation.}
1329
1330 \DescribeKey{fulllength}
1331 \DescribeKey{mincolsep}
1332 \DescribeKey{maxcolsep}
1333 The horizontal alignment of columns is fixed for aligned multi-line equations:
1334 Each pair of subsequent columns forms a unit which is aligned at the
1335 intermediate alignment marker `|&|'.
1336 These columns are distributed evenly over the available horizontal space.
1337 Here, the outer space left and right of the set of columns
1338 is treated on equal footing to the space between the columns
1339 (option |fulllength=off|; default),
1340 but it can be eliminated so that the outer columns
1341 are pushed right to the margin (option |fulllength=on|).
1342 A minimum and maximum column separation can be specified
1343 via |mincolsep=|\textit{dimen} and |maxcolsep=|\textit{dimen}
1344 (defaults are |2em| and |1em|)
1345 or the maximum column separation can be disabled by |maxcolsep=off|
1346 (which is implied by |fulllength=on|).
1347
1348 \begin{example}
1349 \begin{scanexample}
1350 \<[maxcolsep=2em]
1351 x &= \cos\phi & \phi &= \arccos x \\
1352 &= (z+z^{-1})/2 & &= -i\log z \>
1353 \end{scanexample}
1354 \showexamplev
1355 \begin{scanexample}
1356 \<[maxcolsep=off]
1357 x &= \cos\phi & \phi &= \arccos x \\
1358 &= (z+z^{-1})/2 & &= -i\log z \>
1359 \end{scanexample}
1360 \showexamplev
1361 \begin{scanexample}
1362 \<[fulllength]
1363 x &= \cos\phi & \phi &= \arccos x \\
1364 &= (z+z^{-1})/2 & &= -i\log z \>
1365 \end{scanexample}
1366 \showexamplev
1367 \end{example}
1368
1369 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1370 \paragraph{Alignment Schemes and Control.}
1371
1372 For stacks of equations including single equations,
1373 there is just a single alignment column
1374 whose horizontal alignment can be adjusted via a shape scheme or
1375 by manually adjusting individual lines.
1376 A shape scheme determines the horizontal alignment for each line
1377 and it is specified by the optional argument
1378 |shape=|\textit{mode} as follows:
1379 \begin{center}
1380 \begin{tabular}{llll}
1381 name & alt. & shape & alignment \\
1382 \hline
1383 |default| & |def| & uniform & default\\
1384 \hline
1385 |left| & |l| & & left\\
1386 |center| & |c| & uniform & central \\
1387 |right| & |r| & & right \\
1388 \hline
1389 |first| & |indent|, |rc| & first/rest & first line indented \\
1390 |hanging| & |outdent|, |lc| & first/rest & first line hanging \\
1391 |steps| & |lcr| & first/intermediate/last & left/centre\ldots centre/right\\
1392 \end{tabular}
1393 \end{center}
1394 Note that the |steps| shape comes to use in the replacement \amsmath/
1395 environment |multline|.
1396
1397 \begin{example}
1398 \eqnlinesset{pad=2em}
1399 \begin{scanexample}
1400 \eqnlinesset{pad=2em}
1401 \<=[shape=...] x = \cos\phi \\ x = (z+z^{-1})/2 \\
1402 \phi = \arccos x \\ \phi = -i\log z \>
1403 \end{scanexample}
1404 \qquad\parbox{0.8\textwidth}{\printexample}
1405 \par\bigskip
1406 \makebox[0.33\textwidth]{|left|:}\hfil
1407 \makebox[0.33\textwidth]{|center|:}\hfil
1408 \makebox[0.33\textwidth]{|right|:}\par\nobreak\smallskip
1409 \begin{minipage}{0.33\textwidth}
1410 \<=[shape=left] x = \cos\phi \\ x = (z+z^{-1})/2 \\
1411 \phi = \arccos x \\ \phi = -i\log z \>
1412 \end{minipage}\vrule\hfill
1413 \begin{minipage}{0.33\textwidth}
1414 \<=[shape=center] x = \cos\phi \\ x = (z+z^{-1})/2 \\
1415 \phi = \arccos x \\ \phi = -i\log z \>
1416 \end{minipage}\vrule\hfill
1417 \begin{minipage}{0.33\textwidth}
1418 \<=[shape=right] x = \cos\phi \\ x = (z+z^{-1})/2 \\
1419 \phi = \arccos x \\ \phi = -i\log z \>
1420 \end{minipage}
1421 \par\bigskip
1422 \makebox[0.33\textwidth]{|first|:}\hfil
1423 \makebox[0.33\textwidth]{|hanging|:}\hfil
1424 \makebox[0.33\textwidth]{|steps|:}\par\nobreak\smallskip
1425 \begin{minipage}{0.33\textwidth}
1426 \<=[shape=first] x = \cos\phi \\ x = (z+z^{-1})/2 \\
1427 \phi = \arccos x \\ \phi = -i\log z \>
1428 \end{minipage}\vrule
1429 \begin{minipage}{0.33\textwidth}
1430 \<=[shape=hanging] x = \cos\phi \\ x = (z+z^{-1})/2 \\
1431 \phi = \arccos x \\ \phi = -i\log z \>
1432 \end{minipage}\vrule
1433 \begin{minipage}{0.33\textwidth}
1434 \<=[shape=steps] x = \cos\phi \\ x = (z+z^{-1})/2 \\
1435 \phi = \arccos x \\ \phi = -i\log z \>
1436 \end{minipage}
1437 \end{example}
1438
1439 \DescribeControl{align}
1440 \DescribeControl{shiftto}
1441 \DescribeControl{shiftby}
1442 The alignment preset can be adjusted for individual lines by the controls:
1443 \begin{center}
1444 \begin{tabular}{l}
1445 |\eqncontrol{align=left|\textbar|center|\textbar|right}|\\
1446 |\eqncontrol{shiftto|\textbar|shiftby=|\textit{dimen}|}|
1447 \end{tabular}
1448 \end{center}
1449 \DescribeInterfaceMacro{\shoveleft}
1450 \DescribeInterfaceMacro{\shovecenter}
1451 \DescribeInterfaceMacro{\shoveright}
1452 or by the macros:
1453 \begin{center}
1454 |\shoveleft|\textbar|\shovecenter|\textbar|\shoveright|%
1455 [|*|\textbar|!|\textbar|[|\textit{dimen}|]|],
1456 \end{center}
1457 In contradistinction to \amsmath/,
1458 these macros can be placed anywhere within the cell
1459 and they do not take the cell contents as their argument
1460 (doing this here will disallow shrinking of glue towards reducing width).
1461 The macros accept an optional argument |[|\textit{dimen}|]|
1462 specifying a variable amount of shift.
1463 \DescribeKey{indent}
1464 They also accept the modifiers
1465 `|*|' or `|!|' for indentation or hanging indentation by
1466 the standard indentation amount (|indent|=|2em|).
1467 \DescribeInterfaceMacro{\shoveby}
1468 Furthermore, |\shoveby|[|*|]|{|\textit{dimen}|}|
1469 shifts the line by the additional amount \textit{dimen}
1470 (the star variant shifts to an absolute position
1471 relative to the reference position).
1472
1473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1474 \paragraph{Reference Positions.}
1475
1476 \DescribeKey{padding}
1477 \DescribeKey{padleft}
1478 \DescribeKey{padright}
1479 The reference positions for left, right and central alignment
1480 are determined as follows:
1481 The central reference position marks the centre of
1482 the available horizontal space.
1483 The left and right reference positions are given
1484 by the ends of the widest line placed centrally.
1485 The latter can be adjusted by adding
1486 some padding around the widest line via the optional argument
1487 |padding|\textbar|padleft|\textbar|padright|[|={|\textit{dimen}|}|]
1488 while preserving the central default position.
1489 The value `|indent|' sets the padding to the default indentation amount
1490 and `|max|' extends the padding to all available space.
1491 Note that |indent*={|\textit{dimen}|}| sets the default indentation amount
1492 and the left padding at the same time.
1493
1494 \begin{example}
1495 \begin{scanexample}
1496 \eqnlinesset{indent=2em,pad=5em}
1497 \<=
1498 \shoveleft \framebox[5em]{left} \\
1499 \shoveleft* \framebox[5em]{indent} \\
1500 \shovecenter \framebox[5em]{center} \\
1501 \shoveright \framebox[5em]{right}
1502 \>
1503 \end{scanexample}
1504 \showexampleh[0.55]
1505 \begin{scanexample}
1506 \eqnlinesset{layout=left}
1507 \eqnlinesset{leftmargin=2em}
1508 \eqnlinesset{indent=2em}
1509 \<=
1510 \shoveleft! \framebox[5em]{outdent} \\
1511 \shoveleft \framebox[5em]{left} \\
1512 \shoveleft* \framebox[5em]{indent} \\
1513 \shoveright \framebox[5em]{right}
1514 \>
1515 \end{scanexample}
1516 \showexampleh[0.55]
1517 \end{example}
1518
1519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1520 \paragraph{Fitting.}
1521
1522 Finally, note that the package will make attempts
1523 at fitting the equation components into the horizontal space
1524 by adjusting some dimensions
1525 with the priority of avoiding overlong lines.
1526 The adjustments will first concern the intercolumn and margin spacing.
1527 Secondly, \tex/ will attempt to shrink the glue between symbols
1528 for very wide single and stacked equations (but not aligned equations).
1529 Finally, equation tags may be shifted out of the way vertically
1530 in order to free up horizontal space.
1531 If all attempts fail, overlong lines will be indicated.
1532
1533 \DescribeKey{alignshrink}
1534 \DescribeKey{tagshrink}
1535 \DescribeKey{alignbadness}
1536 \DescribeKey{tagbadness}
1537 The threshold for shrinking of glue can be controlled by the two parameters
1538 |alignshrink| and |tagshrink| accepting values ranging
1539 between |0| (no shrink) and |4| (full allowable shrink).
1540 They are used towards determining
1541 whether to shift away from the intended alignment position
1542 or whether to raise or lower the equation tag, respectively.
1543 Small values prevent shrinking and higher values allow for more compression.
1544 The corresponding parameters |alignbadness| and |tagbadness|
1545 accept integer values setting the
1546 native threshold in \tex/'s native units of |\badness|.
1547
1548 \begin{example}
1549 \eqnlinesset{number=on}
1550 \begin{scanexample}
1551 \<=
1552 x+x \\
1553 x+x+x+x \\
1554 x+x+x+x+x+x \\
1555 x+x+x+x+x+x+x+x \\
1556 x+x+x+x+x+x+x+x+x+x \\
1557 x+x+x+x+x+x+x+x+x+x+x+x \\
1558 \>
1559 \end{scanexample}
1560 \showexampleh[0.6]
1561 \end{example}
1562
1563 \DescribeKey{mintagsep}
1564 If the available space on a line does not suffice to place
1565 both the equation and its tag
1566 (with a minimum separation of |mintagsep|; default is |0.5em|),
1567 a tag will automatically be shifted
1568 (lowered or raised depending on whether it is placed on the right or left)
1569 to an otherwise empty line.
1570 \DescribeControl{shifttag}
1571 \DescribeInterfaceMacro{\raisetag*}
1572 The |\eqncontrol| control |shifttag=|\textit{dimen}
1573 (alternatively |\raisetag*|) may be used to shift a tag up
1574 (or down with negative arguments).
1575 \DescribeControl{smashtag}
1576 \DescribeInterfaceMacro{\raisetag}
1577 The control |smashtag=|\textit{dimen} (alternatively |\raisetag|)
1578 may be used to fine-tune the vertical placement
1579 when the tag requires extra vertical space
1580 but some space above or below the tag is unoccupied.
1581 It smashes some of the tag's height (or depth with negative arguments)
1582 and thus reduces the vertical gap created by the tag.
1583 Note that this feature can be used successively
1584 with positive and negative arguments
1585 to reduce the space in both directions if available.
1586 \DescribeKey{pushtag}
1587 \DescribeInterfaceMacro{\raisetag!}
1588 Where needed, the control |pushtag| (or |\raisetag!|)
1589 force-pushes the tag to a separate line
1590 and frees up the horizontal space occupied by the tag.
1591 The numbering modes |top|, |bottom|,
1592 |center|, |median|, |center!| and |center*|
1593 are special in that they allow for a continuous vertical placement
1594 of the tag between two lines.
1595 \DescribeKey{tagbetween}
1596 The more flexible placement of tags may
1597 also be enabled for the single-lines modes
1598 by the option |tagbetween|.
1599 Here, both lines must have sufficiently much space available for the tag.
1600 If not, the tag is shifted up or down or it is places on separate line
1601 between the two.
1602 \DescribeKey{tagsnap}
1603 The option |tagsnap| defines a range
1604 within which the tag baseline snaps to a nearby math baseline.
1605
1606 \begin{example}
1607 \eqnlinesset{number=on}
1608 \begin{scanexample}
1609 \[ \phi = -\int \frac{\mathrm{d}x}{\sqrt{1+x^2}} \]
1610 \end{scanexample}
1611 \showexampleh[0.8]
1612 \begin{scanexample}
1613 \[ x = \frac{\partial}{\partial \phi}\sin\phi
1614 \raisetag{0.45\baselineskip} \]
1615 \end{scanexample}
1616 \showexampleh[0.85]
1617 \begin{scanexample}
1618 \<=[numberline=center] \raisetag*{2pt}
1619 x+x+x+x+x+x+x+x \\
1620 x+x+x+x+x+x+x+x \\
1621 x+x+x+x+x+x+x+x \\
1622 x+x+x+x+x+x+x+x
1623 \>
1624 \end{scanexample}
1625 \showexampleh[0.6]
1626 \end{example}
1627
1628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1629 \subsection{Punctuation}
1630 \label{sec:punctuation}
1631
1632 Extending proper punctuation across equations is a delicate matter,
1633 and maintaining it while redacting the text
1634 certainly takes more attention to detail
1635 than many authors are willing to afford.
1636 A contributing factor is that punctuation marks are harder
1637 to spot alongside equation context and somewhat out of place anyway.
1638
1639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1640 \paragraph{Scheme.}
1641
1642 \DescribeInterfaceMacro{\eqnpunct}
1643 \DescribeKey{punct}
1644 The package supplies a semi-automatic scheme by which
1645 equations are terminated by a specific punctuation mark.
1646 Punctuation marks are set by:
1647 \begin{center}
1648 |\eqnlinesset{punct={|\textit{punct}|}}|
1649 \qquad
1650 |\eqnpunct{|\textit{punct}|}|
1651 \qquad
1652 |\[[punct={|\textit{punct}|}]|\,\ldots|\]|
1653 \end{center}
1654 The first form sets and enables a default punctuation mark;
1655 the middle form sets the punctuation mark for the
1656 following equation environment;
1657 the final form applies to the given equation environment only.
1658 For example, one might globally declare `|punct={.}|'
1659 to terminate all equations by default with a period `|.|'.
1660 The default behaviour can be adjusted to a comma `|,|'
1661 for an individual equation by declaring `|\eqnpunct,|' before the equation
1662 (i.e.\ at the end of the textual phrase to which the punctuation mark belongs)
1663 or by using the optional argument |[punct={,}]|.
1664 Likewise, |\eqnpunct{}|, |[punct=~]| or |[punct={}]|
1665 eliminates a preset punctuation.
1666
1667 \begin{example}
1668 \eqnlinesset{skip=6pt}
1669 \begin{scanexample}
1670 \eqnlinesset{punct=.}
1671 The equation
1672 \[ x = \cos\phi \eqnpunct{} \]
1673 can also be written as
1674 \eqnpunct,
1675 \[ x = (z+z^{-1})/2 \]
1676 where we assume
1677 \[ z = \exp(i\phi) \]
1678 \end{scanexample}
1679 \showexampleh
1680 \end{example}
1681
1682 Arguably, the implementation of the scheme
1683 will take higher efforts than direct coding of punctuation.
1684 Hence, the scheme can be useful in situations
1685 where equations typically terminate phrases or
1686 where punctuation is otherwise expected in regular patterns.
1687 The use of the scheme will be most efficient
1688 in the symbolic shortcut form to be explained below.
1689
1690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1691 \paragraph{Levels and Adjustments.}
1692
1693 \DescribeKey{punctcol}
1694 \DescribeKey{punctline}
1695 \DescribeKey{punctall}
1696 \DescribeMod{`}
1697 For multi-line equations, there are two further levels of default punctuation
1698 for terminating columns and lines
1699 which are specified via the option |punctcol| and |punctline|.
1700 A punctuation item may also be handed on to the next lower level
1701 of punctuation via the starred forms |punct*| and |punctline*|.
1702 Several levels of punctuation can be specified simultaneously by |punctall|
1703 or via the modifier `|`|':
1704 \begin{center}
1705 |punctall={|[[\textit{col}]\textit{line}]\textit{main}|}|
1706 \qquad
1707 |\[`{|[[\textit{col}]\textit{line}]\textit{main}|}|\,\ldots|\]|
1708 \end{center}
1709 The special value `|~|' represents no punctuation
1710 and |\relax| hands down.
1711 An empty argument for |punctall| or `|`|' removes all levels of punctuation.
1712
1713 \begin{example}
1714 \begin{scanexample}
1715 \<`{,;.}
1716 x &= \cos\phi &
1717 \phi &= \arccos x \\
1718 x &= (z+z^{-1})/2 &
1719 \phi &= -i\log z \>
1720 \end{scanexample}
1721 \showexampleh[0.4]
1722 \end{example}
1723
1724 \DescribeInterfaceMacro{\eqnpunctapply}
1725 \DescribeControl{punct}
1726 In situations, where the punctuation must appear before the end
1727 of the block, e.g.\ before a ``QED'',
1728 it can be invoked manually by |\eqnpunctapply|
1729 or by the control |punct|[|={|\textit{punct}|}|].
1730 Further automatic punctuation is suppressed within the current display.
1731 \DescribeControl{punctcol}
1732 \DescribeControl{punctline}
1733 The line and column punctuation can also be accessed by
1734 the controls |punctline| and |punctcol|.
1735
1736 \DescribeKey{punctsep}
1737 \DescribeKey{punctclass}
1738 For convenience, one may also specify a desired space
1739 (or any other code sequence) preceding the punctuation
1740 by |[punctsep={|\textit{sep}|}]|,
1741 e.g.\ \textit{sep}=|\,| or \textit{sep}=|\|\texttt{\textvisiblespace}.
1742 It makes sense to also set the math class preceding punctuation
1743 by |[punctclass={|\textit{class}|}]|,
1744 e.g.\ \textit{class}=|\mathclose{}|,
1745 to avoid additional space in some situations.
1746
1747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1748 \paragraph{Symbolic Notation.}
1749
1750 The full power of the punctuation scheme comes alive in symbolic notation.
1751 Adjustments to punctuation can be done by adding
1752 modifiers to the opening and closing statements
1753 of equation blocks as well as for line and column breaks:
1754 \begin{center}
1755 \begin{tabular}{c}
1756 |\[|\textit{mod}\texttt{\textvisiblespace} \\
1757 |\<|\textit{mod}\texttt{\textvisiblespace}
1758 \end{tabular}
1759 \qquad
1760 \begin{tabular}{c}
1761 |\\|\textit{mod}\texttt{\textvisiblespace} \\
1762 |\&|\textit{mod}\texttt{\textvisiblespace}
1763 \end{tabular}
1764 \qquad
1765 \begin{tabular}{c}
1766 |\]|\textit{mod}\texttt{\textvisiblespace} \\
1767 |\>|\textit{mod}\texttt{\textvisiblespace}
1768 \end{tabular}
1769 \end{center}
1770 The opening statement is somewhat out of place
1771 for punctuation adjustments which take effect only later;
1772 it is most useful for general adjustments to punctuation
1773 for the equation block.
1774 Conversely, the closing statement, line and column breaks
1775 display the adjusted punctuation right where it is declared.
1776
1777 \DescribeMod{.}
1778 \DescribeMod{,}
1779 \DescribeMod{\string~}
1780 \DescribeMod{`}
1781 The modifiers dot `|.|', comma `|,|' and tilde `|~|'
1782 are short forms for using a dot, a comma or disabling punctuation.
1783 A custom punctuation can be set by the modifier `|`{|\textit{punct}|}|'.
1784 \begin{center}
1785 \begin{tabular}{rccccc}
1786 \textit{mod}: & |~| & |.| & |,| & |`{|\textit{punct}|}| & |!|
1787 \\\hline
1788 punctuation: & none & dot & comma & \textit{punct} & |\eqnpunctapply|
1789 \end{tabular}
1790 \end{center}
1791 \DescribeMod{!}
1792 The line and column break `|\\|', `|\&|'
1793 allow for the additional modifier `|!|'
1794 which applies the main punctuation level of the block
1795 (or an explicit local adjustment) by issuing |\eqnpunctapply|.
1796 \DescribeMod{/}
1797 Note that the continued equation marker `|\\/|' also
1798 suppresses the punctuation at the line break.
1799
1800 \begin{example}
1801 \eqnlinesset{number=on}
1802 \begin{scanexample}
1803 \<`{,.}
1804 x &= \cos\phi \\/
1805 &= (z+z^{-1})/2 \\
1806 \phi &= \arccos x \\/
1807 &= -i\log z \\`;
1808 z &= \exp(i \phi) \\~
1809 &= x+i\sqrt{1-x^2} \>`{?!}
1810 \end{scanexample}
1811 \showexampleh
1812 \end{example}
1813
1814 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1815 \subsection{Equation Alignment}
1816 \label{sec:alignment}
1817
1818 The columns mode of a multi-line equation block
1819 produces (several columns of) equations to be aligned
1820 at some position within each line.
1821 This is used to collect several equations into an array,
1822 but it also facilitates the breaking of a long equation
1823 or a chain of equations into the available horizontal space, e.g.
1824 \<* \&: a \\= b+c \\= d-e \\; +f \>
1825 Here, the first two lines represent a chain of equations
1826 and the third line continues the right-hand side begun in the second line.
1827 The alignment puts all equality relations within a vertical tower
1828 and the right-hand sides strictly to the right of the equality sign.
1829
1830 Technically, each equation component within a line
1831 is to be aligned at one specific position.
1832 In the above example, the alignment is chosen to be at the equality relation,
1833 Such an alignment splits the equation component
1834 into two separate maths blocks which interferes with
1835 \latex/'s math kerning mechanism:
1836 \latex/ will determine the kerning between all math symbols,
1837 but only within their math block.
1838 Unfortunately, \latex/ cannot determine the appropriate kerning
1839 between the two blocks;
1840 this has to be determined by some other means or assumption.
1841 Consistency of the kerning requires consistency of the assumptions.
1842 A natural assumption is to put the alignment at an equality relation;
1843 here, the kerning will depend on whether the alignment is just before
1844 or just after the equality sign
1845 (and whether it is to the left or to the right of the kerning
1846 between the equality sign and the surrounding symbols).
1847
1848 The principal assumption for the \amsmath/ environment |align|
1849 is that the left part of the column ends with an ordinary character.
1850 This leads to the correct spacing when an equation $a=b+c$
1851 is broken before the equals relation as |a&=b+c|,
1852 and also if an equation sequence continues on the next line as |\\&=d-e|.
1853 It naturally places the alignment left of the equality relation
1854 (and left of the leading kerning).
1855 However, it is difficult to achieve the right spacing
1856 if the right-hand side is to be broken into several lines:
1857 For instance, |\\&+f|
1858 aligns the subordinate binary operation with the equals sign
1859 (which may be undesirable).
1860 Instead placing a phantom equals sign is an effort
1861 that somewhat disrupts source readability.
1862
1863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1864 \paragraph{Math Classes at Alignments.}
1865
1866 \DescribeKey{class}
1867 \DescribeKey{ampeq}
1868 \DescribeKey{eqamp}
1869 \DescribeMod{<}
1870 \DescribeMod{>}
1871 The package implements a more flexible assignment of math classes
1872 at the alignment. The above default behaviour is invoked by
1873 the optional argument |class=ampeq| (|ampeq| for short or `|<|' as modifier).
1874 The optional argument |class=eqamp| (|eqamp| for short or `|>|' as modifier)
1875 imposes math classes at the alignment
1876 such that an equation sign should be placed just before the alignment.
1877 Concretely, it inserts a |\mathrel{}| class just after
1878 the alignment marker. Furthermore, in case of an empty left alignment cell,
1879 the leading math class is changed to |\mathord{}|
1880 so that a following binary operator is not interpreted as a unary one.
1881 For example, the following two expressions produce identical output:
1882
1883 \begin{example}
1884 \begin{scanexample}
1885 \<< &\mathrel{\phantom{=}} a \\
1886 &= b+c \\
1887 &= d-e \\
1888 &\mathrel{\phantom{=}}\mathclose{} +f \>
1889 \end{scanexample}
1890 \showexampleh[0.7]
1891 \begin{scanexample}
1892 \<> \,& a \\
1893 =& b+c \\
1894 =& d-e \\
1895 & +f \>
1896 \end{scanexample}
1897 \showexampleh[0.7]
1898 \end{example}
1899
1900 \DescribeKey{classout}
1901 \DescribeKey{classin}
1902 \DescribeKey{classlead}
1903 Math classes just before and after alignment can be adjusted freely
1904 by the optional arguments:
1905 \begin{center}
1906 |classout={|\textit{class}|}|,
1907 \qquad
1908 |classin={|\textit{class}|}|,
1909 \qquad
1910 |classlead={|\textit{class}|}|.
1911 \end{center}
1912 The parameter |classlead|
1913 determines the math class just after the alignment
1914 if the cell before alignment is empty (has zero width).
1915 The spacing at the alignment is determined by the pairing
1916 of the last/first character and the selected math class at the alignment:
1917 \<[classin={},classout={},classlead={},*]
1918 \framebox[1em]{\bstrut}\ \framebox[1em]{\bstrut}\
1919 \framebox[1em]{\bstrut a}\ \underline{\makebox[3em]{\itshape a-out}}
1920 \ \vrule&
1921 \ \underline{\makebox[3em]{\itshape in-b}}\ \framebox[1em]{\bstrut b}
1922 \ \framebox[1em]{\bstrut}\ \framebox[1em]{\bstrut}
1923 \\
1924 \vrule&
1925 \ \underline{\makebox[3em]{\itshape lead-c}}\ \framebox[1em]{\bstrut c}
1926 \ \framebox[1em]{\bstrut}\ \framebox[1em]{\bstrut}
1927 \>
1928
1929 \DescribeControl{rel}
1930 \DescribeControl{rel;}
1931 \DescribeControl{rel*}
1932 The package provides a control to encode an aligned relation
1933 that issues the alignment tab `|&|' in the appropriate location
1934 for both the |ampeq| and |eqamp| modes:
1935 \begin{center}
1936 |\eqncontrol{rel|[|={|\textit{rel}|}|]\textbar|;|\textbar|*}|
1937 \end{center}
1938 The form |rel| will use the default equality relation (preset to `|=|')
1939 whereas |rel={|\textit{rel}|}| uses the relation \textit{rel} instead.
1940 The special form |rel;| indicates the continuation of an equation term
1941 by replacing the equality relation with space.
1942 Conversely |rel*| indicates the start of an equation
1943 when a left-hand side fits better on the right-hand side of the alignment;
1944 this is very similar to |rel;| but uses a slightly different spacing.
1945
1946 \DescribeKey{rel}
1947 \DescribeKey{classstart}
1948 \DescribeKey{classbreak}
1949 The default relation symbol can be adjusted
1950 by the option |rel={|\textit{rel}|}|.
1951 The space for the start of an equation is defined by the option
1952 |classstart={|\textit{code}|}|, where \textit{code} is some \latex/ code
1953 that accepts the default relation symbol as argument `|#1|'
1954 (for use in |\phantom|).
1955 Similarly, |classbreak={|\textit{code}|}| defines the space
1956 for a continued equation term.
1957 Note that the latter two settings apply only to |ampeq| mode;
1958 whereas the space is canonically generated in |eqamp| mode.
1959
1960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1961 \paragraph{Symbolic Notation.}
1962
1963 The placement or omission of aligned equality relations
1964 is most conveniently achieved in the symbolic notation
1965 using modifiers to the line break `|\\|' and the column break `|\&|'.
1966 \DescribeMod{=}
1967 \DescribeMod{?}
1968 \DescribeMod{;}
1969 \DescribeMod{:}
1970 \DescribeMod{\verbbar}
1971 The modifiers `|=|', `|?|', `|;|', `|:|' and `\verbbar' indicate
1972 typical situations encountered for a set of aligned equations as follows:
1973 \begin{center}
1974 \begin{tabular}{cl}
1975 \textit{mod}: & meaning
1976 \\\hline
1977 none & start new equation in left cell \\
1978 |=| & continue equation with default relation (`|=|') \\
1979 |?{|\textit{rel}|}| & relation with symbol \textit{rel} \\
1980 |;| & continue equation term in right cell \\
1981 |:| & start new equation in right cell \\
1982 \verbbar & alignment within term (following a |\mathord|) \\
1983 \end{tabular}
1984 \end{center}
1985 If no relation modifier is specified, `|\\|' will break the line
1986 and start in the leftmost cell whereas `|\&|'
1987 will terminate the current column and continue
1988 in the left cell of the next column.
1989 When a relation modifier is present, `|\\|' will break the line
1990 and fill the leftmost cell
1991 (and potentially the start of the following right cell)
1992 with the desired relation;
1993 it will always leave at the beginning of the right cell.
1994 Similarly, `|\&|' will fill the next left cell with the aligned relation
1995 and leave at the beginning of the following right cell.
1996 \DescribeKey{crrelnext}
1997 Note that `|\\|' with a relation modifier
1998 `|=|', `|?|', `|;|' or `\verbbar' (but not `|:|')
1999 describe the interior of an equation;
2000 consequently, it will always suppress punctuation
2001 and it will also issue a |\numbernext|
2002 (if the option |crrelnext| is active).
2003
2004 The following two examples show
2005 a symbolic notation for the above continued equation
2006 and two columns of continued equations:
2007 \begin{example}
2008 \eqnlinesset{number=on}
2009 \begin{scanexample}
2010 \< \&: a \\= b+c \\?\simeq d-e \\; +f \>
2011 \end{scanexample}
2012 \showexampleh[0.6]
2013 \begin{scanexample}
2014 \<`{,;.}
2015 a \&= b+c \&~ \& A \&= B+C \\/
2016 \&= d-e \& \&/ \& \&= D-E \\/
2017 \& \& \&; +F \>
2018 \end{scanexample}
2019 \showexampleh[0.6]
2020 \end{example}
2021
2022 In the first example,
2023 `|\&:|' starts the equation on the right of the alignment,
2024 `|\\=|' continues the equation on the next line with an equality
2025 and `|\\;|' continues the equation term on the next line without equality;
2026 furthermore, the main equality symbol is set to $\equiv$.
2027
2028 In the second example, aligned equality relations are denoted by `|\&=|'
2029 and continued terms by `|\&;|'.
2030 The three columns are separated by `|\&|' and `|\&~|'
2031 with and without punctuation, respectively;
2032 however, a `|\&|' also suppresses punctuation if there is no content
2033 to the right of the alignment.
2034 Numbering is delayed and line punctuation by `;' is suppressed
2035 by `|\\/|' to account for the continued equations.
2036 Finally the middle column just contains a `|\&/|' to produce the
2037 ampersand character.
2038
2039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2040 \subsection{Vertical Spacing}
2041 \label{sec:vspace}
2042
2043 Display equations in \tex/ are considered to be part
2044 of the surrounding paragraph of text.
2045 Hence, the vertical spacing depends on the surrounding text,
2046 in particular on the width and depth of the line of text
2047 directly preceding the equation.
2048 Due to this influence it can be difficult to manually adjust
2049 the spacing accurately.
2050 The package adds several options to control the vertical spacing,
2051 and it also implements a uniform behaviour for all types of equations.
2052
2053 The spacing is determined by combination of several aspects:
2054
2055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2056 \paragraph{Baselines.}
2057
2058 First, \tex/ inserts some glue between lines of text
2059 to make them appear as regular as possible.
2060 The amount of inserted glue is determined by \tex/'s rules
2061 which depend on height, depth and intended baseline separation.
2062 This interline spacing also applies to the lines of displayed equations
2063 as well as the interfaces between text and displayed equations.
2064
2065 \DescribeKey{spread}
2066 The spacing between the lines of a multi-line equation environment
2067 can be adjusted via |spread={|\textit{dimen}|}|
2068 which defaults to |\jot|$\equiv$|3pt| above the normal baseline skip.
2069 \DescribeKey{strut}
2070 \DescribeKey{strutdepth}
2071 In addition, all equation lines and tags
2072 are supplied with struts to ensure a minimum height and depth.
2073 The latter behaviour is controlled by the switch |strut|
2074 which takes the values `|on|' (default), `|cells|', `|tags|' or `|off|'.
2075 The relative depth of such a strut is determined by |strutdepth|
2076 (default |0.3|).
2077
2078 While the height/depth of text typically takes rather uniform values,
2079 the height/depth of math content can range wildly with the context
2080 (plain equations vs.\ fractions and matrices).
2081 As displayed equations are normally surrounded by
2082 a relatively large amount of glue,
2083 it makes sense to reduce the dependency on the height/depth of math content.
2084 Therefore, the package makes equation environments
2085 appear to the surrounding text
2086 as a line with a fixed height and depth,
2087 and thus interline glue merely fills some potential gaps of the
2088 surrounding text.
2089 \DescribeKey{displayheight}
2090 \DescribeKey{displaydepth}
2091 The apparent height and depth are defined by
2092 |displayheight| and |displaydepth|
2093 which default to the dimensions of a strut.
2094
2095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2096 \paragraph{Vertical Situation.}
2097
2098 Second, the spacing of display equations depends on the width
2099 of the previous line of text.
2100 If the math content fits well into the available horizontal space,
2101 the display equation is called short
2102 and less glue is needed above the equation.
2103 The package implements this basic \tex/ feature
2104 for all single- and multi-line equation environments.
2105
2106 \begin{example}
2107 \begin{scanexample}
2108 example of a long text line:
2109 \[ \mbox{long mode} \]
2110 vs.\ short:
2111 \[ \mbox{short mode} \]
2112 following line
2113 \end{scanexample}
2114 \showexampleh
2115 \end{example}
2116
2117 \tex/ also reduces the amount of glue below short equations
2118 (potentially to make their spacing appear more uniform).
2119 \DescribeKey{shortmode}
2120 The package allows to adjust the spacing for short equations
2121 via the global option |shortmode=|\textit{mode}
2122 where \textit{mode} takes the values:
2123 \begin{center}
2124 \begin{tabular}{lll}
2125 \textit{mode} & reduced glue \\
2126 \hline
2127 |off| & disabled \\
2128 |above| & above short equations (package default) \\
2129 |belowone| & also below short single-line equations \\
2130 |belowall| & also below all short multi-line equations \\
2131 \end{tabular}
2132 \end{center}
2133 \DescribeKey{short}
2134 \DescribeKey{long}
2135 Short and long amounts of glue can also be enforced for
2136 individual equation environments
2137 via the optional arguments |short| and |long|
2138 taking the values |above|, |below| or |both|.
2139
2140 \begin{example}
2141 \begin{scanexample}
2142 example of a long text line:
2143 \[[short] \mbox{forced short} \]
2144 and short:
2145 \[[long] \mbox{forced long} \]
2146 following line
2147 \end{scanexample}
2148 \showexampleh
2149 \end{example}
2150
2151 There are three special situations |cont|, |par| and |top|
2152 which trigger different spacings:
2153 |cont| describes the situation
2154 at the start of an empty horizontal list
2155 (invoked by |\noindent|)
2156 or when an equation block directly follows another one;
2157 here, the space above the equation should be minimal
2158 (or even negative to remove the space below the previous equation block).
2159 |par| describes the situation at the beginning of a paragraph
2160 (invoked by |\par|);
2161 here, the space above the equation adds to the space between paragraphs.
2162 |top| describes the situation at the top of a vertical list
2163 (invoked by |\nointerlineskip|);
2164 here, one would typically want no space.
2165
2166 \begin{example}
2167 \eqnlinesset{belowtopmode=long}
2168 \begin{scanexample}
2169 \hrule\begin{minipage}{\linewidth}
2170 \[ \mbox{top} \]
2171 some text\par
2172 \[ \mbox{par} \]
2173 \[ \mbox{cont} \]
2174 \end{minipage}\hrule
2175 \end{scanexample}
2176 \showexampleh
2177 \end{example}
2178
2179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2180 \paragraph{Explicit Spacing.}
2181
2182 Third, the package provides several means to adjust the
2183 glue around equations:
2184
2185 \DescribeKey{noskip}
2186 \DescribeKey{medskip}
2187 Next to |short| and |long| the spacing above and below
2188 equation environments can be reduced
2189 to some other fixed smaller amount via |medskip|
2190 or removed altogether via |noskip|.
2191 These keys also take the values |above|, |below| or |both|.
2192
2193 \begin{example}
2194 \begin{scanexample}
2195 \hrule
2196 \[[long] \mbox{long default} \]
2197 \hrule
2198 \[[medskip] \mbox{medium space} \]
2199 \hrule
2200 \[[noskip] \mbox{no space} \]
2201 \hrule
2202 \end{scanexample}
2203 \showexampleh
2204 \end{example}
2205
2206 \DescribeKey{par}
2207 By default, equation environments end in horizontal mode without indentation.
2208 The key |par| controls whether
2209 the equation environments end in horizontal mode as usual (value |cont|)
2210 or in vertical mode (value |par|, default)
2211 with a dedicated amount of glue |belowparskip|.
2212 An environment can also be made to end in vertical mode
2213 without interline skip (value |top|)
2214 using the glue |belowtopskip|.
2215 The key |par| can be used for situations when vertical mode is preferred,
2216 e.g.\ for lists following equations
2217 where the vertical space above the list is excessive.
2218 In the following example,
2219 |\hrule| will leave an empty line when not in vertical mode.
2220
2221 \begin{example}
2222 \begin{scanexample}
2223 \hrule some text
2224 \[ \mbox{cont} \]
2225 \hrule some text
2226 \[[par] \mbox{par} \]
2227 \hrule
2228 \end{scanexample}
2229 \showexampleh
2230 \end{example}
2231
2232 \DescribeKey{...skip}
2233 \DescribeInterfaceMacro{\vspace}
2234 \DescribeKey{...space}
2235 Variable amounts of skip can be set via
2236 |aboveskip| and |belowskip| or |skip| for both simultaneously.
2237 In addition, the package extends the \latex/ |\vspace| mechanism
2238 to equation bodies where it adds vertical space
2239 below the next equation line or below the equation environment.
2240 Additional glue can be added above or below equation environments
2241 by means of the options |abovespace| and |belowspace|.
2242
2243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2244 \paragraph{Glue Dimensions.}
2245
2246 The package also maintains several global vertical space settings
2247 |above|\textit{pos}|skip| and |below|\textit{pos}|skip|
2248 (sometimes \textit{pos}|skip| for both):
2249 \DescribeKey{...skip}
2250 \begin{center}
2251 \begin{tabular}{lll}
2252 \ldots\textit{pos}|skip| & both & description \\
2253 \hline
2254 |...long...| & |longskip| & regular amount of glue \\
2255 |...short...| & -- & reduced glue for short equations \\
2256 |...cont...| & -- & glue when issued from an empty |\noindent| paragraph \\
2257 |...par...| & -- & glue when starting a paragraph (in vertical mode)\\
2258 |...top...| & -- & glue when issued at the top of vertical list \\
2259 |...med...| & |medskip| & medium amount of glue \\\hline
2260 |...tag...| & |tagskip| & minimum glue for outer raised/lowered tags \\
2261 \end{tabular}
2262 \end{center}
2263 \DescribeKey{...mode}
2264 The situations \textit{pos}=|cont|, |par| and |top|
2265 use the respective amount of glue |above|\textit{pos}|skip|
2266 above the equations and the regular amount of glue |belowlongskip| below.
2267 These behaviours may be adjusted by the global options
2268 |above|\textit{pos}|mode| and |below|\textit{pos}|mode|
2269 with the values:
2270 \begin{center}
2271 \begin{tabular}{lll}
2272 value & reduced glue \\
2273 \hline
2274 |long| & regular amount of glue \\
2275 |short| & reduced glue for short equations \\
2276 |cont| & amount for empty paragraph \\
2277 |par| & amount for paragraph (and end the paragraph) \\
2278 |top| & amount for top (and end the paragraph without interline skip) \\
2279 |noskip| & no glue \\
2280 |medskip| & medium amount of glue \\
2281 \end{tabular}
2282 \end{center}
2283
2284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2285 \paragraph{Page Breaks.}
2286
2287 \DescribeKey{prebreak}
2288 \DescribeKey{postbreak}
2289 \DescribeKey{allowbreaks}
2290 \DescribeKey{prepenalty}
2291 \DescribeKey{postpenalty}
2292 \DescribeKey{interpenalty}
2293 \DescribeInterfaceMacro{\displaybreak}
2294 Finally, the breaking of multi-line equations across pages
2295 can be controlled as follows:
2296 The setting |allowbreaks| (or |allowdisplaybreaks|)
2297 taking values |0| (never) through |4| (permissive)
2298 controls the permittivity of page breaks within multi-line equations.
2299 The optional arguments |prebreak| and |postbreak|
2300 taking values |0| (do not) through |4| (enforce)
2301 suggest a break just above or below the equation environment.
2302 The command |\displaybreak[|\textit{val}|]|
2303 with values |0| through |4| (default)
2304 suggests a break below the current line or below the equation environment.
2305
2306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2307 \subsection{Further Environments and Features}
2308 \label{sec:further}
2309
2310 The package supplies some additional environments and features:
2311
2312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2313 \paragraph{Equation Boxes.}
2314
2315 \DescribeEnv{equationsbox}
2316 The package provides a boxed equation environment |equationsbox|
2317 which can be used within arbitrary math content.
2318 It works analogously to |equations| including optional arguments
2319 and modifiers, but it offers a reduced range of functionality
2320 such as (evidently) no numbering
2321 (yet, the |lines| mode accepts multiple columns here).
2322
2323 \DescribeKey{top,t}
2324 \DescribeKey{center,c}
2325 \DescribeKey{bottom,b}
2326 The equations box accepts several arguments:
2327 |top|, |center|, |bottom| (or |t|, |c|, |b|)
2328 specify the vertical alignment of the box.
2329 \DescribeKey{margin}
2330 \DescribeKey{marginleft}
2331 \DescribeKey{marginright}
2332 |margin|, |marginleft|, |marginright|
2333 specify additional margin space around the equations box.
2334 \DescribeKey{colsep}
2335 |colsep| specifies the amount of separation between the columns.
2336 \DescribeKey{frame}
2337 \DescribeKey{wrap}
2338 |frame|[|=|\textit{cmd}] encloses the equations box
2339 by a \textit{cmd} such as |\fbox| which accepts one argument
2340 (or a command sequence which ends with a macro accepting one argument).
2341 |wrap={{|\textit{cmdl}|}{|\textit{cmdr}|}}|
2342 surrounds the equations box by the two commands
2343 \textit{cmdl} and \textit{cmdr}.
2344
2345 \begin{example}
2346 \begin{scanexample}
2347 \[ \begin{equationsbox}[margin=1em,
2348 wrap={\left\{}{\right\}}]
2349 x &= \cos\phi \\
2350 \phi &= \arccos x
2351 \end{equationsbox} \]
2352 \end{scanexample}
2353 \showexampleh
2354 \end{example}
2355
2356 \DescribeInterfaceMacro{\<...\string\>}
2357 The equations box can also be invoked
2358 by the symbolic short form |\<|\,\ldots|\>|
2359 when called within math mode.
2360 The symbolic form accepts modifiers
2361 to adjust punctuation and equality relations.
2362 \DescribeMod{!}
2363 Note that |equationsbox| uses the current line and column punctuation settings,
2364 but it does not inherit the top punctuation from the containing block.
2365 To this end, the modifier `|!|' invokes |\eqnpunctapply|
2366 to terminate punctuation with the top punctuation for the block.
2367
2368 \begin{example}
2369 \eqnlinesset{number=on}
2370 \begin{scanexample}
2371 \[`{,;.} \Longrightarrow
2372 \<=[shape=l,frame]
2373 x = \cos\phi &
2374 \phi = \arccos x \\
2375 x = (z+z^{-1})/2 &
2376 \phi = -i\log z
2377 \>! \Longleftarrow \]
2378 \end{scanexample}
2379 \showexampleh[0.45]
2380 \end{example}
2381
2382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2383 \paragraph{Cases and Matrix Environments.}
2384
2385 \DescribeEnv{cases}
2386 \DescribeKey{cases}
2387 \DescribeKey{condsep}
2388 The |cases| environment is reimplemented
2389 using the special mode |cases| of |equationsbox|
2390 with two left-aligned cells
2391 whose separation may be adjusted by the option |condsep|.
2392 \DescribeKey{braces}
2393 The equations box is wrapped by a left brace by default;
2394 this behaviour may be adjusted by the option |braces|
2395 taking the values |off|, |l|, |r|, |lr|.
2396 \DescribeKey{intro}
2397 \DescribeKey{introtext}
2398 Furthermore, a common intro \textit{text} for all conditions
2399 may be added by the option |intro={|\textit{text}|}|;
2400 |introtext| sets \textit{text} in text mode with a trailing space.
2401 \DescribeKey{textcond}
2402 Finally, the option |textcond| determines that right cells are given in mode.
2403 \DescribeKey{punctcases}
2404 All features of |equationsbox|, such as punctuation,
2405 are equally available for |cases|.
2406 The global setting |punctcases| and the local setting |punctcol|
2407 set the punctuation for the left column
2408 whereas the right column uses |punctline|.
2409
2410 \begin{example}
2411 \begin{scanexample}
2412 \[ x =
2413 \begin{cases}[introtext={if},braces=lr]
2414 1 & \phi = 0 \\
2415 0 & \phi = \pi/2
2416 \end{cases} \]
2417 \end{scanexample}
2418 \showexampleh[0.7]
2419 \begin{scanexample}
2420 \[`{,.} x = \<[cases,textcond]
2421 \cos\phi & one way \\
2422 (z+z^{-1})/2 & or the other \>! \]
2423 \end{scanexample}
2424 \showexampleh[0.6]
2425 \end{example}
2426
2427 \DescribeEnv{?matrix}
2428 The set of |matrix| environments is reimplemented
2429 using particular combinations of options for |equationsbox|:
2430 The matrix is arranged in |lines| mode
2431 with centred cells |shape=center|.
2432 \DescribeKey{spread*}
2433 The line spread is reset by |spread*|.
2434 Punctuation is turned off by |punctall={}|.
2435 \DescribeKey{style}
2436 The cells are rendered in |\textstyle|
2437 using the option |style=text|.
2438 \DescribeKey{colsep*}
2439 A small column separation |colsep*|
2440 is selected by |colsep=short|.
2441 \DescribeKey{delim}
2442 Finally, the equations box is wrapped by a pair of delimiters
2443 \textit{l} and \textit{r}
2444 using the option |delim={|\textit{l}\textit{r}|}|.
2445 Again, all features of |equationsbox|
2446 are equally available for the |matrix| environments.
2447 \DescribeKey{matrix}
2448 Altogether, the combination is achieved by the shortcut option
2449 |matrix={|\textit{l}\textit{r}|}|,
2450 where \textit{l}\textit{r} may take the following abbreviations:
2451 \begin{center}
2452 \begin{tabular}{cccccccc}
2453 \textit{lr} & `|.|' & |r| & |s| & |a| & |c| & |v| & |d|
2454 \\\hline
2455 brackets & none & round & square & angle & curly & bars & double bars
2456 \\
2457 result & $\ldots$ & $(\ldots)$ & $[\ldots]$ & $\langle\ldots\rangle$
2458 & $\lbrace\ldots\rbrace$ & $\vert\ldots\vert$ & $\Vert\ldots\Vert$
2459 \end{tabular}
2460 \end{center}
2461
2462 \begin{example}
2463 \begin{scanexample}
2464 \[ \begin{pmatrix}
2465 \cos\phi & -\sin\phi \\
2466 \sin\phi & \cos\phi
2467 \end{pmatrix} \]
2468 \end{scanexample}
2469 \showexampleh
2470 \begin{scanexample}
2471 \[ \<[matrix=v,shape=r]
2472 \cos\phi & -\sin\phi & 0 \\
2473 \sin\phi & \cos\phi & 0 \\
2474 0 & 0 & -1
2475 \> \]
2476 \end{scanexample}
2477 \showexampleh
2478 \end{example}
2479
2480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2481 \paragraph{Collective Numbering.}
2482
2483 \DescribeEnv{subequations}
2484 \DescribeKey{subeqtemplate}
2485 The environment |subequations| groups equations contained in the body
2486 with a common primary equation number and an extra level
2487 of numbering (typically: a,\,b,\,c,\,\ldots).
2488 The numbering layout can be controlled via |subeqtemplate|.
2489 For instance, the default behaviour of adding lowercase latin letters
2490 to the parent equation number (|#1|)
2491 is achieved by:
2492 \begin{center}
2493 |subeqtemplate={#1\alph{#2}}|
2494 \end{center}
2495
2496 \begin{example}
2497 \eqnlinesset{number=on}
2498 \begin{scanexample}
2499 \eqnlinesset
2500 {subeqtemplate={#1-\roman{#2}}}
2501 \begin{subequations}
2502 \[ x = \cos\phi \]
2503 and
2504 \[ \phi = \arccos x \]
2505 \end{subequations}
2506 \end{scanexample}
2507 \showexampleh[0.55]
2508 \end{example}
2509
2510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2511 \paragraph{Text Intermissions.}
2512
2513 \DescribeEnv{intertext}
2514 \DescribeInterfaceMacro{\intertext}
2515 The environment |intertext| (equivalently the macro |\intertext|)
2516 injects a (short) line of text
2517 into a multi-line equation while preserving the equation alignment
2518 across the text.
2519 The |intertext| environment must replace the
2520 end-of-line marker `|\\|' between two lines of the equation
2521 (to avoid blank lines).
2522 The environment accepts several of the vertical spacing adjustments
2523 as an optional argument.
2524
2525 \begin{example}
2526 \begin{scanexample}
2527 \< x &= \cos\phi
2528 \intertext[medskip]{and}
2529 \phi &= \arccos x \>
2530 \end{scanexample}
2531 \showexampleh
2532 \end{example}
2533
2534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2535 \paragraph{Injection.}
2536
2537 \DescribeControl{inject}
2538 \DescribeControl{inject*}
2539 At a lower level, the control |\eqncontrol{inject={|\textit{cmd}|}}|
2540 injects some command sequence \textit{cmd} after the present equation line
2541 but before interline spacing.
2542 The control |\eqncontrol{inject*={|\textit{cmd}|}}|
2543 injects after interline spacing instead.
2544
2545 \begin{example}
2546 \begin{scanexample}
2547 \< x &= \cos\phi
2548 \eqncontrol{inject=\hrule} \\
2549 \phi &= \arccos x \>
2550 \end{scanexample}
2551 \showexampleh
2552 \end{example}
2553
2554 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2555 \paragraph{Line Marks.}
2556
2557 \DescribeControl{markline}
2558 \DescribeControl{qed}
2559 The package provides a mechanism to mark an equation line
2560 at the end of the present line or just below.
2561 This mechanism can be used to display a QED mark:
2562 \begin{center}
2563 \begin{tabular}{l}
2564 |\eqncontrol{markline={symbol=|\textit{sym}|,|\textit{opts}|}|
2565 \\
2566 |\eqncontrol{qed|[|={|\textit{opts}|}|]|}|
2567 \end{tabular}
2568 \end{center}
2569 The QED symbol may as well be invoked
2570 by |\qedhere[|\textit{opts}|]| of \ctanpkg{amsthm}.
2571 The starred variants |markline*|, |qed*| and |\qedhere*|
2572 should be used for long lines
2573 where the mark would otherwise smash equation content
2574 (equation numbers are avoided automatically).
2575
2576 \begin{example}
2577 \eqnlinesset{number=on}
2578 \begin{scanexample}
2579 \<[n=l] x &= \cos\phi
2580 \eqncontrol{markline={symbol=$\sqrt{}$}} \\
2581 \phi &= \arccos x
2582 \eqncontrol{qed={shift=.5ex}} \>
2583 \end{scanexample}
2584 \showexampleh[0.6]
2585 \end{example}
2586
2587 The options \textit{opts} can be used
2588 to adjust the placement
2589 by |below| (placed on a separate line below the present line),
2590 |baseline| (smashed at the current baseline),
2591 |bottom| (smashed at the bottom of the present line),
2592 to fine-tune the vertical position by |shift=|\textit{dimen}
2593 or to adjust the symbol by |symbol=|\textit{sym}.
2594 The default position and symbol can be adjusted by
2595 the global settings |markpos|, |marksymbol| and |qedsymbol|.
2596
2597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2598 \paragraph{Frames.}
2599
2600 \DescribeInterfaceMacro{\framecell}
2601 \DescribeControl{framecell}
2602 The package allows to frame cells of an equation block
2603 via issuing a simple command within the cell:
2604 \begin{center}
2605 |\framecell[|\textit{cmd}|]|
2606 \qquad or\qquad
2607 |\eqncontrol{framecell|[|={|\textit{cmd}|}|]|}|
2608 \end{center}
2609 This command corresponds to |\Aboxed| of \ctanpkg{mathtools}.
2610 In particular, when used within columns or aligned mode,
2611 the frame will extend over both right and left alignment components
2612 of a cell; in order to allocate the right amount of space,
2613 it should be issued within the first cell of the pair.
2614 The layout of the frame can be adjusted
2615 by the optional argument \textit{cmd} which defaults to |\fbox|:
2616 it must be a macro which accepts one argument
2617 (or a command sequence which ends with a macro accepting one argument).
2618 Note:
2619 Any semi-automatic punctuation is included within the frame,
2620 see \secref{sec:punctuation}.
2621 Parts of a cell can be framed by the \amsmath/ macro |\boxed|,
2622 which will not include semi-automatic punctuation.
2623 Furthermore, the height and depth of the box are bounded from below
2624 by a strut, see \secref{sec:vspace}.
2625
2626 \DescribeControl{frametag}
2627 Similarly, the package allows to frame tags:
2628 \begin{center}
2629 |\eqncontrol{frametag|[|={|\textit{cmd}|}|]|}|
2630 \end{center}
2631
2632 \begin{example}
2633 \eqnlinesset{number=on}
2634 \begin{scanexample}
2635 \<* x &= \cos\phi \\
2636 \framecell \phi &= \arccos x \>
2637 \end{scanexample}
2638 \showexampleh[0.55]
2639 \begin{scanexample}
2640 \[* \framecell[\fboxrule2pt\fbox]
2641 \mbox{important} \eqnpunct! \]
2642 \end{scanexample}
2643 \showexampleh[0.55]
2644 \begin{scanexample}
2645 \[ \framecell[\fcolorbox{white}{yellow}]
2646 \eqncontrol{frametag=\fboxsep2pt\fbox}
2647 \mbox{highlight}\]
2648 \end{scanexample}
2649 \showexampleh[0.55]
2650 \end{example}
2651
2652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2653 \paragraph{Single-Line Composition.}
2654
2655 \DescribeInterfaceMacro{\eqnbreak}
2656 \DescribeInterfaceMacro{\eqnsep}
2657 \DescribeInterfaceMacro{\eqnjoin}
2658 Several short pieces of math content
2659 may well fit within a single equation line,
2660 typically separated by some amount of space like |\qquad| or |\qquad|.
2661 The package provides several context-aware commands for this purpose:
2662 the commands |\eqnsep| and |\eqnbreak| insert some horizontal glue,
2663 whereas |\eqnjoin| joins two parts of an equation with some conjunction.
2664 The glue typically includes some amount of shrink
2665 in order to accommodate the content when space is sparse.
2666 Furthermore, |\eqnsep| and |\eqnbreak| also automatically insert
2667 the punctuation for columns and lines, respectively.
2668 \DescribeInterfaceMacro{\\}
2669 \DescribeInterfaceMacro{\&}
2670 For convenience, the line and column break commands `|\\|' and `|\&|'
2671 map to |\eqnbreak| and |\eqnsep|
2672 in single-equation mode where they serves no other purpose;
2673 In stacked multi-line mode `|\&|' maps to |\eqnsep|.
2674 The commands have several optional arguments:
2675 \begin{center}
2676 |\eqnsep|\textbar|\eqnbreak|\textbar|\\|\,%
2677 \textit{mod}|[|\textit{skip}|]|\textvisiblespace
2678 \qquad
2679 |\eqnjoin|[|*|\textbar|[|\textit{skip}|]|]|{|\textit{conjunction}|}|
2680 \end{center}
2681 The modifiers `|.|', `|,|', `|~|', `|`{|\textit{punct}|}|',
2682 `|!|' adjust punctuation and `|*|' chooses a shorter glue,
2683 whereas the optional argument \textit{skip}
2684 specifies the amount of glue explicitly.
2685 \DescribeKey{linesep}
2686 \DescribeKey{colsep}
2687 The default amounts of glue for |\eqnbreak| or `|\\|' and |\eqnsep|
2688 are determined by the settings |linesep| and |colsep|, respectively.
2689 The starred variants |linesep*| and |colsep*|
2690 determine the short amount of glue.
2691
2692 \begin{example}
2693 \begin{scanexample}
2694 \[ x = \cos\phi \\[4em]
2695 \phi = \arccos x \]
2696 \end{scanexample}
2697 \showexampleh
2698 \begin{scanexample}
2699 \[`{,.} x = (z+z^{-1})/2 \\
2700 \phi = -i \log z \]
2701 \end{scanexample}
2702 \showexampleh
2703 \begin{scanexample}
2704 \[ x = \cos\phi \eqnjoin*{\iff}
2705 \phi = \arccos x \]
2706 \end{scanexample}
2707 \showexampleh
2708 \end{example}
2709
2710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2711 \paragraph{Transposition.}
2712
2713 \DescribeKey{transpose}
2714 \DescribeMod{/}
2715 When the aligned mode is used to produce more than one column of equations,
2716 the default line-by-line ordering of the content may be inconvenient.
2717 The package offers a transposition mode |transpose=plain| in which the content
2718 is specified on a column-by-column basis. Columns are separated by `|\&|'
2719 (the character `\&' must be escaped as `|{\&}|' in this mode)
2720 and the lines within each column are broken by `|\\|' as usual.
2721 The continued transposition mode |transpose=cont|
2722 (abbreviated by the modifier `|/|')
2723 furthermore reduces the input by assuming that all secondary
2724 alignment markers `|&|' indicate a continued equation
2725 and imply a line break with an empty left equation cell.
2726 Note that the transposition is implemented by reprocessing the input,
2727 which imposes some restrictions:
2728 all line and column breaks `|\\|', `|\&|' must be explicit
2729 (must not be produced by macro expansion),
2730 line breaks should not use optional arguments
2731 (they only work on the first column),
2732 and each section separated by `|\&|'
2733 should describe only a single column
2734 with one alignment marker per line (unless in continued transposition mode).
2735 Furthermore, the continued mode processes the alignment marker `|&|',
2736 which may cause issues when nesting aligned content.
2737
2738 \begin{example}
2739 \begin{scanexample}
2740 \<[transpose=plain]
2741 x &= \cos\phi \\ &= (z+z^{-1})/2
2742 \&
2743 \phi &= \arccos x \\ &= -i\log z
2744 \>
2745 \end{scanexample}
2746 \showexampleh
2747
2748 \begin{scanexample}
2749 \<[transpose=cont]
2750 x &= \cos\phi &= (z+z^{-1})/2
2751 \&
2752 \phi &= \arccos x &= -i\log z
2753 \>
2754 \end{scanexample}
2755 \showexampleh
2756 \end{example}
2757
2758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2759 \paragraph{Alternative Content Description.}
2760
2761 \DescribeKey{alt}
2762 \DescribeInterfaceMacro{\eqnalt}
2763 The package provides a basic interface to describe the equation content
2764 in an alternative form for the purposes of accessibility or documentation
2765 (corresponding to the |alt| tag in HTML):
2766 \begin{center}
2767 |alt={|\textit{alt text}|}|
2768 \qquad or \qquad
2769 |\eqnalt[|\textit{opt}|]{|\textit{alt}|}|
2770 \end{center}
2771 At the moment the alternative text \textit{alt} is not processed further,
2772 but an accessibility extension may implement the feature in tagged PDFs
2773 or HTML conversion. The comma-separated optional arguments \textit{opt}
2774 may specify the content further:
2775 |line| and |cell| restrict the applicability
2776 to the current equation line or cell, respectively.
2777 Other keys might specify the content format and language.
2778
2779 \begin{example}
2780 \begin{scanexample}
2781 \<[alt={example equations}]
2782 x &= \cos\phi \\
2783 \eqnalt[line]{reverse relationship}
2784 \phi &= \arccos x \>
2785 \end{scanexample}
2786 \showexampleh
2787 \end{example}
2788
2789 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2790 \subsection{General Options}
2791 \label{sec:auxiliary}
2792
2793 \DescribeInterfaceMacro{\eqnlinesset}
2794 Options of general nature can be selected by the commands:
2795 \begin{center}
2796 \begin{tabular}{rl}
2797 &|\usepackage[|\textit{opts}|]{eqnlines}|
2798 \\
2799 or&|\PassOptionsToPackage{|\textit{opts}|}{eqnlines}|
2800 \\
2801 or&|\eqnlinesset{|\textit{opts}|}|
2802 \end{tabular}
2803 \end{center}
2804 |\PassOptionsToPackage| must be used before |\usepackage|;
2805 |\eqnlinesset| must be used afterwards.
2806 \textit{opts} is a comma-separated list of options.
2807
2808 The package supplies the following general settings:
2809 \begin{longtable}{ll}
2810 option & description \\
2811 \hline
2812 |defaults=classic|
2813 & mimic classic \latex//\amsmath/ (layout and dimensions) \\
2814 |defaults=eqnlines|
2815 & \ctanpkg{eqnlines} layout with fontsize-relative dimensions \\
2816 |linesfallback| & single column in align mode reverts to lines mode \\
2817 & value |reuse| avoids third measuring pass \\
2818 |equationcr| & determine overloading of `|\\|' for single equations \\
2819 & |off|: native \latex/ error; |error|: package error; \\
2820 & |break|: insert horizontal glue (see \secref{sec:further}) \\
2821 |amp| & overload `|\&|' encoding column breaks and equality relations \\
2822 |scanequation| & scan single-line environments |equation|
2823 and |\[|\,\ldots|\]| \\
2824 |scanbox| & scan box environments |equationsbox|
2825 and |\<|\,\ldots|\>| \\
2826 |scanpar| & allow scanning of |\par| within equation body \\
2827 & (e.g., for use in nested |\parbox| or |minipage|) \\
2828 |rescan| & rescan environment body for special commands (e.g.\ |\verb|) \\
2829 |modifiereqn| & switch modifiers for equation blocks \\
2830 |modifierbox| & switch modifiers for equation boxes \\
2831 |modifiercr| & switch modifiers for `|\\|' \\
2832 |modifieramp| & switch modifiers for `|\&|' \\
2833 |modifierend| & switch trailing modifiers \\
2834 |modifierwarning| & invoke a warning for unknown environment modifiers \\
2835 |verbose| & track code location in log file for debugging purposes \\
2836 |ampproof| & equip optional argument parsing with protection for `|&|' \\
2837 |nativeequation| & native processing of single-line equations
2838 (reduced functionality) \\
2839 \end{longtable}
2840
2841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2842 \subsection{Feature Selection and Package Options}
2843 \label{sec:features}
2844
2845 The following few settings can only be specified when loading the package,
2846 not via |\eqnlinesset|:
2847 \begin{longtable}{ll}
2848 option & description \\
2849 \hline
2850 |env=none| & provide only |equations| and |equationsbox| environments \\
2851 |env=equation| & provide/overwrite |equation|,
2852 |displaymath| and |\[|\,\ldots|\]| \\
2853 |env=amsmath| & provide/overwrite \amsmath/ environments
2854 (including |equation|) \\
2855 |amsmathends|=\textit{bool} & patch \amsmath/ environments
2856 with individual endings \\
2857 |backup|=\textit{bool} & backup original \amsmath/ environments
2858 as |ams...| \\
2859 |ang|=\textit{bool} & provide |\<|\,\ldots|\>| \\
2860 |eqref|=\textit{bool} & provide |\eqref| \\
2861 |matrix|=\textit{bool} & provide \amsmath/ |?matrix|
2862 and |cases| environments \\
2863 \end{longtable}
2864
2865 If the above settings are explicitly disabled, the package will only supply
2866 the general purpose environment |equations|
2867 and its boxed cousin |equationsbox|.
2868 In that case, the specific equation environments and other features
2869 can be activated by the command:
2870 \begin{center}
2871 |\eqnlinesprovide{|\textit{features}|}|
2872 \end{center}
2873 \textit{features} is a comma-separated list of features:
2874 \begin{longtable}{ll}
2875 feature & description \\
2876 \hline
2877 \textit{env} & provide/overwrite environment \textit{env}:\\
2878 & |equation|, |equation*|, |displaymath|, |subequations| \\
2879 & |gather|, |multline|, |align|, |flalign|, |xalign|, |xxalign| \\
2880 & |gather*|, |multline*|, |align*|, |flalign*|, |xalign*| \\
2881 & |multlined|, |gathered|, |aligned| \\
2882 \textit{env}|=|\textit{name} &
2883 provide environment \textit{env} as \textit{name} \\
2884 |sqr| & provide |\[|\,\ldots|\]| \\
2885 |ang| & provide |\<|\,\ldots|\>| \\
2886 |eqref| & provide/overwrite macro |eqref| \\
2887 |tagform| & provide/overwrite macro |\tagform@|\\
2888 |maketag| & provide/overwrite macro |\maketag@@@|\\
2889 \end{longtable}
2890
2891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2893 \iffalse
2894 \TODO
2895 \section{List of Options}
2896 \label{sec:lists}
2897
2898 \fi
2899
2900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2902 \section{Information}
2903
2904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2905 \subsection{Copyright}
2906 \label{sec:copyright}
2907
2908 Copyright \copyright{} \thecopyright/
2909
2910 Based on the \latex/ package \amsmath/:
2911 Copyright \copyright{}
2912 1995, 2000, 2013 American Mathematical Society;
2913 2016--2024 \latex/ Project and American Mathematical Society.
2914
2915 This work may be distributed and/or modified under the
2916 conditions of the \latex/ Project Public License, either version 1.3
2917 of this license or (at your option) any later version.
2918 The latest version of this license is in
2919 \url{https://www.latex-project.org/lppl.txt}
2920 and version 1.3c or later is part of all distributions of \latex/
2921 version 2008 or later.
2922
2923 This work has the LPPL maintenance status `maintained'.
2924
2925 The Current Maintainer of this work is Niklas Beisert.
2926
2927 This work consists of the files
2928 |README.txt|, \verbpkg|.ins| and \verbpkg|.dtx|
2929 as well as the derived files listed in \secref{sec:installation}.
2930
2931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2932 \subsection{Credits}
2933 \label{sec:credits}
2934
2935 This package is based on the \latex/ package \amsmath/
2936 (initially named \markpkg{amstex})
2937 which in turn is based on the \tex/ macro system \ctanpkg{amstex}
2938 written by Michael Spivak.
2939 The initial work of porting \ctanpkg{amstex} to \latex/
2940 was done in 1988--1989 by Frank Mittelbach and Rainer Sch\"opf.
2941 In 1994 David M.\ Jones added the support for flush-left layout
2942 and did extensive improvements to the align family of environments
2943 and to the equation number handling in general.
2944 Michael Downes at the AMS served as coordinator
2945 for the efforts of Mittelbach, Sch\"opf, and Jones,
2946 and has contributed various bug fixes and additional refinements over time.
2947 Since 2016, the package has been maintained by the \latex/ Project
2948 with contributions by the above and David Carlisle.
2949
2950 This package has been forked from \amsmath/
2951 in accordance with the LPPL, particularly paragraph 6.
2952 The original package \amsmath/ is available
2953 at CTAN within \ctanpkg{latex-amsmath}.
2954 It uses the basic mechanisms for processing
2955 numbered multi-line equations as developed in \amsmath/
2956 (environments |equation|, |align|, |gather|, |multline|, |gathered|, |aligned|
2957 and related), as well as code implementing these mechanisms.
2958 It differs from \amsmath/ in the following aspects:
2959 \begin{itemize}
2960 \item
2961 The implementations of |split| and methods unrelated to multi-line equations
2962 and equation numbering have been dropped.
2963 \item
2964 Code has been restructured, macros have been renamed and extended.
2965 \item
2966 Numbering and horizontal adjustment schemes have been unified and extended.
2967 \item
2968 Options for math classes surrounding the alignment have been added.
2969 \item
2970 A punctuation scheme has been added.
2971 \item
2972 Vertical spacing has been redesigned.
2973 \item
2974 Optional parameters have been added to environments.
2975 \item
2976 Various configuration options and layout settings have been added.
2977 \item
2978 Cooperation with \ctanpkg{hyperref}, \ctanpkg{showkeys}
2979 and \amsmath/ has been included into the package.
2980 \end{itemize}
2981
2982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2983 \subsection{Files and Installation}
2984 \label{sec:installation}
2985
2986 The package consists of the files:
2987 \begin{longtable}{ll}
2988 |README.txt| & readme file \\
2989 \verbpkg|.ins| & installation file \\
2990 \verbpkg|.dtx| & source file \\
2991 \verbpkg|.sty| & package file \\
2992 \verbpkg|.tex| & reference manual file \\
2993 \verbpkg|.pdf| & reference manual \\
2994 \verbpkg|-src.tex| & source code documentation file \\
2995 \verbpkg|-src.pdf| & source code documentation \\
2996 \end{longtable}
2997 The distribution consists of the files
2998 |README.txt|, \verbpkg|.ins| and \verbpkg|.dtx|.
2999 \begin{itemize}
3000 \item
3001 Run \latex/ on \verbpkg|.ins| to create the package \verbpkg|.sty|
3002 and further documentation files.
3003 \item
3004 Copy the file \verbpkg|.sty| to an appropriate directory of your \latex/
3005 distribution, e.g.\ \textit{texmf-root}|/tex/latex/|\verbpkg.
3006 \item
3007 Alternatively, you may copy \verbpkg|.sty| to your project directory.
3008 \item
3009 Run (pdf)\latex/ on \verbpkg|.tex|
3010 to compile the manual \verbpkg|.pdf| (this file).
3011 \item
3012 Run (pdf)\latex/ on \verbpkg|-src.tex|
3013 to compile the source code documentation \verbpkg|-src.pdf|.
3014 \end{itemize}
3015
3016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3017 \subsection{Related CTAN Packages}
3018
3019 The package is related to other packages available at CTAN:
3020 \begin{itemize}
3021 \item
3022 This package uses the package \ctanpkg{keyval}
3023 to process the options for the package, environments and macros.
3024 Compatibility with the \ctanpkg{keyval} package
3025 has been tested with v1.15 (\markdate{2022-05-29}).
3026 \item
3027 This package reproduces the math environments functionality
3028 of the package \amsmath/.
3029 The present code is based on \amsmath/ v2.17t (\markdate{2024-11-05}).
3030 Compatibility with the \amsmath/ package is maintained
3031 whether \ctanpkg{eqnlines} is loaded before or after \amsmath/.
3032 By default, \ctanpkg{eqnlines} overwrites
3033 most math environments of \amsmath/ with its own implementations.
3034 It can also preserve them as |ams...| if needed.
3035 Alternatively, \ctanpkg{eqnlines} may assign individual names
3036 to the maths environments and preserve the ones of \amsmath/.
3037 The other features provided by \amsmath/
3038 can be used.
3039 \item
3040 The package \ctanpkg{mathtools}
3041 is a popular extension of the \amsmath/ package.
3042 This package incorporates some of the features and improvements
3043 provided by the \ctanpkg{mathtools} package.
3044 Compatibility with the \ctanpkg{mathtools} package
3045 has been tested with v1.31 (\markdate{2024-10-04}),
3046 and it is maintained whether \ctanpkg{eqnlines}
3047 is loaded before or after \ctanpkg{mathtools}.
3048 Some features like emphasising equations via \ctanpkg{empheq}
3049 do not (yet) work.
3050 \item
3051 This package has several overlapping goals and considerations
3052 with the package \ctanpkg{breqn} in handling
3053 long equations more conveniently.
3054 However, the approach is very different from \ctanpkg{breqn}
3055 which mainly aims at automation.
3056 \item
3057 This package cooperates with the package \ctanpkg{hyperref}
3058 to create anchors and references within the electronic document.
3059 Compatibility with the \ctanpkg{hyperref} package
3060 has been tested with v7.01l (\markdate{2024-11-05}).
3061 \item
3062 This package cooperates with the package \ctanpkg{beamer}
3063 in assigning default colours for math content.
3064 Compatibility with the \ctanpkg{beamer} package
3065 has been tested with v3.74 (\markdate{2025-06-15}).
3066 \item
3067 This package supports the display of labels and references
3068 through the package \ctanpkg{showkeys}.
3069 Compatibility with the \ctanpkg{showkeys} package
3070 has been tested with v3.21 (\markdate{2024-05-23}).
3071 \item
3072 This package supports placement of QED symbols within |proof|s
3073 through the |\qedhere| interface of the package \ctanpkg{amsthm}.
3074 Compatibility with the \ctanpkg{amsthm} package
3075 has been tested with v2.20.6 (\markdate{2020-05-29}).
3076 \item
3077 This package supports PDF tagging
3078 using the framework defined in \ctanpkg{tagpdf} and \ctanpkg{luamml}
3079 (when using the |lualatex| engine).
3080 It uses and adjusts some methods from
3081 the development framework \ctanpkg{latex-lab} (|math| and |amsmath| modules).
3082 Compatibility has been tested with the package versions
3083 \ctanpkg{tagpdf} v0.99w (\markdate{2025-10-31}),
3084 \ctanpkg{luamml} v0.7.0 (\markdate{2025-10-20}) and
3085 \ctanpkg{latex-lab} (\markdate{2025-11-01}).
3086 Support for PDF tagging is preliminary, partial and fragile;
3087 it may break due to future developments of the PDF tagging framework.
3088 \item
3089 This package is currently not compatible
3090 with the package \ctanpkg{cleveref}
3091 (thanks to Jon\'a\v s Dujava for pointing out).
3092 The command |\Cref| will not refer properly to equation numbers
3093 recorded by the |equations| environment.
3094 Further features of either package and/or/in combination with \amsmath/
3095 may fail due to the patching by the package.
3096 The alternative package \ctanpkg{zref-clever} appears to work as intended.
3097 Incompatibility with the \ctanpkg{cleveref} package
3098 has been observed for v0.21.4 (\markdate{2018-03-27}).
3099 Compatibility with the \ctanpkg{zref-clever} package
3100 has been tested with v0.5.1 (\markdate{2024-11-28}).
3101 \end{itemize}
3102
3103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3104 \iffalse
3105 \subsection{Feature Suggestions}
3106
3107 The following is a list of features for consideration
3108 towards future versions of this package.
3109 Their potential use may range between useful and niche;
3110 and their difficulty between easy and impossible.
3111
3112 Documentation:
3113 \begin{itemize}
3114 \item
3115 complete code documentation
3116 \item
3117 list of all option keys with scope, defaults and special values
3118 \end{itemize}
3119
3120 Additional functionality:
3121 \begin{itemize}
3122 \item
3123 alignment for columns mode (two columns as before)
3124 \item
3125 extended columns mode, allow alignment in lines mode
3126 \item
3127 reduce intercolumn space below zero if indentation permits
3128 \item
3129 single column compressible lines in columns mode
3130 (determine alignment line first)
3131 \item
3132 flexible columns mode (note math classes, punctuation, intercolumn space)
3133 \item
3134 routine to compose custom option environments
3135 \end{itemize}
3136
3137 Fix or complete functionality:
3138 \begin{itemize}
3139 \item
3140 |\vspace| for |equationsbox| (requires line container)
3141 \item
3142 adjust PDF tagging with development in kernel,
3143 describe functionality when ready
3144 \item
3145 |\intertext| might not collaborate correctly with PDF tagging
3146 \item
3147 alternative alignment for `|\&:|' to align with relation (further left)
3148 \item
3149 change math classes at following alignment by control (requires cell container)
3150 \item
3151 modifier `|@|' or `|_|' for |\&| to just add space in |columns| mode
3152 \item
3153 scan for `|[]|' after `|;|' to add space; or use other modifier `|@|')
3154 \item
3155 adjust column separation with `|\&[]|' (perhaps use min, also allow shrink?)
3156 \item
3157 skip intercolumn for columns |A=B=C|
3158 \item
3159 clear several columns with `|\&*|'
3160 \end{itemize}
3161
3162 Some technical and/or internal items to be done include:
3163 \begin{itemize}
3164 \item
3165 test files
3166 \item
3167 check documentation for all features
3168 \item
3169 change |\@ifpackageloaded| to |\IfPackageLoaded...|
3170 when command is less recent.
3171 \item
3172 change bool registers to |char| 0 and 1 and |\||ifodd|
3173 \end{itemize}
3174
3175 \fi
3176
3177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3178 \subsection{Revision History}
3179
3180 \iffalse
3181
3182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3183 \paragraph{vN.N.N+:} \markdate{20YY-MM-DD}
3184
3185 \begin{itemize}
3186 \item
3187 \ldots
3188 \end{itemize}
3189
3190 \fi
3191
3192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3193 \paragraph{v1.0.1:} \markdate{2026-03-23}
3194
3195 \begin{itemize}
3196 \item
3197 fix for not applying |math text| colour for boxes in \ctanpkg{beamer}
3198 \item
3199 traditional alias values |p|, |b|, |B|, |V| for |matrix| option in boxes
3200 \item
3201 suppress modifier warning for combination `|\>$|' ending a box%$
3202 \item
3203 minor setting adjustments
3204 \item
3205 package maintenance
3206 \end{itemize}
3207
3208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3209 \paragraph{v1.0:} \markdate{2026-02-15}
3210
3211 \begin{itemize}
3212 \item
3213 stable release
3214 \end{itemize}
3215
3216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3217 \paragraph{v0.15.2:} \markdate{2026-02-15}
3218
3219 \begin{itemize}
3220 \item
3221 added column punctuation for left column in |cases| boxes
3222 (uses preset |punctcases|)
3223 \item
3224 added column separation |matrixsep| for |matrix| boxes
3225 \item
3226 added glue adjustment |classbreakskip| (muskip) for continued equation |\&;|
3227 \end{itemize}
3228
3229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3230 \paragraph{v0.15.1:} \markdate{2026-02-12}
3231
3232 \begin{itemize}
3233 \item
3234 deactivated numbering for |equations|
3235 and symbolic forms |\[|\,\ldots|\]|, |\<|\,\ldots|\>| by default
3236 (to match with \latex/ and \amsmath/ behaviour;
3237 enable by |\eqnlinesset{number=on}|;
3238 use |\eqnlinesset{sqropt=nonumber}| to keep deactivated for |\[|\,\ldots|\]|)
3239 \item
3240 changed equality relation alignment modifier `\verbbar' to `|?|'
3241 \item
3242 added alignment modifier `\verbbar' for within terms
3243 \end{itemize}
3244
3245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3246 \paragraph{v0.15:} \markdate{2026-02-07}
3247
3248 \begin{itemize}
3249 \item
3250 added column break operator `|\&|'
3251 \item
3252 added equality relation alignment modifiers `|=|', `\verbbar', `|;|' and `|:|'
3253 \item
3254 renamed continued equation modifier to `|/|' (was `|~|')
3255 \item
3256 added options |modifier...| to switch modifiers in various situations
3257 \item
3258 disabled modifiers for |matrix| environments to avoid warnings
3259 \item
3260 disabled modifiers for all environments;
3261 modifiers remain active for symbolic forms
3262 \item
3263 activated numbering for square and angle symbolic forms by default
3264 (revert previous behaviour by |\eqnlinesset{sqropt=nonumber,angopt=nonumber}|)
3265 \item
3266 added and adjusted options and controls for punctuation and equality relations
3267 \end{itemize}
3268
3269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3270 \paragraph{v0.14.1:} \markdate{2026-01-30}
3271
3272 \begin{itemize}
3273 \item
3274 changed math classes for |delim| to open/close
3275 \item
3276 added modifier `|!|' for |equationbox|
3277 (also trailing for |\<|\,\ldots|\>|) and |\\|
3278 to trigger |\eqnapplypunct|
3279 \item
3280 added option |scanbox| to scan box environments
3281 and enable trailing modifiers
3282 \end{itemize}
3283
3284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3285 \paragraph{v0.14:} \markdate{2026-01-28}
3286
3287 \begin{itemize}
3288 \item
3289 added |cases| and |matrix| environments
3290 \item
3291 added punctuation modifiers `|.|' and `|,|'
3292 to |\eqnsep|, |\eqnbreak|, |\\| and |equationsbox|
3293 \item
3294 made |\eqnpunctapply| work within cells and embedded groups
3295 \item
3296 made |\eqnpunct| work for left cells in a column
3297 \item
3298 added modifiers `|<|' and `|>|' for class options |ampeq| and |eqamp|
3299 \item
3300 added option |delim| for delimiter selection
3301 \item
3302 added option |style| for text and display math styles
3303 \item
3304 added option |spread*| to reduce line spread
3305 \end{itemize}
3306
3307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3308 \paragraph{v0.13:} \markdate{2026-01-14}
3309
3310 \begin{itemize}
3311 \item
3312 added trailing modifiers to conveniently adjust punctuation
3313 \item
3314 added |verbose| mode for debugging purposes,
3315 removed |eqnlines-dev| package version
3316 \item
3317 fixed spacing issues with `|\\~|'
3318 \end{itemize}
3319
3320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3321 \paragraph{v0.12.2:} \markdate{2026-01-13}
3322
3323 \begin{itemize}
3324 \item
3325 registered environments with luamml for label processing
3326 \item
3327 use |\eqnlinesprovide| for starred variants separately
3328 \end{itemize}
3329
3330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3331 \paragraph{v0.12.1:} \markdate{2025-12-28}
3332
3333 \begin{itemize}
3334 \item
3335 fixed unwanted deferring of numbering when using |\\~| in continuous mode
3336 \end{itemize}
3337
3338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3339 \paragraph{v0.12:} \markdate{2025-12-27}
3340
3341 \begin{itemize}
3342 \item
3343 split off source code documentation into separate document \verbpkg|-src|
3344 \item
3345 added modified newline `|\\~|' to indicate continued equation
3346 with deferred numbering and punctuation suppressed
3347 \item
3348 added |\eqnsep|, |\eqnbreak|, |\eqnjoin| for single-line compositions,
3349 mapped `|\\|' for single equations to |\eqnbreak|
3350 \item
3351 added modifier `|`|' to |equationsbox|
3352 \item
3353 removed faulty option |crerror|
3354 \end{itemize}
3355
3356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3357 \paragraph{v0.11:} \markdate{2025-10-25}
3358
3359 \begin{itemize}
3360 \item
3361 added option |punctall| and modifier `|`|'
3362 to specify several levels of punctuation at once
3363 \end{itemize}
3364
3365 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3366 \paragraph{v0.10.1:} \markdate{2025-06-23}
3367
3368 \begin{itemize}
3369 \item
3370 fix for setting default colours (|math text|) in \ctanpkg{beamer}
3371 \end{itemize}
3372
3373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3374 \paragraph{v0.10:} \markdate{2025-05-29}
3375
3376 \begin{itemize}
3377 \item
3378 added |numberline| modes |center|, |median|, |top| and |bottom|
3379 with continuous vertical adjustments
3380 (thanks to Jon\'a\v s Dujava for testing)
3381 \item
3382 fixed spacing following |\paragraph|
3383 (thanks to Jon\'a\v s Dujava for report)
3384 \item
3385 added control |inject| to add free-style content after the present line
3386 \item
3387 added control |markline| and |qed| to display a (QED) mark
3388 \item
3389 added support for \ctanpkg{amsthm} through |\qedhere|
3390 (thanks to Jon\'a\v s Dujava for suggestion)
3391 \item
3392 fixed minor issues
3393 \item
3394 internal structure and minor interface changes
3395 \end{itemize}
3396
3397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3398 \paragraph{v0.9:} \markdate{2025-05-18}
3399
3400 \begin{itemize}
3401 \item
3402 option |transpose| to transpose rows and columns in columns mode
3403 (thanks to Christophe Bal for suggestion)
3404 \item
3405 added |\eqncontrol| interface for control within lines and cells
3406 \item
3407 internal structure and interface changes
3408 \item
3409 added |\vspace*| for persistent glue at page breaks
3410 \item
3411 added framed tags (|frametag|)
3412 \item
3413 added |\raisetag!| to enforce raising (or lowering) of tags
3414 even if space is sufficient
3415 \item
3416 added modifiers, relaxed order, changed lines mode modifier from `|~|' to `|=|'
3417 \item
3418 fixed minor issues
3419 \item
3420 thanks to Jon\'a\v s Dujava for various reports and suggestions
3421 \end{itemize}
3422
3423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3424 \paragraph{v0.8:} \markdate{2025-04-30}
3425
3426 \begin{itemize}
3427 \item
3428 added framed cells (|\framecell|)
3429 \item
3430 added automatic best line selection for tag placement
3431 (|best| and |evadetag|)
3432 \item
3433 symbolic environment |\<|\,\ldots|\>| forwards to |equationsbox| in math mode
3434 \item
3435 added wrapping for |equationsbox| (|frame|, |wrap|)
3436 \item
3437 horizontal adjustment reworked and completed; |\shoveby| added
3438 \item
3439 extended |\label| to assign names to labels for |\namedref|
3440 \item
3441 interface for alternative representations (|alt| and |\eqnalt|)
3442 \item
3443 options to adjust line width and margins
3444 (|linewidth|, |marginleft|, |marginright|)
3445 \item
3446 added option |scanpar| to allow |\par| appearing in equation body
3447 \item
3448 added continuous penalties (|prepenalty|, |postpenalty|, |interpenalty|)
3449 \item
3450 added overloading for |displaymath| and remaining \amsmath/ math environments
3451 \item
3452 minor interface changes (rename, recombine, values)
3453 \item
3454 documentation expanded
3455 \item
3456 several issues fixed
3457 \end{itemize}
3458
3459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3460 \paragraph{v0.7.1:} \markdate{2025-04-09}
3461
3462 \begin{itemize}
3463 \item
3464 improvements for PDF tagging
3465 \item
3466 backup all available math environments at the start using |backup| switch
3467 \end{itemize}
3468
3469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3470 \paragraph{v0.7:} \markdate{2025-04-03}
3471
3472 \begin{itemize}
3473 \item
3474 manual expanded, examples added
3475 \item
3476 fixes for numbering, tagging, options, |linesfallback|, zero lines
3477 \item
3478 expansions for vertical spacing modes, tag display, |subeqtemplate|
3479 \item
3480 some consolidations
3481 \item
3482 internal rearrangements
3483 \end{itemize}
3484
3485 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3486 \paragraph{v0.6.1:} \markdate{2025-03-27}
3487
3488 \begin{itemize}
3489 \item
3490 |\eqnpunct| can place punctuation within the current equation cell
3491 \item
3492 |numberline=none| now acts as |numberline=all| and |nonumber|
3493 \item
3494 fixed and extended |tagmargin|
3495 with |tagmarginratio| and |tagmarginthreshold|
3496 \item
3497 padding now applies to single-line equations as well
3498 \end{itemize}
3499
3500 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3501 \paragraph{v0.6:} \markdate{2025-03-11}
3502
3503 \begin{itemize}
3504 \item
3505 preliminary PDF tagging support
3506 (\url{https://latex3.github.io/tagging-project/};
3507 \amsmath/ \emph{must} be loaded \emph{before} \ctanpkg{eqnlines}
3508 to avoid errors
3509 \item
3510 classic \latex//\amsmath/ vs.\ \ctanpkg{eqnlines} presets
3511 \item
3512 changed vertical spacing schemes and added further options
3513 \item
3514 supplied dimensions processed by |\glueexpr|
3515 \item
3516 more independent of \amsmath/ structures
3517 \item
3518 internal reorganisations
3519 \end{itemize}
3520
3521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3522 \paragraph{v0.5:} \markdate{2025-02-25}
3523
3524 \begin{itemize}
3525 \item
3526 preview version published on CTAN
3527 \item
3528 thanks to Till Bargheer for testing and reports
3529 \end{itemize}
3530
3531
3532 \end{document}
3533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3536 \endinput
3537 %%
3538 %% End of file `eqnlines.tex'.