%%
%% This is file `eqnlines.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% eqnlines.dtx  (with options: `manual')
%% 
%% Copyright (C) 2024-2025 Niklas Beisert
%% 
%% Based on the latex package amsmath:
%% Copyright (C) 1995, 2000, 2013 American Mathematical Society.
%% Copyright (C) 2016-2024 LaTeX Project and American Mathematical Society.
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008 or later.
%% 
\ProvidesFile{eqnlines.tex}[2025/12/28 v0.12.1 eqnlines reference manual]
\def\thedate/{2025/12/28}\def\theversion/{v0.12.1}
\def\thecopyright/{2024\texorpdfstring{--}{-}2025 Niklas Beisert}
\PassOptionsToClass{10pt,a4paper}{article}
\documentclass{ltxdoc}

\usepackage[margin=35mm]{geometry}
\usepackage[hyperindex=false]{hyperref}
\usepackage{hyperxmp}
\usepackage[usenames]{color}

\title{The \markpkg{eqnlines} Package\\Reference Manual}
\hypersetup{pdftitle={The eqnlines Package -- Reference Manual}}
\hypersetup{pdfsubject={Reference Manual for the LaTeX2e Package eqnlines}}
\author{Niklas Beisert\\[2ex]
  Institut f\"ur Theoretische Physik\\
  Eidgen\"ossische Technische Hochschule Z\"urich\\
  Wolfgang-Pauli-Strasse 27, 8093 Z\"urich, Switzerland\\[1ex]
  \href{mailto:nbeisert@itp.phys.ethz.ch}
  {\texttt{nbeisert@itp.phys.ethz.ch}}}
\hypersetup{pdfauthor={Niklas Beisert}}
\date{\thedate/, \theversion/\\[1ex]
\url{https://ctan.org/pkg/eqnlines}\\[0.5ex]
\url{https://github.com/nbeisert/latex-pkg-nb}}

\hypersetup{pdflang={en-UK}}
\hypersetup{pdfurl={https://ctan.org/pkg/eqnlines}}
\hypersetup{pdfcopyright={Copyright \thecopyright/.
  This work may be distributed and/or modified under the
  conditions of the LaTeX Project Public License, either version 1.3
  of this license or (at your option) any later version.}}
\hypersetup{pdflicenseurl={https://www.latex-project.org/lppl.txt}}
\hypersetup{pdfcontactaddress={ETH Zurich, ITP, HIT K,
  Wolfgang-Pauli-Strasse 27}}
\hypersetup{pdfcontactpostcode={8093}}
\hypersetup{pdfcontactcity={Zurich}}
\hypersetup{pdfcontactcountry={Switzerland}}
\hypersetup{pdfcontactemail={nbeisert@itp.phys.ethz.ch}}
\hypersetup{pdfcontacturl={https://people.phys.ethz.ch/\xmptilde nbeisert/}}

\hypersetup{keeppdfinfo=true}
\hypersetup{pdfsource={}}
\AddToHook{begindocument/before}{\hypersetup{colorlinks=false}}
\hypersetup{urlbordercolor={.5 1 1}}
\hypersetup{linkbordercolor={1 .7 .7}}
\AddToHook{begindocument/before}{\hypersetup{pdfstartview=FitH}}

\parskip1ex
\parindent0pt
\edef\itemize{\unexpanded\expandafter{\itemize}\parskip0pt}

\newcommand{\markpkg}[1]{\textsf{#1}}
\newcommand{\secref}[1]{\hyperref[#1]{section \ref*{#1}}}
\newcommand{\ctanref}[2]{\href{https://ctan.org/#1}{#2}}
\newcommand{\ctanpkg}[1]{\ctanref{pkg/#1}{\markpkg{#1}}}

\def\textvert{\texttt{\char"7C}}

\newcommand{\TODO}{\textbf{\textcolor{red}{TODO:}} }

\def\tex/{\TeX}
\def\latex/{\LaTeX}
\def\amsmath/{\ctanpkg{amsmath}}

\RenewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = ,
  idxgroup = LaTeX commands\actualchar\latex/ commands ,
  printtype =
  ]{Macro}{macro}
\RenewDocElement[macrolike = false ,
  toplevel = false,
  idxtype = env. ,
  idxgroup = Package environments,
  printtype = \textit{env.}
  ]{Env}{environment}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = ,
  idxgroup = Package commands,
  printtype =
  ]{InterfaceMacro}{imacro}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = ,
  idxgroup = Package commands (obsolete),
  printtype =
  ]{ObsoleteInterfaceMacro}{omacro}
\NewDocElement[macrolike = false ,
  toplevel = false,
  idxtype = key ,
  idxgroup = Package keys ,
  printtype = \textit{key}
  ]{Key}{key}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = counter ,
  idxgroup = TeX counters\actualchar \protect\tex/ counters ,
  printtype = \textit{counter}
  ]{TeXCounter}{tcounter}
\NewDocElement[macrolike = false ,
  toplevel = false,
  idxtype = counter ,
  idxgroup = LaTeX counters\actualchar \latex/ counters ,
  printtype = \textit{counter}
  ]{LaTeXCounter}{lcounter}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = skip ,
  idxgroup = LaTeX length\actualchar \latex/ length (skip) ,
  printtype = \textit{skip}
  ]{LaTeXSkip}{lskip}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = dimen ,
  idxgroup = LaTeX length\actualchar \latex/ length (dimen) ,
  printtype = \textit{dimen}
  ]{LaTeXDimen}{ldimen}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = box ,
  idxgroup = LaTeX box\actualchar \latex/ box ,
  printtype = \textit{box}
  ]{LaTeXBox}{lbox}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = bool ,
  idxgroup = eqnlines bool\actualchar eqnlines bool ,
  printtype = \textit{bool}
  ]{eqnlinesBool}{ebool}
\NewDocElement[macrolike = true ,
  toplevel = false,
  idxtype = bool ,
  idxgroup = LaTeX conditional\actualchar \latex/ conditional ,
  printtype = \textit{bool}
  ]{LaTeXConditional}{lcond}

\usepackage{verbatim}
\makeatletter
\def\example@addline#1{%
  \g@addto@macro\example@dbuf{#1 }%
  \g@addto@macro\example@pbuf{\item|#1|}}
\def\scanexample{%
  \gdef\example@dbuf{}%
  \gdef\example@pbuf{}%
  \begingroup
  \@bsphack
  \let\do\@makeother\dospecials
  \catcode`\^^M\active
  \def\verbatim@processline{\expandafter\example@addline\expandafter%
    {\the\verbatim@line}}%
  \verbatim@start}
\def\endscanexample{\@esphack\endgroup\ignorespacesafterend}
\def\printexample{\begingroup
  \topsep\z@skip\parsep\z@skip\itemsep\z@skip\partopsep\z@skip\parskip\z@skip
  \trivlist
  \expandafter\scantokens\expandafter{\example@pbuf}%
  \endtrivlist
  \endgroup}
\def\doexample{\expandafter\scantokens\expandafter{\example@dbuf}}
\newcommand{\showexampleh}[1][0.5]{\par%
  \parbox{\dimexpr#1\textwidth\relax}{\printexample}%
  \parbox{\dimexpr\textwidth-#1\textwidth\relax}{\doexample}%
  \par\medskip\ignorespaces}
\newcommand{\showexamplev}{%
  \printexample
  \par\medskip
  \parbox{\textwidth}{\doexample}%
  \par\medskip\ignorespaces}
\newenvironment{example}
  {\parskip\z@skip\par\medskip\hrule\medskip}
  {\par\hrule\par\medskip}
\makeatother

\usepackage{eqnlines}
\eqnlinesset{belowtopmode=top,belowtopskip=0pt}
\def\pstrut{\vphantom{(}}
\def\bstrut{\vphantom{b}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\maketitle

\begin{abstract}\noindent
\markpkg{eqnlines} is a \LaTeXe{} package providing
a framework for typesetting single- and multi-line equations
which extends the established equation environments
of \latex/ and the \markpkg{amsmath} package
with many options for convenient adjustment of the intended layout.
In particular, the package adds flexible schemes for numbering,
horizontal alignment and semi-automatic punctuation, and it improves
upon the horizontal and vertical spacing options. The extensions can
be used and adjusted through optional arguments and modifiers to the
equation environments as well as global settings.
\end{abstract}

\begingroup
\parskip0ex
\tableofcontents
\endgroup

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}

Typesetting mathematical equations is an undisputed strength of \tex/.
\latex/ improved the overall management of display equations,
for instance by providing optional numbering.
It also added elementary functionality for multi-line equations
with alignment. Some of its deficiencies were addressed by
the multi-line equation environments of the package \amsmath/
which have become an established standard for these purposes.

The package \ctanpkg{eqnlines} builds upon and extends
the functionality of the \latex/ and \amsmath/
equation environments with some new features
as well as convenient options to adjust the layout where needed.
The main additions are as follows:
\begin{itemize}
\item
Equation numbers can be assigned to individual lines
(as for |align| and |gather|)
or once for the multi-line equation block
(as for |multline|).
In the former case,
a sub-numbering scheme can be applied (as through |subequations|).
In the latter case, the position can be assigned to a specific line
(first/middle/last/chosen).
Moreover, equation numbers can be turned on and off by commands,
and they can be triggered by setting a label.
\item
The vertical spacing above and below single- and multi-line equations
of \latex/ and \amsmath/ can be somewhat variable,
hard to control and even resistive in certain situations.
The package implements clearer structures controlling the vertical spacing,
including proper dependency on the text line above
and ways to adjust the spacing.
\item
The framework introduces a scheme which semi-automatically inserts punctuation,
e.g.\ `.' or `,', at the end of the following (or every) equation environment.
Punctuation can also be inserted at every alignment column or equation line
including the possibility to prepend a certain spacing.
\item
Next to |\[|\,\ldots|\]| as an alias for the single-line |equation| environment,
the package uses |\<|\,\ldots|\>| as an alias multi-line equations.
\item
The horizontal alignment and indentation of equation lines
can be adjusted via a scheme or on a line-by-line basis.
\item
The alignment marker can be placed
before or after the equation signs while maintaining proper spacing
to symbols before and after it.
This simplifies the construction of continuing equations
in an aligned context.
\item
Equation lines are subject to shrinking of space
if the available space does not suffice
(analogously to single-line equations).
\item
Most settings can be controlled via optional arguments and modifiers to the
equation environment or via global settings.
This includes switching between different types of equation environments,
enabling or disabling numbering, adjusting vertical spacing, etc.
This feature simplifies the adjustment and fine-tuning of equations
towards the intended layout.
\item
Last but not least, the underlying \amsmath/ code,
originating from the \tex/ era and early \latex/ years,
has been redesigned with emphasis
on clarity, readability, adjustability and maintainability
(but at the cost of moderately higher resource consumption
and moderately lower efficiency).
Nevertheless, it remains original \LaTeXe{} code
without using the \markpkg{expl3} layer.
\end{itemize}

The package represents a stand-alone implementation
of an equations environment
which is largely compatible with the established \latex/ and \amsmath/
environments |equation|, |multline|, |gather|, |align|
and their variants.
Hence, the package can be used instead of \amsmath/
with no or minor modifications to the \latex/ sources for
single- and multi-line equations.
It can also be used alongside \amsmath/
including the \ctanpkg{mathtools} extensions
to make use of the additional maths typesetting features
provided by these packages.
In the latter case,
the equation environments of \latex/ and \amsmath/
are either replaced or left in place while the \ctanpkg{eqnlines}
environments can be accessed using the alternate name |equations|.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Usage}
\label{sec:usage}

\textbf{Notice regarding package version \theversion/:}
Please note that this package is still in a development and testing stage
in the present version.
This mainly applies to the documentation of features and code:
Currently, the documentation is basic and minimal
without extensive coverage of all features and settings,
and it lacks desirable illustrations and examples.

It is likely that some features of the package do not work to full extent,
and that the package will not cooperate well with other packages.
Therefore, please report any malfunctions that you may notice.

Therefore, it is likely that internal macros and mechanisms will change,
It is also conceivable that the public interface
will change in minor but relevant ways
in order to accommodate for important adjustments or additional features.
It is intended that such changes would only require minor adaption
of document sources that use an early version of this package.

\medskip

To use the \ctanpkg{eqnlines} package add the command
\begin{center}
|\usepackage{eqnlines}|
\end{center}
to the preamble of the \latex/ document.
To use unrelated features of the \amsmath/ package
or of the \ctanpkg{mathtools} extension,
it makes sense to load these packages \emph{before} \ctanpkg{eqnlines}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Equations Environment}
\label{sec:equations}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Options.}

\DescribeEnv{equations}
The environment |equations|
accepts a comma-separated list of optional parameters
`|[|\textit{opts}|]|':
\begin{center}
\begin{tabular}{l}
|\begin{equations}|\textit{mod}|[|\textit{opts}|]|%
  \textit{mod}\texttt{\textvisiblespace}
\\
\ldots
\\
|\end{equations}|
\end{tabular}
\end{center}
Furthermore, the environment accepts modifiers \textit{mod}
(like the star modifier `|*|' for many other \latex/ macros)
acting as shortcuts for some options to be explained further below.
They can be specified in any order.

We note that the |equations| environment should be started with a whitespace
character `\texttt{\textvisiblespace}'
which provides a clear separation
from optional arguments `|[|\textit{opts}|]|'
and/or modifiers which must immediately follow
the environment declaration |\begin{equations}|
without whitespaces.
Any character without a proper meaning will also start the equation content,
however, future versions of the package may extend the syntax of modifiers,
and thus a separation by whitespace is advertised.

\DescribeInterfaceMacro{\eqnlinesset}
Most options, but not all, can be set permanently by the macro:
\begin{center}
|\eqnlinesset{|\textit{opts}|}|
\end{center}
\DescribeInterfaceMacro{\eqncontrol}
Several options can be controlled
for individual lines or cells within the equations block by the macro:
\begin{center}
|\eqncontrol{|\textit{opts}|}|
\end{center}
The |\eqncontrol| interface also provides several features
for which no other macro definitions exist.
Shortcuts to frequently used features could be installed by
user definitions such as:
\begin{center}
|\newcommand{\|\textit{shortcut}|}[1]{\eqncontrol{|\textit{key}|={#1}}}|
\end{center}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Modes of Operation.}

The package supplies a main maths environment called |equations|
which has three principal modes of operation.
It can display a single-line equation
just as the \latex/ environment |equation| or
the symbolic shortcut |\[...\]|:
\[
\framebox[8cm]{\pstrut single line}
\]
It can display a stack of equations
analogous to the \amsmath/ environments |gather| and |multline|:
\unskip\footnote{Arguably, a single-line equation is
just a stack of equations of height 1.
Nevertheless, there is a single-line mode
which prohibits line breaks and which works slightly more efficiently:
For example, the multi-line modes will process the input
twice which is not needed for the single-line mode.
Apart from that, the package takes care that the layout and spacing
of single-line equations and multi-line equations consisting of a single line
is the same.}
\<=[pad]
\framebox[4cm]{\pstrut stacked line 1}
\\
\framebox[7cm]{\pstrut stacked line 2}
\\
\framebox[5cm]{\pstrut stacked line 3}
\\
\shoveright\framebox[5cm]{\pstrut stacked line 4}
\>
It can also display one or several columns of aligned equations
analogous to the \amsmath/ environment family |align|:
\<
\framebox[1.0cm]{\pstrut 1a-L}\hskip-0.5pt&\framebox[3.0cm]{\pstrut 1a-R}
&
\framebox[1.5cm]{\pstrut 1b-L}\hskip-0.5pt&\framebox[3.5cm]{\pstrut 1b-R}
\\
\framebox[2.5cm]{\pstrut 2a-L}\hskip-0.5pt&\framebox[4.5cm]{\pstrut 2a-R}
&
&\framebox[2cm]{\pstrut 2b-R}
\\
&\framebox[4cm]{\pstrut 3a-R}
\>

\DescribeKey{single}
\DescribeKey{lines}
\DescribeKey{columns}
The three modes of operation
are selected by setting an optional argument as follows:
\begin{center}
\begin{tabular}{llll}
purpose & single-line equation & stacked equation(s) & aligned equations \\
\hline
name & |single| & |lines| & |columns| \\
alt.\ names & |equation|, |eq|, |1|
            & |gather|, |ga|, |ln|
            & |align|, |al|, |col| \\
symbolic   & |\[|\textvisiblespace\,\ldots|\]|
           & |\<=|\textvisiblespace\,\ldots|\>|
           & |\<|\textvisiblespace\,\ldots|\>| \\
\amsmath/ env. & |equation| & |gather|, |multline| & |align| \\
\hline
columns & --- & single & multiple, aligned \\
alignment & adjustable & adjustable & alternating right/left \\
parsing & single, direct & two passes & two passes \\
numbering & on/off & off/single/multiple & off/single/multiple \\
\end{tabular}
\end{center}
The aligned mode more or less encompasses all three modes,
and the stacked mode with only a single line
is more or less just a single equation.
However, the more complex forms also come along with some restrictions,
hence, it makes sense to use the appropriate mode
for the intended equation content.
For instance, a single equation simply reads the equation input once,
while the multi-line equation environments parse the environment body twice
which can potentially disrupt some other functionality
that is included in the body.
Furthermore, the horizontal adjustment options are very restricted
in aligned mode, and therefore the aligned form can automatically reduce
to the stacked form (with right alignment) if only a single column is provided
(no `|&|'s).

\begin{example}
\begin{scanexample}
\begin{equations}[single]
x=\cos\phi
\end{equations}
\end{scanexample}
\showexampleh
\begin{scanexample}
\begin{equations}[lines]
x=\cos\phi \\ \phi=\arccos x
\end{equations}
\end{scanexample}
\showexampleh
\begin{scanexample}
\begin{equations}[columns]
x&=\cos\phi & \phi&=\arccos x \\
 &=(z+z^{-1})/2 & &=-i\log z
\end{equations}
\end{scanexample}
\showexampleh
\end{example}

\DescribeInterfaceMacro{\\}
\DescribeInterfaceMacro{&}
As usual, lines are separated by `|\\|' and columns by `|&|'.
Note that `|\\|' admits some optional parameters:
\begin{center}
|\\|[|~|][|*|]|[|\textit{skip}|]|
\end{center}
The combination |[|\textit{skip}|]| introduces
additional glue between the lines;
the modifier `|*|' inhibits a page break,
and `|~|' indicates a continued equation
which suppresses punctuation (see \secref{sec:puctuation})
and defers numbering (see \secref{sec:numbering}).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Alternative Forms.}

\DescribeInterfaceMacro{\[...\string\]}
\DescribeInterfaceMacro{\<...\string\>}
The package offers several alternative names for the same mode as well as
a symbolic short form |\<|\ldots|\>| extending the \latex/
display equation form |\[|\ldots|\]| to multi-line equations.
\DescribeKey{=}
\DescribeKey{-}
\DescribeKey{\textvert}
An additional equal sign `|=|' in |\<=|\textvisiblespace\,\ldots|\>|
serves as a modifier character
which acts as a short form for the optional argument |lines|
selecting the lines mode.
Similarly, the modifiers minus `|-|' and bar `\textvert'
select single-line and columns mode, respectively.
\DescribeKey{sqropt}
\DescribeKey{angopt}
Both short forms can be customised
by setting default arguments via the global options
|sqropt={|\textit{opts}|}| and |angopt={|\textit{opts}|}|.
Both default arguments are preset to |nonumber|
which disables equation numbering, see \secref{sec:numbering}.

\begin{example}
\begin{scanexample}
\[
x=\cos\phi
\]
\end{scanexample}
\showexampleh
\begin{scanexample}
\<=
x=\cos\phi \\ \phi=\arccos x
\>
\end{scanexample}
\showexampleh
\begin{scanexample}
\<
x&=\cos\phi & \phi&=\arccos x \\
 &=(z+z^{-1})/2 & &=-i\log z
\>
\end{scanexample}
\showexampleh
\begin{scanexample}
\eqnlinesset{sqropt={donumber}}
\[ x=\cos\phi \]
\end{scanexample}
\showexampleh
\end{example}

\DescribeEnv{equation}
\DescribeEnv{gather}
\DescribeEnv{multline}
\DescribeEnv{align}
The package also supplies or overwrites the \amsmath/
environments |equation|, |gather|, |multline|, |align| and |flalign|
including their starred -|at| variants
(but not the |split| construction).
It is possible to define further equation environments \textit{env}
with a predefined set of options \textit{opts} using:
\begin{center}
|\|[|re|]|newenvironment{|\textit{env}|}|%
|{\eqnaddopt{|\textit{opts}|}\equations}{\endequations}|
\end{center}

\begin{example}
\begin{scanexample}
\begin{equation}
x=\cos\phi
\end{equation}
\end{scanexample}
\showexampleh
\begin{scanexample}
\begin{gather}
x=\cos\phi \\ \phi=\arccos x
\end{gather}
\end{scanexample}
\showexampleh
\begin{scanexample}
\begin{align}
x&=\cos\phi & \phi&=\arccos x \\
 &=(z+z^{-1})/2 & &=-i\log z
\end{align}
\end{scanexample}
\showexampleh
\begin{scanexample}
\newenvironment{eqnlist}
  {\eqnaddopt{lines,shape=left}\equations}
  {\endequations}
\begin{eqnlist}[nonumber]
x=\cos\phi \\ \phi=\arccos x
\end{eqnlist}
\end{scanexample}
\showexampleh[0.65]
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Transposition.}

\DescribeKey{transpose}
\DescribeKey{/}
When the aligned mode is used to produce more than one column of equations,
the default line-by-line ordering of the content may be inconvenient.
The package offers a transposition mode |transpose=plain| in which the content
is specified on a column-by-column basis. Columns are separated by `|\&|'
(the character `\&' must be escaped as `|{\&}|' in this mode)
and the lines within each column are broken by `|\\|' as usual.
The continued transposition mode |transpose=cont|
(abbreviated by the modifier `|/|')
furthermore reduces the input by assuming that all secondary
alignment markers `|&|' indicate a continued equation
and imply a line break with an empty left equation cell.
Note that the transposition is implemented by reprocessing the input,
which imposes some restrictions:
all line and column breaks `|\\|', `|\&|' must be explicit
(must not be produced by macro expansion),
line breaks should not use optional arguments
(they only work on the first column),
and each section separated by `|\&|'
should describe only a single column
with one alignment marker per line (unless in continued transposition mode).
Furthermore, the continued mode processes the alignment marker `|&|',
which may cause issues when nesting aligned content.

\begin{example}
\begin{scanexample}
\<[transpose=plain]
x &= \cos\phi \\ &= (z+z^{-1})/2
\&
\phi &= \arccos x \\ &= -i\log z
\>
\end{scanexample}
\showexampleh

\begin{scanexample}
\<[transpose=cont]
x &= \cos\phi &= (z+z^{-1})/2
\&
\phi &= \arccos x &= -i\log z
\>
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Numbering}
\label{sec:numbering}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Numbering Schemes.}

\DescribeKey{numberline}
\DescribeKey{n}
The package extends the established interface of \latex/
and the \amsmath/ package for labelling equations
with numbers or with manually assigned tags.
For multi-line equations, there are two distinct modes of operations:
individual labelling of the equation lines or
one overall number/tag for the whole block of equations.
The modes are selected by an optional argument
|numberline=|\textit{mode} (alternatively |nline| or just |n|)
as follows:
\begin{center}
\begin{tabular}{llll}
name     & alt. & description & preset \\
\hline
|all|    & |a|  & individual & all lines \\
|sub|    & |s|  & lines & subequations (a,\,b,\,c,\,\ldots) \\
\hline
|first|  & |f|  & & first line \\
|last|   & |l|  & & last line \\
|out|    & |o|  & & last/first line for right/left tags \\
|in|     & |i|  & single line & first/last line for right/left tags  \\
|middle| & |m*| & & middle line (rounded down/up for right/left tags) \\
|here|   & |h|  & & line indicated by |\numberhere| \\
|best|   & |+|  & & line with most available space \\
\hline
|top|      & |t|  & & at top \\
|bottom|   & |b|  & & at bottom \\
|center|   & |c|  & between & at vertical centre (single line at baseline) \\
|center!|  & |c!| & lines & at vertical centre (also single line) \\
|median|   & |m|  & & middle line (at baseline or between lines) \\
|center*|  & |c*| & & tag baseline centred between outer baselines \\
\hline
|multi|  & |@| & & individual lines, numbering on \\
|none|   & |-| & mode switch & individual lines, numbering off \\
|single| & |1| & & previous single-line mode, numbering on \\
\hline
|on|     & |!| & activation & turn numbering on \\
|off|    & |*| & & turn numbering off \\
\end{tabular}
\end{center}

\begin{example}
\eqnlinesset{evadetag=false}
\begin{scanexample}
\begin{equations}[!,numberline=...]
  x  &= \cos\phi  \\ &= (z+z^{-1})/2 \\
\phi &= \arccos x \\ &= -i\log z
\end{equations}
\end{scanexample}
\qquad\parbox{0.8\textwidth}{\printexample}
\par\medskip
\makebox[0.33\textwidth]{|all|:}\hfil
\makebox[0.33\textwidth]{|sub|:}\hfil
\makebox[0.33\textwidth]{|best|:}\par\nobreak\smallskip
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=all]
  x  &= \cos\phi  \\ &= (z+z^{-1})/2 \\
\phi &= \arccos x \\ &= -i\log z
\end{equations}
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=sub]
  x  &= \cos\phi  \\ &= (z+z^{-1})/2 \\
\phi &= \arccos x \\ &= -i\log z
\end{equations}
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=best]
  x  &= \cos\phi  \\ &= (z+z^{-1})/2 \\
\phi &= \arccos x \\ &= -i\log z
\end{equations}
\end{minipage}
\par\medskip
\makebox[0.33\textwidth]{|first|:}\hfil
\makebox[0.33\textwidth]{|last|:}\hfil
\makebox[0.33\textwidth]{|middle|:}\par\nobreak\smallskip
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=first]
  x  &= \cos\phi  \\ &= (z+z^{-1})/2 \\
\phi &= \arccos x \\ &= -i\log z
\end{equations}
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=last]
  x  &= \cos\phi  \\ &= (z+z^{-1})/2 \\
\phi &= \arccos x \\ &= -i\log z
\end{equations}
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=middle]
  x  &= \cos\phi  \\ &= (z+z^{-1})/2 \\
\phi &= \arccos x \\ &= -i\log z
\end{equations}
\end{minipage}
\par\medskip
\makebox[0.33\textwidth]{|top|:}\hfil
\makebox[0.33\textwidth]{|bottom|:}\hfil
\makebox[0.33\textwidth]{|center!|:}\par\nobreak\smallskip
\begin{minipage}{0.33\textwidth}
\[![numberline=top]
1+\frac{1}{\displaystyle 1+\frac{1}{\displaystyle 1+\ldots}}
\]
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\[![numberline=bottom]
1+\frac{1}{\displaystyle 1+\frac{1}{\displaystyle 1+\ldots}}
\]
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\[![numberline=center!]
1+\frac{1}{\displaystyle 1+\frac{1}{\displaystyle 1+\ldots}}
\]
\end{minipage}
\par\medskip
\makebox[0.33\textwidth]{|median|:}\hfil
\makebox[0.33\textwidth]{|center*|:}\hfil
\makebox[0.33\textwidth]{|center|:}\par\nobreak\smallskip
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=median]
 x &= -\int \sin\phi\,\mathrm{d}\phi \\
   &= \cos\phi
\end{equations}
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=center*]
 x &= -\int \sin\phi\,\mathrm{d}\phi \\
   &= \cos\phi
\end{equations}
\end{minipage}\vrule\hfil
\begin{minipage}{0.33\textwidth}
\begin{equations}[!,numberline=center]
 x &= -\int \sin\phi\,\mathrm{d}\phi \\
   &= \cos\phi
\end{equations}
\end{minipage}
\end{example}

\DescribeKey{evadetag}
Note that the mode |best| (line with most available space)
is activated automatically if the (single) tagged line
does not have sufficient space to hold the tag.
This feature can be controlled by the setting
|evadetag=|\textit{bool}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Activation and Selection.}

\DescribeInterfaceMacro{\nonumber}
\DescribeInterfaceMacro{\donumber}
Numbering can be turned on and off
(for individual lines or for the block as a whole depending on the mode)
by means of:
\begin{center}
|\nonumber|
\qquad and \qquad
|\donumber|
\end{center}
\DescribeKey{nonumber}
\DescribeKey{donumber}
\DescribeKey{number}
\DescribeKey{nn,*}
\DescribeKey{dn,!}
The numbering can be disabled or enabled for the block
by the keys |nonumber| or |donumber| (|nn|=`|*|' or |dn|=`|!|' for short)
or by |number=|\textit{bool} with \textit{bool}
either |on| or |off| (among several alternative forms).
Alternatively the number can be switched by using modifiers:
\begin{center}
|\[*|\textvisiblespace\,\ldots|\]|
\qquad and \qquad
|\[!|\textvisiblespace\,\ldots|\]|
\end{center}
This allows to define a default behaviour and specify exceptions
where they may occur.
The star modifier following directly the environment declaration
replaces the starred form of environments (|equation*|, etc.)
and there is no need to adjust the closing statement.

\DescribeInterfaceMacro{\numberhere}
\DescribeInterfaceMacro{\numbernext}
\DescribeInterfaceMacro{\\\string~}
The placement of a single number for an equation block can be adjusted by:
\begin{center}
|\numberhere|
\qquad and \qquad
|\numbernext|
\end{center}
The former macro overrides the position to the present line,
the latter macro defers the number to the next line.
For example, if an equation is broken into several lines
one may use the combination |\numbernext \\|
to assign the number to the last line.
Note that the modified newline `|\\~|' combines
|\numbernext| and |\\|

\begin{example}
\begin{scanexample}
\begin{equations}
   x &= \cos\phi \nonumber \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \nonumber \\
     &= -i\log z
\end{equations}
\end{scanexample}
\showexampleh
\begin{scanexample}
\begin{equations}*
   x &= \cos\phi \donumber \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \donumber \\
     &= -i\log z
\end{equations}
\end{scanexample}
\showexampleh
\begin{scanexample}
\eqnlinesset{numberline=last}
\<! x &= \cos\phi \\
 \phi &= \arccos x \>
\end{scanexample}
\showexampleh
\begin{scanexample}
\eqnlinesset{angopt=donumber}
\<* x &= \cos\phi \\
 \phi &= \arccos x \>
\end{scanexample}
\showexampleh
\begin{scanexample}
\begin{equations}
   x &= \cos\phi \numbernext \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \numbernext \\
     &= -i\log z
\end{equations}
\end{scanexample}
\showexampleh
\begin{scanexample}
\eqnlinesset{numberline=here}
\<!
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \numberhere \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh
\begin{scanexample}
\eqnlinesset{numberline=first}
\<!
   x &= \cos\phi \numbernext \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \numbernext \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Labels and Tags.}

\DescribeInterfaceMacro{\label}
\DescribeInterfaceMacro{\tag}
Equation numbers can receive \latex/ labels as usual,
and they can be turned into manually assigned tags
using the established macros:
\begin{center}
|\label[|\textit{name}|]{|\textit{label}|}|
\qquad and \qquad
|\tag|[|*|]|[|\textit{ref}|]{|\textit{tag}|}|
\end{center}
The optional parameter \textit{name} for |\label| assigns
a name to the label which can be referenced by |\nameref|.
A |\tag| replaces the equation number,
|\tag*| will drop the decoration by parentheses.
The optional parameter \textit{ref} for |\tag|
defines the representation of references by |\ref|.

Note that a label and a tag will always apply to the
next number that will be printed, and only a single label
and/or tag may be specified for it. For example, if the present line
has no numbering, but the following line does,
|\label| or |\tag| will apply to the following line.

The macros |\label| and |\tag|
can also be instructed to automatically enable numbering/tagging
for the present line or block via |\donumber|, see below.
By default, numbering/tagging is triggered for |\tag|,
but not for |\label| reflecting the behaviour set forth by \amsmath/.
By enabling triggering for |\label|, numbers will be produced
only if they have a chance of being referenced.

\DescribeKey{label}
\DescribeKey{tag}
\DescribeKey{labelname}
\DescribeKey{taglabel}
The |equations| environment provides an alternative means
to specify labels and tags within the optional arguments |[|\textit{opts}|]|
\begin{center}
|label={|\textit{label}|}|,
\qquad
|tag|[|*|]|={|\textit{tag}|}|,
\qquad
|labelname={|\textit{name}|}|,
\qquad
|taglabel={|\textit{ref}|}|,
\end{center}
\DescribeKey{@}
or via the modifier |@{|\textit{label}|}|:
\begin{center}
|\[@{|\textit{label}|}|\,\ldots|\]|
\end{center}
In particular, in subequations mode (|sub|),
the optional argument |label| can be used to assign
a label to the parent number addressing the whole equation block.

The above macros may also be used via the keys
|label|, |labelname|, |tag| and |taglabel|
of the interface |\eqncontrol|.

\DescribeInterfaceMacro{\eqref}
The macro |\eqref| is the standard method for referring
to equation numbers via their label.
This method also uses the layout defined below.
\begin{center}
|\eqref{|\textit{label}|}|.
\end{center}
\DescribeInterfaceMacro{\tagform}
\DescribeInterfaceMacro{\tagbox}
\DescribeInterfaceMacro{\tagboxed}
For custom typesetting,
|\tagform| encloses a number/tag with decoration,
|\tagbox| puts the decorated number in a box
and |\tagboxed| combines the two.

\DescribeKey{tagbox}
\DescribeKey{tagform}
The typesetting of equation numbers and tags passes through two macros,
one which defines the layout
and another one which adds a decoration by parentheses.
These two methods can be adjusted via the options:
\begin{center}
|tagbox|[|*|]|={|\textit{code}|}|
\quad and\quad
|tagform={|\textit{l}|{|\textit{code}|}|\textit{r}|}|
\quad or\quad
|tagform*={|\textit{code}|}|
\end{center}
Here, \textit{code} is some macro code
that references the argument `|#1|' containing the
number or tag, and \textit{l} and \textit{r}
can be opening and closing parentheses for the tag presentation.

The above setting may also be changed for individual lines
by the corresponding keys of the interface |\eqncontrol|.

\begin{example}
\begin{scanexample}
\eqnlinesset{tagform=[{#1}]}
\eqnlinesset{tagbox={\textcolor{blue}{#1}}}
\<[!,numberline=last]
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh[0.6]
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Horizontal Placement}
\label{sec:adjustment}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Overall Layout.}

\DescribeKey{layout}
\DescribeKey{center}
\DescribeKey{left}
First of all, the overall layout can be adjusted
between central and left alignment
via |layout=center|, |layout=left| or |center|, |left| for short.

\begin{example}
\begin{scanexample}
\<[layout=center]
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh[0.35]
\begin{scanexample}
\<[layout=left]
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh[0.35]
\end{example}

\DescribeKey{tags}
\DescribeKey{tagsright}
\DescribeKey{tagsleft}
Furthermore, numbers and/or tags may be placed
on the right or left margin
via |tags=right|, |tags=left| or |tagsright|, |tagsleft| for short.

\begin{example}
\begin{scanexample}
\<[tags=right]!
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh
\begin{scanexample}
\<[tags=left]!
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Margins.}

\DescribeKey{margin}
\DescribeKey{marginleft}
\DescribeKey{marginright}
\DescribeKey{linewidth}
For both layout choices,
the margins and line width of an equation block can be adjusted
by |margin|, |marginleft|, |marginright| or |linewidth|.
The equations and corresponding numbers or tags will be fit
within these bounds. This feature can be used within
lists or enumerations to undo an indentation.

\begin{example}
\def\indicate#1{%
  \framebox[\dimexpr\displaywidth-2\fboxsep-2\fboxrule\relax]{\mbox{#1}}}
\begin{scanexample}
\[ \indicate{line width} \]
\end{scanexample}
\showexampleh[0.5]
\begin{scanexample}
\[[margin=2em] \indicate{reduced} \]
\end{scanexample}
\showexampleh[0.5]
\begin{scanexample}
\begin{itemize}
\item first level
  \[ \indicate{default width} \]
  \[[marginleft=0pt]
    \indicate{full width} \]
\end{itemize}
\end{scanexample}
\showexampleh[0.5]
\end{example}

\DescribeKey{tagmargin}
\DescribeKey{tagmargin*}
\DescribeKey{tagmarginratio}
In central alignment layout, one can impose a tag margin
|tagmargin={|\textit{dimen}|}|
which allocates some space to the tag
such that equation content is centred in the remaining horizontal space.
The margin can also be set to the width of some text by
|tagmargin*={|\textit{text}|}| or it can be calculated
as the maximum width of tags by |tagmargin| without parameter (default).
The option |tagmarginratio={|\textit{ratio}|}|
uses the tag margin only for equation blocks
with a ratio of tags to rows above the given (decimal) ratio
(a value above 1 uses the tag margin only for single equations with tags;
default is |0.334|).
The option |tagmarginthreshold={|\textit{threshold}|}|
uses the tag margin only if the ratio of spacings would be below
the given (decimal) threshold (very much off balance;
default is |0.5|).
The latter two options together with some tag margin
can produce a more appealing layout for equation blocks of mixed filling.
In the following example, the former two equations are centred
on all horizontal space
while the latter two equations are centred on the space left of the tag
(the ratio of spacings without tag margin would be very small here):

\begin{example}
\begin{scanexample}
\eqnlinesset{tagmarginthreshold=0.7}
\[! \framebox[4em]{} \]
\[! \framebox[8em]{} \]
\[! \framebox[12em]{} \]
\[! \framebox[16em]{} \]
\end{scanexample}
\showexampleh
\end{example}

\DescribeKey{leftmargin}
\DescribeKey{leftmargin*}
\DescribeKey{minleftmargin}
\DescribeKey{maxleftmargin}
In left alignment layout, all equations are left aligned to a left margin
(|leftmargin| is initialised
to the first level of enumerations and itemisations).
It can be set to the width of some text by |leftmargin*={|\textit{text}|}|.
Depending on the situation, the left margin may be
reduced or extended to |minleftmargin| or |maxleftmargin|, respectively.

\begin{example}
\eqnlinesset{layout=left}
\begin{scanexample}
\eqnlinesset{layout=left}
\<
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh[0.35]
\begin{scanexample}
\<[tags=left,!]
   x &= \cos\phi \\
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\
     &= -i\log z
\>
\end{scanexample}
\showexampleh[0.35]
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Column Separation.}

\DescribeKey{fulllength}
\DescribeKey{mincolsep}
\DescribeKey{maxcolsep}
The horizontal alignment of columns is fixed for aligned multi-line equations:
Each pair of subsequent columns forms a unit which is aligned at the
intermediate alignment marker `|&|'.
These columns are distributed evenly over the available horizontal space.
Here, the outer space left and right of the set of columns
is treated on equal footing to the space between the columns
(option |fulllength=off|; default),
but it can be eliminated so that the outer columns
are pushed right to the margin (option |fulllength=on|).
A minimum and maximum column separation can be specified
via |mincolsep=|\textit{dimen} and |maxcolsep=|\textit{dimen}
(defaults are |2em| and |1em|)
or the maximum column separation can be disabled by |maxcolsep=off|
(which is implied by |fulllength=on|).

\begin{example}
\begin{scanexample}
\<[maxcolsep=2em]
 x &= \cos\phi     & \phi &= \arccos x \\
   &= (z+z^{-1})/2 &      &= -i\log z \>
\end{scanexample}
\showexamplev
\begin{scanexample}
\<[maxcolsep=off]
 x &= \cos\phi     & \phi &= \arccos x \\
   &= (z+z^{-1})/2 &      &= -i\log z \>
\end{scanexample}
\showexamplev
\begin{scanexample}
\<[fulllength]
 x &= \cos\phi     & \phi &= \arccos x \\
   &= (z+z^{-1})/2 &      &= -i\log z \>
\end{scanexample}
\showexamplev
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Alignment Schemes and Control.}

For stacks of equations including single equations,
there is just a single alignment column
whose horizontal alignment can be adjusted via a shape scheme or
by manually adjusting individual lines.
A shape scheme determines the horizontal alignment for each line
and it is specified by the optional argument
|shape=|\textit{mode} as follows:
\begin{center}
\begin{tabular}{llll}
name & alt. & shape & alignment \\
\hline
|default| & |def| & uniform & default\\
\hline
|left| & |l| & & left\\
|center| & |c| & uniform & central \\
|right| & |r| & & right \\
\hline
|first| & |indent|, |rc|  & first/rest & first line indented \\
|hanging| & |outdent|, |lc| & first/rest & first line hanging \\
|steps| & |lcr| & first/intermediate/last & left/centre\ldots centre/right\\
\end{tabular}
\end{center}
Note that the |steps| shape comes to use in the replacement \amsmath/
environment |multline|.

\begin{example}
\eqnlinesset{pad=2em}
\begin{scanexample}
\eqnlinesset{pad=2em}
\<=[shape=...] x = \cos\phi \\ x = (z+z^{-1})/2 \\
  \phi = \arccos x \\ \phi = -i\log z \>
\end{scanexample}
\qquad\parbox{0.8\textwidth}{\printexample}
\par\medskip
\makebox[0.33\textwidth]{|left|:}\hfil
\makebox[0.33\textwidth]{|center|:}\hfil
\makebox[0.33\textwidth]{|right|:}\par\nobreak\smallskip
\begin{minipage}{0.33\textwidth}
\<=[shape=left] x = \cos\phi \\ x = (z+z^{-1})/2 \\
  \phi = \arccos x \\ \phi = -i\log z \>
\end{minipage}\vrule\hfill
\begin{minipage}{0.33\textwidth}
\<=[shape=center] x = \cos\phi \\ x = (z+z^{-1})/2 \\
  \phi = \arccos x \\ \phi = -i\log z \>
\end{minipage}\vrule\hfill
\begin{minipage}{0.33\textwidth}
\<=[shape=right] x = \cos\phi \\ x = (z+z^{-1})/2 \\
  \phi = \arccos x \\ \phi = -i\log z \>
\end{minipage}
\par\medskip
\makebox[0.33\textwidth]{|first|:}\hfil
\makebox[0.33\textwidth]{|hanging|:}\hfil
\makebox[0.33\textwidth]{|steps|:}\par\nobreak\smallskip
\begin{minipage}{0.33\textwidth}
\<=[shape=first] x = \cos\phi \\ x = (z+z^{-1})/2 \\
  \phi = \arccos x \\ \phi = -i\log z \>
\end{minipage}\vrule
\begin{minipage}{0.33\textwidth}
\<=[shape=hanging] x = \cos\phi \\ x = (z+z^{-1})/2 \\
  \phi = \arccos x \\ \phi = -i\log z \>
\end{minipage}\vrule
\begin{minipage}{0.33\textwidth}
\<=[shape=steps] x = \cos\phi \\ x = (z+z^{-1})/2 \\
  \phi = \arccos x \\ \phi = -i\log z \>
\end{minipage}
\end{example}

\DescribeKey{align}
\DescribeKey{shiftto}
\DescribeKey{shiftby}
The alignment preset can be adjusted for individual lines by the controls:
\begin{center}
\begin{tabular}{l}
|\eqncontrol{align=left|\textvert|center|\textvert|right}|\\
|\eqncontrol{shiftto|\textvert|shiftby=|\textit{dimen}|}|
\end{tabular}
\end{center}
\DescribeInterfaceMacro{\shoveleft}
\DescribeInterfaceMacro{\shovecenter}
\DescribeInterfaceMacro{\shoveright}
or by the macros:
\begin{center}
|\shoveleft|\textvert|\shovecenter|\textvert|\shoveright|%
[|*|\textvert|!|\textvert|[|\textit{dimen}|]|],
\end{center}
In contradistinction to \amsmath/,
these macros can be placed anywhere within the cell
and they do not take the cell contents as their argument
(doing this here will disallow shrinking of glue towards reducing width).
The macros accept an optional argument |[|\textit{dimen}|]|
specifying a variable amount of shift.
\DescribeKey{indent}
They also accept the modifiers
`|*|' or `|!|' for indentation or hanging indentation by
the standard indentation amount (|indent|=|2em|).
\DescribeInterfaceMacro{\shoveby}
Furthermore, |\shoveby|[|*|]|{|\textit{dimen}|}|
shifts the line by the additional amount \textit{dimen}
(the star variant shifts to an absolute position
relative to the reference position).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Reference Positions.}

\DescribeKey{padding}
\DescribeKey{padleft}
\DescribeKey{padright}
The reference positions for left, right and central alignment
are determined as follows:
The central reference position marks the centre of
the available horizontal space.
The left and right reference positions are given
by the ends of the widest line placed centrally.
The latter can be adjusted by adding
some padding around the widest line via the optional argument
|padding|\textvert|padleft|\textvert|padright|[|={|\textit{dimen}|}|]
while preserving the central default position.
The value `|indent|' sets the padding to the default indentation amount
and `|max|' extends the padding to all available space.
Note that |indent*={|\textit{dimen}|}| sets the default indentation amount
and the left padding at the same time.

\begin{example}
\begin{scanexample}
\eqnlinesset{indent=2em,pad=5em}
\<=
\shoveleft   \framebox[5em]{left} \\
\shoveleft*  \framebox[5em]{indent} \\
\shovecenter \framebox[5em]{center} \\
\shoveright  \framebox[5em]{right}
\>
\end{scanexample}
\showexampleh[0.55]
\begin{scanexample}
\eqnlinesset{layout=left}
\eqnlinesset{leftmargin=2em}
\eqnlinesset{indent=2em}
\<=
\shoveleft! \framebox[5em]{outdent} \\
\shoveleft  \framebox[5em]{left} \\
\shoveleft* \framebox[5em]{indent} \\
\shoveright \framebox[5em]{right}
\>
\end{scanexample}
\showexampleh[0.55]
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Fitting.}

Finally, we note that the package will make attempts
at fitting the equation components into the horizontal space
by adjusting some dimensions
with the priority of avoiding overlong lines.
The adjustments will first concern the intercolumn and margin spacing.
Secondly, \tex/ will attempt to shrink the glue between symbols
for very wide single and stacked equations (but not aligned equations).
Finally, equation tags may be shifted out of the way vertically
in order to free up horizontal space.
If all attempts fail, overlong lines will be indicated.

\DescribeKey{alignshrink}
\DescribeKey{tagshrink}
\DescribeKey{alignbadness}
\DescribeKey{tagbadness}
The threshold for shrinking of glue can be controlled by the two parameters
|alignshrink| and |tagshrink| accepting values ranging
between |0| (no shrink) and |4| (full allowable shrink).
They are used towards determining
whether to shift away from the intended alignment position
or whether to raise or lower the equation tag, respectively.
Small values prevent shrinking and higher values allow for more compression.
The corresponding parameters |alignbadness| and |tagbadness|
accept integer values setting the
native threshold in \tex/'s native units of |\badness|.

\begin{example}
\begin{scanexample}
\<=!
x+x \\
x+x+x+x \\
x+x+x+x+x+x \\
x+x+x+x+x+x+x+x \\
x+x+x+x+x+x+x+x+x+x \\
x+x+x+x+x+x+x+x+x+x+x+x \\
\>
\end{scanexample}
\showexampleh[0.6]
\end{example}

\DescribeKey{mintagsep}
If the available space on a line does not suffice to place
both the equation and its tag
(with a minimum separation of |mintagsep|; default is |0.5em|),
a tag will automatically be shifted
(lowered or raised depending on whether it is placed on the right or left)
to an otherwise empty line.
\DescribeKey{shifttag}
\DescribeInterfaceMacro{\raisetag*}
The |\eqncontrol| control |shifttag=|\textit{dimen}
(alternatively |\raisetag*|) may be used to shift a tag up
(or down with negative arguments).
\DescribeKey{smashtag}
\DescribeInterfaceMacro{\raisetag}
The control |smashtag=|\textit{dimen} (alternatively |\raisetag|)
may be used to fine-tune the vertical placement
when the tag requires extra vertical space
but some space above or below the tag is unoccupied.
It smashes some of the tag's height (or depth with negative arguments)
and thus reduces the vertical gap created by the tag.
Note that this feature can be used successively
with positive and negative arguments
to reduce the space in both directions if available.
\DescribeKey{pushtag}
\DescribeInterfaceMacro{\raisetag!}
Where needed, the control |pushtag| (or |\raisetag!|)
force-pushes the tag to a separate line
and frees up the horizontal space occupied by the tag.
The numbering modes |top|, |bottom|,
|center|, |median|, |center!| and |center*|
are special in that they allow for a continuous vertical placement
of the tag between two lines.
\DescribeKey{tagbetween}
The more flexible placement of tags may
also be enabled for the single-lines modes
by the option |tagbetween|.
Here, both lines must have sufficiently much space available for the tag.
If not, the tag is shifted up or down or it is places on separate line
between the two.
\DescribeKey{tagsnap}
The option |tagsnap| defines a range
within which the tag baseline snaps to a nearby math baseline.

\begin{example}
\begin{scanexample}
\[! \phi = -\int \frac{\mathrm{d}x}{\sqrt{1+x^2}} \]
\end{scanexample}
\showexampleh[0.8]
\begin{scanexample}
\[! x = \frac{\partial}{\partial \phi}\sin\phi
    \raisetag{0.45\baselineskip} \]
\end{scanexample}
\showexampleh[0.85]
\begin{scanexample}
\<=![numberline=center] \raisetag*{2pt}
x+x+x+x+x+x+x+x \\
x+x+x+x+x+x+x+x \\
x+x+x+x+x+x+x+x \\
x+x+x+x+x+x+x+x
\>
\end{scanexample}
\showexampleh[0.6]
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Punctuation}
\label{sec:puctuation}

Extending proper punctuation across equations is a delicate matter,
and maintaining it while redacting the text
certainly takes more attention to detail
than many authors are willing to afford.
A contributing factor is that punctuation marks are harder
to spot alongside equation context and somewhat out of place anyway.

\DescribeInterfaceMacro{\eqnpunct}
\DescribeKey{punct}
The package supplies a semi-automatic scheme by which
equations are terminated by a specific punctuation mark.
\unskip\footnote{Clearly, the implementation of the scheme
will take higher efforts than direct coding.
Hence, the scheme can be useful in situations
where equations typically terminate phrases or
where punctuation is otherwise expected in regular patterns.}
Punctuation marks are set by:
\begin{center}
|\eqnlinesset{punct={|\textit{punct}|}}|
\qquad
|\eqnpunct{|\textit{punct}|}|
\qquad
|\[[punct={|\textit{punct}|}]|\,\ldots|\]|
\end{center}
The first form sets and enables a default punctuation mark;
the middle form sets the punctuation mark for the
next equation environment in line;
the final form applies to the equation environment only.
For example, one might globally declare `|punct={.}|'
to terminate all equations with a period `|.|'.
The default behaviour can be adjusted to a comma `|,|'
for an individual equation
by declaring `|\eqnpunct,|' before the equation
(i.e.\ at the end of the textual phrase to which the punctuation mark belongs),
at the end of the equation
or by using the optional argument |[punct={,}]|.
Likewise, |\eqnpunct{}|, |[punct=~]| or |[punct={}]|
eliminates a preset punctuation.
\DescribeKey{. , \string~}
The modifiers dot `|.|', comma `|,|' and tilde `|~|'
for the equations environment are short forms for
using a dot, a comma or disabling punctuation.

\begin{example}
\eqnlinesset{skip=6pt}
\begin{scanexample}
\eqnlinesset{punct=.}
The equation
\[ x = \cos\phi \eqnpunct{} \]
can also be written as
\eqnpunct,
\[ x = (z+z^{-1})/2 \]
where we assume
\[ z = \exp(i\phi) \]
\end{scanexample}
\showexampleh
\end{example}

\DescribeInterfaceMacro{\eqnpunctapply}
In situations, where the punctuation must appear before the end
of the block, e.g.\ before a ``QED'',
it can be invoked manually by |\eqnpunctapply|.

\DescribeKey{punctsep}
For convenience, one may also specify a desired space
(or any other code sequence) preceding the punctuation
by |[punctsep={|\textit{sep}|}]|,
e.g.\ \textit{sep}=|\,| or \textit{sep}=|\|\texttt{\textvisiblespace}.

\DescribeKey{punctcol}
\DescribeKey{punctline}
\DescribeKey{punctall}
\DescribeKey{`}
For multi-line equations, there are two further levels of default punctuation
for terminating columns and lines
which are specified via the option |punctcol| and |punctline|.
A punctuation item may also be handed on to the next lower level
of punctuation via the starred forms |punct*| and |punctline*|.
Several levels of punctuation can be specified simultaneously by |punctall|
or via the modifier `|`|':
\begin{center}
|punctall={|[[\textit{col}]\textit{line}]\textit{main}|}|
\qquad
|\[`{|[[\textit{col}]\textit{line}]\textit{main}|}|\,\ldots|\]|
\end{center}
The special value `|~|' represents no punctuation
and |\relax| hands down.
An empty argument for |punctall| or `|`|' removes all levels of punctuation.

\begin{example}
\begin{scanexample}
\<`{,;.}
   x &= \cos\phi &
\phi &= \arccos x \\
   x &= (z+z^{-1})/2 &
\phi &= -i\log z \>
\end{scanexample}
\showexampleh[0.4]
\end{example}

\DescribeInterfaceMacro{\\\string~}
Note that the modified newline command `|\\~|' describes a break
within a continued equation for which punctuation should be suppressed.
This option can be used to stack several independent continued equations.

\begin{example}
\begin{scanexample}
\<`{,.}
   x &= \cos\phi \\~
     &= (z+z^{-1})/2 \\
\phi &= \arccos x \\~
     &= -i\log z \>
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Math Classes at Alignment}
\label{sec:classes}

Alignment in multi-line equations breaks
equations into components before and after the alignment position.
Unfortunately, this also interrupts \tex/'s math spacing mechanism
which is based on the math classes assigned to the characters,
and there appears to be no direct way of determining the
math class to the previous letter.
Therefore, one has to make some assumptions
on the letters that will surround the alignment marker `|&|'
in order to obtain the appropriate spacing also across the alignment.

The \amsmath/ environment |align| assumes that
the left column ends with an ordinary character.
This leads to the correct spacing when an equation $a=b+c$
is broken before the equals relation as |a&=b+c|,
and also if an equation sequence continues on the next line as |\\&=d-e|.
However, it is difficult to achieve the right spacing
if the right-hand side is to be broken into several lines:
For instance, |\\&|\textvisiblespace|+f|
aligns the subordinate binary operation with the equals sign
(which may be undesirable).
Instead placing a phantom equals sign is an effort
that somewhat disrupts the readability of the code.

\DescribeKey{class}
\DescribeKey{ampeq}
\DescribeKey{eqamp}
The package implements a more flexible assignment of math classes
at the alignment. The above default behaviour is invoked by
the optional argument |class=ampeq| (or |ampeq| for short).
The optional argument |class=eqamp| (or |eqamp| for short)
imposes math classes at the alignment
such that an equation sign should be placed just before the alignment.
Concretely, it inserts |\mathrel{}| classes just before and after
the alignment marker. Furthermore, in case of an empty left alignment cell,
the leading math class is changed to |\mathord{}|
so that a following binary operator is not interpreted as a unary one.
For example, the following two expressions produce (almost) identical output:

\begin{example}
\begin{scanexample}
\<[class=ampeq]
a &= b+c \\
  &= d-e \\
  &\mathrel{}\phantom{=} +f
\>
\end{scanexample}
\showexampleh
\begin{scanexample}
\<[class=eqamp]
a =& b+c \\
  =& d-e \\
   & +f
\>
\end{scanexample}
\showexampleh
\end{example}

\DescribeKey{classout}
\DescribeKey{classin}
\DescribeKey{classlead}
Math classes just before and after alignment can be adjusted freely
by the optional arguments:
\begin{center}
|classout={|\textit{class}|}|,
\qquad
|classin={|\textit{class}|}|,
\qquad
|classlead={|\textit{class}|}|.
\end{center}
The parameter |classlead| alternatively |classin*|
determines the math class just after the alignment
if the cell before alignment is empty.
The spacing at the alignment is determined by the pairing
of the last/first character and the selected math class at the alignment:
\<[classin={},classout={},classlead={}]
\framebox[1em]{\bstrut}\ \framebox[1em]{\bstrut}\
\framebox[1em]{\bstrut a}\ \underline{\makebox[3em]{\itshape a-out}}
\ \vrule&
\ \underline{\makebox[3em]{\itshape in-b}}\ \framebox[1em]{\bstrut b}
\ \framebox[1em]{\bstrut}\ \framebox[1em]{\bstrut}
\\
\vrule&
\ \underline{\makebox[3em]{\itshape lead-c}}\ \framebox[1em]{\bstrut c}
\ \framebox[1em]{\bstrut}\ \framebox[1em]{\bstrut}
\>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Vertical Spacing}
\label{sec:vspace}

Display equations in \tex/ are considered to be part
of the surrounding paragraph of text.
Hence, the vertical spacing depends on the surrounding text,
in particular on the width and depth of the line of text
directly preceding the equation.
Due to this influence it can be difficult to manually adjust
the spacing accurately.
The package adds several options to control the vertical spacing,
and it also implements a uniform behaviour for all types of equations.

The spacing is determined by combination of several aspects:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Baselines.}

First, \tex/ inserts some glue between lines of text
to make them appear as regular as possible.
The amount of inserted glue is determined by \tex/'s rules
which depend on height, depth and intended baseline separation.
This interline spacing also applies to the lines of displayed equations
as well as the interfaces between text and displayed equations.

\DescribeKey{spread}
The spacing between the lines of a multi-line equation environment
can be adjusted via |spread={|\textit{dimen}|}|
which defaults to |\jot|$\equiv$|3pt| above the normal baseline skip.
\DescribeKey{strut}
\DescribeKey{strutdepth}
In addition, all equation lines and tags
are supplied with struts to ensure a minimum height and depth.
The latter behaviour is controlled by the switch |strut|
which takes the values `|on|' (default), `|cells|', `|tags|' or `|off|'.
The relative depth of such a strut is determined by |strutdepth|
(default |0.3|).

While the height/depth of text typically takes rather uniform values,
the height/depth of math content can range wildly with the context
(plain equations vs.\ fractions and matrices).
As displayed equations are normally surrounded by
a relatively large amount of glue,
it makes sense to reduce the dependency on the height/depth of math content.
Therefore, the package makes equation environments
appear to the surrounding text
as a line with a fixed height and depth,
and thus interline glue merely fills some potential gaps of the
surrounding text.
\DescribeKey{displayheight}
\DescribeKey{displaydepth}
The apparent height and depth are defined by
|displayheight| and |displaydepth|
which default to the dimensions of a strut.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Vertical Situation.}

Second, the spacing of display equations depends on the width
of the previous line of text.
If the math content fits well into the available horizontal space,
the display equation is called short
and less glue is needed above the equation.
The package implements this basic \tex/ feature
for all single- and multi-line equation environments.

\begin{example}
\begin{scanexample}
example of a long text line:
\[ \mbox{long mode} \]
vs.\ short:
\[ \mbox{short mode} \]
following line
\end{scanexample}
\showexampleh
\end{example}

\tex/ also reduces the amount of glue below short equations
(potentially to make their spacing appear more uniform).
\DescribeKey{shortmode}
The package allows to adjust the spacing for short equations
via the global option |shortmode=|\textit{mode}
where \textit{mode} takes the values:
\begin{center}
\begin{tabular}{lll}
\textit{mode} & reduced glue \\
\hline
|off| & disabled \\
|above| & above short equations (package default) \\
|belowone| & also below short single-line equations \\
|belowall| & also below all short multi-line equations \\
\end{tabular}
\end{center}
\DescribeKey{short}
\DescribeKey{long}
Short and long amounts of glue can also be enforced for
individual equation environments
via the optional arguments |short| and |long|
taking the values |above|, |below| or |both|.

\begin{example}
\begin{scanexample}
example of a long text line:
\[[short] \mbox{forced short} \]
and short:
\[[long] \mbox{forced long} \]
following line
\end{scanexample}
\showexampleh
\end{example}

There are three special situations |cont|, |par| and |top|
which trigger different spacings:
|cont| describes the situation
at the start of an empty horizontal list
(invoked by |\noindent|)
or when an equation block directly follows another one;
here, the space above the equation should be minimal
(or even negative to remove the space below the previous equation block).
|par| describes the situation at the beginning of a paragraph
(invoked by |\par|);
here, the space above the equation adds to the space between paragraphs.
|top| describes the situation at the top of a vertical list
(invoked by |\nointerlineskip|);
here, one would typically want no space.

\begin{example}
\eqnlinesset{belowtopmode=long}
\begin{scanexample}
\hrule\begin{minipage}{\linewidth}
\[ \mbox{top} \]
some text\par
\[ \mbox{par} \]
\[ \mbox{cont} \]
\end{minipage}\hrule
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Explicit Spacing.}

Third, the package provides several means to adjust the
glue around equations:

\DescribeKey{noskip}
\DescribeKey{medskip}
Next to |short| and |long| the spacing above and below
equation environments can be reduced
to some other fixed smaller amount via |medskip|
or removed altogether via |noskip|.
These keys also take the values |above|, |below| or |both|.

\begin{example}
\begin{scanexample}
\hrule
\[[long] \mbox{long default} \]
\hrule
\[[medskip] \mbox{medium space} \]
\hrule
\[[noskip] \mbox{no space} \]
\hrule
\end{scanexample}
\showexampleh
\end{example}

\DescribeKey{par}
By default, equation environments end in horizontal mode without indentation.
The key |par| controls whether
the equation environments end in horizontal mode as usual (value |cont|)
or in vertical mode (value |par|, default)
with a dedicated amount of glue |belowparskip|.
An environment can also be made to end in vertical mode
without interline skip (value |top|)
using the glue |belowtopskip|.
The key |par| can be used for situations when vertical mode is preferred,
e.g.\ for lists following equations
where the vertical space above the list is excessive.
In the following example,
|\hrule| will leave an empty line when not in vertical mode.

\begin{example}
\begin{scanexample}
\hrule some text
\[ \mbox{cont} \]
\hrule some text
\[[par] \mbox{par} \]
\hrule
\end{scanexample}
\showexampleh
\end{example}

\DescribeKey{...skip}
\DescribeInterfaceMacro{\vspace}
\DescribeKey{...space}
Variable amounts of skip can be set via
|aboveskip| and |belowskip| or |skip| for both simultaneously.
In addition, the package extends the |\vspace| mechanism
of \latex/ to equation bodies where it adds vertical space
below the next equation line or below the equation environment.
Additional glue can be added above or below equation environments
by means of the options |abovespace| and |belowspace|.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Glue Dimensions.}

The package also maintains several global vertical space settings
|above|\textit{pos}|skip| and |below|\textit{pos}|skip|
(sometimes \textit{pos}|skip| for both):
\DescribeKey{...skip}
\begin{center}
\begin{tabular}{lll}
\ldots\textit{pos}|skip| & both & description \\
\hline
|...long...|   & |longskip| & regular amount of glue \\
|...short...|  & -- & reduced glue for short equations \\
|...cont...|   & -- & glue when issued from an empty |\noindent| paragraph \\
|...par...|    & -- & glue when starting a paragraph (in vertical mode)\\
|...top...|    & -- & glue when issued at the top of vertical list \\
|...med...|    & |medskip| & medium amount of glue \\\hline
|...tag...|    & |tagskip| & minimum glue for outer raised/lowered tags \\
\end{tabular}
\end{center}
\DescribeKey{...mode}
The situations \textit{pos}=|cont|, |par| and |top|
use the respective amount of glue |above|\textit{pos}|skip|
above the equations and the regular amount of glue |belowlongskip| below.
These behaviours may be adjusted by the global options
|above|\textit{pos}|mode| and |below|\textit{pos}|mode|
with the values:
\begin{center}
\begin{tabular}{lll}
value & reduced glue \\
\hline
|long| & regular amount of glue \\
|short| & reduced glue for short equations \\
|cont| & amount for empty paragraph \\
|par| & amount for paragraph (and end the paragraph) \\
|top| & amount for top (and end the paragraph without interline skip) \\
|noskip| & no glue \\
|medskip| & medium amount of glue \\
\end{tabular}
\end{center}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Page Breaks.}

\DescribeKey{prebreak}
\DescribeKey{postbreak}
\DescribeKey{allowbreaks}
\DescribeKey{prepenalty}
\DescribeKey{postpenalty}
\DescribeKey{interpenalty}
\DescribeInterfaceMacro{\displaybreak}
Finally, the breaking of multi-line equations across pages
can be controlled as follows:
The setting |allowbreaks| (or |allowdisplaybreaks|)
taking values |0| (never) through |4| (permissive)
controls the permittivity of page breaks within multi-line equations.
The optional arguments |prebreak| and |postbreak|
taking values |0| (do not) through |4| (enforce)
suggest a break just above or below the equation environment.
The command |\displaybreak[|\textit{val}|]|
with values |0| through |4| (default)
suggests a break below the current line or below the equation environment.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Further Environments and Features}
\label{sec:further}

The package supplies some additional environments and features:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Equation Boxes.}

\DescribeEnv{equationsbox}
\DescribeInterfaceMacro{\<...\string\>}
The package provides a boxed equation environment |equationsbox|
which can be used within arbitrary math content.
It works analogously to |equations| including optional arguments
and modifiers, but it offers a reduced range of functionality
such as (evidently) no numbering
(yet, the |lines| mode accepts multiple columns here).
It can also be invoked by the symbolic short form |\<...\>|
when called within math mode.

\DescribeKey{top,t}
\DescribeKey{center,c}
\DescribeKey{bottom,b}
The equations box accepts several arguments:
|top|, |center|, |bottom| (or |t|, |c|, |b|)
specify the vertical alignment of the box.
\DescribeKey{margin}
\DescribeKey{marginleft}
\DescribeKey{marginright}
|margin|, |marginleft|, |marginright|
specify additional margin space around the equations box.
\DescribeKey{colsep}
|colsep| specifies the amount of separation between the columns.
\DescribeKey{frame}
\DescribeKey{wrap}
|frame|[|=|\textit{cmd}] encloses the equations box
by a \textit{cmd} such as |\fbox| which accepts one argument
(or a command sequence which ends with a macro accepting one argument).
|wrap={{|\textit{cmdl}|}{|\textit{cmdr}|}}|
surrounds the equations box by the two commands
\textit{cmdl} and \textit{cmdr}.

\begin{example}
\begin{scanexample}
\[ \left\{
\begin{equationsbox}[margin=1em]
   x &= \cos\phi \\
\phi &= \arccos x
\end{equationsbox}
\right\}\]
\end{scanexample}
\showexampleh

\begin{scanexample}
$\Longrightarrow\<=[shape=l,frame]
   x = \cos\phi &
\phi = \arccos x \\
   x = (z+z^{-1})/2 &
\phi = -i\log z
\>\Longleftarrow$
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Collective Numbering.}

\DescribeEnv{subequations}
\DescribeKey{subeqtemplate}
The environment |subequations| groups equations contained in the body
with a common primary equation number and an extra level
of numbering (typically: a,\,b,\,c,\,\ldots).
The numbering layout can be controlled via |subeqtemplate|.
For instance, the default behaviour of adding lowercase latin letters
to the parent equation number (|#1|)
is achieved by:
\begin{center}
|subeqtemplate={#1\alph{#2}}|
\end{center}

\begin{example}
\begin{scanexample}
\eqnlinesset
  {subeqtemplate={#1-\roman{#2}}}
\begin{subequations}
\[! x = \cos\phi \]
and
\[! \phi = \arccos x \]
\end{subequations}
\end{scanexample}
\showexampleh[0.55]
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Text Intermissions.}

\DescribeEnv{intertext}
\DescribeInterfaceMacro{\intertext}
The environment |intertext| (equivalently the macro |\intertext|)
injects a (short) line of text
into a multi-line equation while preserving the equation alignment
across the text.
The |intertext| environment must replace the
end-of-line marker `|\\|' between two lines of the equation
(to avoid blank lines).
The environment accepts several of the vertical spacing adjustments
as an optional argument.

\begin{example}
\begin{scanexample}
\< x &= \cos\phi
\intertext[medskip]{and}
\phi &= \arccos x \>
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Injection.}

\DescribeKey{inject}
\DescribeKey{inject*}
At a lower level, the control |\eqncontrol{inject={|\textit{cmd}|}}|
injects some command sequence \textit{cmd} after the present equation line
but before interline spacing.
The control |\eqncontrol{inject*={|\textit{cmd}|}}|
injects after interline spacing instead.

\begin{example}
\begin{scanexample}
\< x &= \cos\phi
\eqncontrol{inject=\hrule} \\
\phi &= \arccos x \>
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Line Marks.}

\DescribeKey{markline}
\DescribeKey{qed}
The package provides a mechanism to mark an equation line
at the end of the present line or just below.
This mechanism can be used to display a QED mark:
\begin{center}
\begin{tabular}{l}
|\eqncontrol{markline={symbol=|\textit{sym}|,|\textit{opts}|}|
\\
|\eqncontrol{qed|[|={|\textit{opts}|}|]|}|
\end{tabular}
\end{center}
The QED symbol may as well be invoked
by |\qedhere[|\textit{opts}|]| of \ctanpkg{amsthm}.
The starred variants |markline*|, |qed*| and |\qedhere*|
should be used for long lines
where the mark would otherwise smash equation content
(equation numbers are avoided automatically).

\begin{example}
\begin{scanexample}
\<[n=l]! x &= \cos\phi
\eqncontrol{markline={symbol=$\sqrt{}$}} \\
\phi &= \arccos x
\eqncontrol{qed={shift=.5ex}} \>
\end{scanexample}
\showexampleh[0.6]
\end{example}

The options \textit{opts} can be used
to adjust the placement
by |below| (placed on a separate line below the present line),
|baseline| (smashed at the current baseline),
|bottom| (smashed at the bottom of the present line),
to fine-tune the vertical position by |shift=|\textit{dimen}
or to adjust the symbol by |symbol=|\textit{sym}.
The default position and symbol can be adjusted by
the global settings |markpos|, |marksymbol| and |qedsymbol|.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Frames.}

\DescribeInterfaceMacro{\framecell}
\DescribeKey{framecell}
The package allows to frame cells of an equation block
via issuing a simple command within the cell:
\begin{center}
|\framecell[|\textit{cmd}|]|
\qquad or\qquad
|\eqncontrol{framecell|[|={|\textit{cmd}|}|]|}|
\end{center}
This command corresponds to |\Aboxed| of \ctanpkg{mathtools}.
In particular, when used within columns or aligned mode,
the frame will extend over both right and left alignment components
of a cell; in order to allocate the right amount of space,
it should be issued within the first cell of the pair.
The layout of the frame can be adjusted
by the optional argument \textit{cmd} which defaults to |\fbox|:
it must be a macro which accepts one argument
(or a command sequence which ends with a macro accepting one argument).
Note:
Any semi-automatic punctuation is included within the frame,
see \secref{sec:puctuation}.
Parts of a cell can be framed by the \amsmath/ macro |\boxed|,
which will not include semi-automatic punctuation.
Furthermore, the height and depth of the box are bounded from below
by a strut, see \secref{sec:vspace}.

\DescribeKey{frametag}
Similarly, the package allows to frame tags:
\begin{center}
|\eqncontrol{frametag|[|={|\textit{cmd}|}|]|}|
\end{center}

\begin{example}
\begin{scanexample}
\< x &= \cos\phi \\
\framecell \phi &= \arccos x \>
\end{scanexample}
\showexampleh[0.55]
\begin{scanexample}
\[ \framecell[\fboxrule2pt\fbox]
  \mbox{important} \eqnpunct! \]
\end{scanexample}
\showexampleh[0.55]
\begin{scanexample}
\[! \framecell[\fcolorbox{white}{yellow}]
  \eqncontrol{frametag=\fboxsep2pt\fbox}
  \mbox{highlight}\]
\end{scanexample}
\showexampleh[0.55]
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Single-Line Composition.}

\DescribeInterfaceMacro{\\}
\DescribeInterfaceMacro{\eqnbreak}
\DescribeInterfaceMacro{\eqnsep}
\DescribeInterfaceMacro{\eqnjoin}
Several short pieces of math content
may well fit within a single equation line,
typically separated by some amount of space like |\qquad| or |\qquad|.
The package provides several context-aware commands for this purpose:
the commands |\eqncol| and |\eqnbreak| insert some horizontal glue,
whereas |\eqnjoin| joins two parts of an equation with some conjunction.
The glue typically includes some amount of shrink
in order to accommodate the content when space is sparse.
Furthermore, |\eqncol| and |\eqnbreak| also automatically insert
the punctuation for columns and lines, respectively.
For convenience,
the newline command `|\\|' maps to |\eqnbreak|
in single equation mode where it serves no other purpose.
The commands have several optional arguments:
\begin{center}
|\eqnsep|\textbar|\eqnbreak|\textbar|\\|\,%
[|~|][|*|\textbar|[|\textit{skip}|]|]
\qquad
|\eqnjoin|[|*|\textbar|[|\textit{skip}|]|]|{|\textit{conjunction}|}|
\end{center}
The modifier `|~|' suppresses punctuation
and `|*|' chooses a shorter glue,
whereas the optional argument \textit{skip}
specifies the amount of glue explicitly.
\DescribeKey{linesep}
\DescribeKey{colsep}
The default amounts of glue for |\eqnbreak| or `|\\|' and |\eqncol|
are determined by the settings |linesep| and |colsep|, respectively.
The starred variants |linesep*| and |colsep*|
determine the short amount of glue.

\begin{example}
\begin{scanexample}
\[ x = \cos\phi \\[4em]
\phi = \arccos x \]
\end{scanexample}
\showexampleh
\begin{scanexample}
\[`{,.} x = (z+z^{-1})/2 \\
\phi = -i \log z \]
\end{scanexample}
\showexampleh
\begin{scanexample}
\[ x = \cos\phi \eqnjoin*{\iff}
\phi = \arccos x \]
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Alternative Content Description.}

\DescribeKey{alt}
\DescribeInterfaceMacro{\eqnalt}
The package provides a basic interface to describe the equation content
in an alternative form for the purposes of accessibility or documentation
(corresponding to the |alt| tag in HTML):
\begin{center}
|alt={|\textit{alt text}|}|
\qquad or \qquad
|\eqnalt[|\textit{opt}|]{|\textit{alt}|}|
\end{center}
At the moment the alternative text \textit{alt} is not processed further,
but an accessibility extension may implement the feature in tagged PDFs
or HTML conversion. The comma-separated optional arguments \textit{opt}
may specify the content further:
|line| and |cell| restrict the applicability
to the current equation line or cell, respectively.
Other keys might specify the content format and language.

\begin{example}
\begin{scanexample}
\<[alt={example equations}]
x &= \cos\phi \\
\eqnalt[line]{reverse relationship}
\phi &= \arccos x \>
\end{scanexample}
\showexampleh
\end{example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{General Options}
\label{sec:auxiliary}

\DescribeInterfaceMacro{\eqnlinesset}
Options of general nature can be selected by the commands:
\begin{center}
\begin{tabular}{rl}
&|\usepackage[|\textit{opts}|]{eqnlines}|
\\
or&|\PassOptionsToPackage{|\textit{opts}|}{eqnlines}|
\\
or&|\eqnlinesset{|\textit{opts}|}|
\end{tabular}
\end{center}
|\PassOptionsToPackage| must be used before |\usepackage|;
|\eqnlinesset| must be used afterwards.
\textit{opts} is a comma-separated list of options.

The package supplies the following general settings:
\begin{center}
\begin{tabular}{ll}
option & description \\
\hline
|defaults=classic|
  & mimic classic \latex//\amsmath/ (layout and dimensions) \\
|defaults=eqnlines|
  & \ctanpkg{eqnlines} layout with fontsize-relative dimensions \\
|rescan| & rescan environment body for special commands (e.g.\ |\verb|) \\
|linesfallback| & single column in align mode reverts to lines mode \\
                & value |reuse| avoids third measuring pass \\
|ampproof| & equip optional argument parsing with protection for `|&|' \\
|equationcr| & determine overloading of `|\\|' for single equations \\
             & |off|: native \latex/ error; |error|: package error; \\
             & |break|: insert horizontal glue (see \secref{sec:further}) \\
|modifierwarning| & invoke a warning for unknown environment modifiers \\
|scanpar| & allow scanning of |\par| within equation body \\
          & (e.g., for use in nested |\parbox| or |minipage|) \\
\end{tabular}
\end{center}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Feature Selection and Package Options}
\label{sec:features}

The following few settings can only be specified when loading the package,
not via |\eqnlinesset|:
\begin{center}
\begin{tabular}{ll}
option & description \\
\hline
|env=none| & provide only |equations| and |equationsbox| environments \\
|env=equation| & provide/overwrite |equation|,
                 |displaymath| and |\[|\ldots|\]| \\
|env=amsmath| & provide/overwrite \amsmath/ environments
                (including |equation|) \\
|amsmathends|=\textit{bool}  & patch \amsmath/ environments
                   with individual endings \\
|backup|=\textit{bool}  & backup original \amsmath/ environments
                   as |ams...| \\
|ang|=\textit{bool} & provide |\<|\ldots|\>| \\
|eqref|=\textit{bool} & provide |\eqref| \\
\end{tabular}
\end{center}

If the above settings are explicitly disabled, the package will only supply
the general purpose environment |equations|
and its boxed cousin |equationsbox|.
In that case, the specific equation environments and other features
can be activated by the command:
\begin{center}
|\eqnlinesprovide{|\textit{features}|}|
\end{center}
\textit{features} is a comma-separated list of features:
\begin{center}
\begin{tabular}{ll}
feature & description \\
\hline
\textit{env} & provide/overwrite environment \textit{env}:\\
& |equation|, |gather|, |multline|, |align|, |flalign| \\
& |multlined|, |gathered|, |aligned|, |subequations| \\
\textit{env}|=|\textit{name} &
   provide environment \textit{env} as \textit{name} \\
|sqr| & provide |\[|\ldots|\]| \\
|ang| & provide |\<|\ldots|\>| \\
|eqref| & provide/overwrite macro |eqref| \\
|tagform| & provide/overwrite macro |\tagform@|\\
|maketag| & provide/overwrite macro |\maketag@@@|\\
\end{tabular}
\end{center}

\iffalse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TODO
\subsection{List of Options}
\label{sec:options}

list:
EBSIGP (equations, box, subequations, intertext, global, package)
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Information}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Copyright}
\label{sec:copyright}

Copyright \copyright{} \thecopyright/

Based on the \latex/ package \amsmath/:
Copyright \copyright{}
1995, 2000, 2013 American Mathematical Society;
2016--2024 \latex/ Project and American Mathematical Society.

This work may be distributed and/or modified under the
conditions of the \latex/ Project Public License, either version 1.3
of this license or (at your option) any later version.
The latest version of this license is in
  \url{https://www.latex-project.org/lppl.txt}
and version 1.3c or later is part of all distributions of \latex/
version 2008 or later.

This work has the LPPL maintenance status `maintained'.

The Current Maintainer of this work is Niklas Beisert.

This work consists of the files |README.txt|, |eqnlines.ins| and |eqnlines.dtx|
as well as the derived files |eqnlines.sty|, |eqnlines-dev.sty|,
|eqnlines.tex|, |eqnlines.pdf|, |eqnlines-src.tex|, |eqnlines-src.pdf|.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Credits}
\label{sec:credits}

This package is based on the \latex/ package \amsmath/
(initially named \markpkg{amstex})
which in turn is based on the \tex/ macro system \ctanpkg{amstex}
written by Michael Spivak.
The initial work of porting \ctanpkg{amstex} to \latex/
was done in 1988--1989 by Frank Mittelbach and Rainer Sch\"opf.
In 1994 David M.\ Jones added the support for flush-left layout
and did extensive improvements to the align family of environments
and to the equation number handling in general.
Michael Downes at the AMS served as coordinator
for the efforts of Mittelbach, Sch\"opf, and Jones,
and has contributed various bug fixes and additional refinements over time.
Since 2016, the package has been maintained by the \latex/ Project
with contributions by the above and David Carlisle.

This package has been forked from \amsmath/
in accordance with the LPPL, particularly paragraph 6.
The original package \amsmath/ is available
at CTAN within \ctanpkg{latex-amsmath}.
It uses the basic mechanisms for processing
numbered multi-line equations as developed in \amsmath/
(environments |equation|, |align|, |gather|, |multline|, |gathered|, |aligned|
and related), as well as code implementing these mechanisms.
It differs from \amsmath/ in the following aspects:
\begin{itemize}
\item
The implementations of |split| and methods unrelated to multi-line equations
and equation numbering have been dropped.
\item
Code has been restructured, macros have been renamed and extended.
\item
Numbering and horizontal adjustment schemes have been unified and extended.
\item
Options for math classes surrounding the alignment have been added.
\item
A punctuation scheme has been added.
\item
Vertical spacing has been redesigned.
\item
Optional parameters have been added to environments.
\item
Various configuration options and layout settings have been added.
\item
Cooperation with \ctanpkg{hyperref}, \ctanpkg{showkeys}
and \amsmath/ has been included into the package.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Files and Installation}

The package consists of the files:
\begin{center}
\begin{tabular}{ll}
    |README.txt|       & readme file \\
    |eqnlines.ins|     & installation file \\
    |eqnlines.dtx|     & source file \\
    |eqnlines.sty|     & package file \\
    |eqnlines-dev.sty| & package file (development version) \\
    |eqnlines.pdf|     & manual
\end{tabular}
\end{center}
The distribution consists of the files
|README.txt|, |eqnlines.ins| and |eqnlines.dtx|.
\begin{itemize}
\item
Run (pdf)\latex/ on |eqnlines.dtx|
to compile the manual |eqnlines.pdf| (this file).
\item
Run \latex/ on |eqnlines.ins| to create the package |eqnlines.sty|
and the developers version |eqnlines-dev.sty|.
Copy the file |eqnlines.sty| to an appropriate directory of your \latex/
distribution, e.g.\ \textit{texmf-root}|/tex/latex/eqnlines|.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Related CTAN Packages}

The package is related to other packages available at CTAN:
\begin{itemize}
\item
This package uses the package \ctanpkg{keyval}
to process the options for the package, environments and macros.
Compatibility with the \ctanpkg{keyval} package
has been tested with v1.15 (2022/05/29).
\item
This package reproduces the math environments functionality
of the package \amsmath/.
The present code is based on \amsmath/ v2.17t (2024/11/05).
Compatibility with the \amsmath/ package is maintained
whether \ctanpkg{eqnlines} is loaded before or after \amsmath/.
By default, \ctanpkg{eqnlines} overwrites
most math environments of \amsmath/ with its own implementations.
It can also preserve them as |ams...| if needed.
Alternatively, \ctanpkg{eqnlines} may assign individual names
to the maths environments and preserve the ones of \amsmath/.
The other features provided by \amsmath/
can be used.
\item
The package \ctanpkg{mathtools}
is a popular extension of the \amsmath/ package.
This package incorporates some of the features and improvements
provided by the \ctanpkg{mathtools} package.
Compatibility with the \ctanpkg{mathtools} package
has been tested with v1.31 (2024/10/04),
and it is maintained whether \ctanpkg{eqnlines}
is loaded before or after \ctanpkg{mathtools}.
Some features like emphasising equations via \ctanpkg{empheq}
do not (yet) work.
\item
This package cooperates with the package \ctanpkg{hyperref}
to create anchors and references within the electronic document.
Compatibility with the \ctanpkg{hyperref} package
has been tested with v7.01l (2024/11/05).
\item
This package cooperates with the package \ctanpkg{beamer}
in assigning default colours for math content.
Compatibility with the \ctanpkg{beamer} package
has been tested with v3.74 (2025/06/15).
\item
This package supports the display of labels and references
through the package \ctanpkg{showkeys}.
Compatibility with the \ctanpkg{showkeys} package
has been tested with v3.21 (2024/05/23).
\item
This package supports placement of QED symbols within |proof|s
through the |\qedhere| interface of the package \ctanpkg{amsthm}.
Compatibility with the \ctanpkg{amsthm} package
has been tested with v2.20.6 (2020/05/29).
\item
This package is currently not compatible
with the package \ctanpkg{cleveref}
(thanks to Jon\'a\v s Dujava for pointing out).
The command |\Cref| will not refer properly to equation numbers
recorded by the |equations| environment.
Further features of either package and/or/in combination with \amsmath/
may fail due to the patching by the package.
The alternative package \ctanpkg{zref-clever} appears to work as intended.
Incompatibility with the \ctanpkg{cleveref} package
has been observed for v0.21.4 (2018/03/27).
Compatibility with the \ctanpkg{zref-clever} package
has been tested with v0.5.1 (2024/11/28).
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Feature Suggestions}

The following is a list of features for consideration
towards future versions of this package.
Their potential use may range between useful and niche;
and their difficulty between easy and impossible:
\begin{itemize}
\item
expand documentation further
\item
complete code documentation
\item
list of all option keys with scope, defaults and special values
\end{itemize}

\iffalse
Additional functionality:
\begin{itemize}
\item
alignment for columns mode (two columns as before)
\item
extended columns mode, allow alignment in lines mode
\item
reduce intercolumn space below zero if indentation permits
\item
single column compressible lines in columns mode
(determine alignment line first)
\item
flexible columns mode (note math classes, punctuation, intercolumn space)
\item
tool palette depending on mode (|\eqnsep|, |\eqnbreak|)
\end{itemize}

Fix or complete functionality:
\begin{itemize}
\item
|\vspace| for |equationsbox|?
\item
adjust PDF tagging with development in kernel,
describe functionality when ready
\item
|\intertext| might not collaborate correctly with PDF tagging
\end{itemize}

Some technical and/or internal items to be done include:
\begin{itemize}
\item
test files
\item
check documentation for all features
\item
|\eqnpunct| for odd fields in align?!
\item
change |\@ifpackageloaded| to |\IfPackageLoaded...|
when command is less recent.
\item
simplify |\advance| using |\dimexpr|, |\glueexpr|, |\numexpr|
\item
change bool registers to |char| 0 and 1 and |\||ifodd|
\end{itemize}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Revision History}

\iffalse

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{vN.N.N+:} 20YY/MM/NN

\begin{itemize}
\item
\ldots
\end{itemize}

\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.12.1:} 2025/12/28

\begin{itemize}
\item
fixed unwanted deferring of numbering when using |\\~| in continuous mode
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.12:} 2025/12/27

\begin{itemize}
\item
split off source code documentation into separate document |eqnlines-src|
\item
added modified newline `|\\~|` to indicate continued equation
with deferred numbering and punctuation suppressed
\item
added |\eqnsep|,  |\eqnbreak|, |\eqnjoin| for single-line compositions,
mapped `|\\|' for single equations to |\eqnbreak|
\item
added modifier `|`|' to |equationsbox|
\item
removed faulty option |crerror|
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.11:} 2025/10/25

\begin{itemize}
\item
added option |punctall| and modifier `|`|'
to specify several levels of punctuation at once
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.10.1:} 2025/06/23

\begin{itemize}
\item
fix for setting default colours (|math text|) in \ctanpkg{beamer}
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.10:} 2025/05/29

\begin{itemize}
\item
added |numberline| modes |center|, |median|, |top| and |bottom|
with continuous vertical adjustments
(thanks to Jon\'a\v s Dujava for testing)
\item
fixed spacing following |\paragraph|
(thanks to Jon\'a\v s Dujava for report)
\item
added control |inject| to add free-style content after the present line
\item
added control |markline| and |qed| to display a (QED) mark
\item
added support for \ctanpkg{amsthm} through |\qedhere|
(thanks to Jon\'a\v s Dujava for suggestion)
\item
fixed minor issues
\item
internal structure and minor interface changes
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.9:} 2025/05/18

\begin{itemize}
\item
option |transpose| to transpose rows and columns in columns mode
(thanks to Christophe Bal for suggestion)
\item
added |\eqncontrol| interface for control within lines and cells
\item
internal structure and interface changes
\item
added |\vspace*| for persistent glue at page breaks
\item
added framed tags (|frametag|)
\item
added |\raisetag!| to enforce raising (or lowering) of tags
even if space is sufficient
\item
added modifiers, relaxed order, changed lines mode modifier from `|~|' to `|=|'
\item
fixed minor issues
\item
thanks to Jon\'a\v s Dujava for various reports and suggestions
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.8:} 2025/04/30

\begin{itemize}
\item
added framed cells (|\framecell|)
\item
added automatic best line selection for tag placement
(|best| and |evadetag|)
\item
symbolic environment |\<...\>| forwards to |equationsbox| in math mode
\item
added wrapping for |equationsbox| (|frame|, |wrap|)
\item
horizontal adjustment reworked and completed; |\shoveby| added
\item
extended |\label| to assign names to labels for |\namedref|
\item
interface for alternative representations (|alt| and |\eqnalt|)
\item
options to adjust line width and margins
(|linewidth|, |marginleft|, |marginright|)
\item
added option |scanpar| to allow |\par| appearing in equation body
\item
added continuous penalties (|prepenalty|, |postpenalty|, |interpenalty|)
\item
added overloading for |displaymath| and remaining \amsmath/ math environments
\item
minor interface changes (rename, recombine, values)
\item
documentation expanded
\item
several issues fixed
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.7.1:} 2025/04/09

\begin{itemize}
\item
improvements for PDF tagging
\item
backup all available math environments at the start using |backup| switch
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.7:} 2025/04/03

\begin{itemize}
\item
manual expanded, examples added
\item
fixes for numbering, tagging, options, |linesfallback|, zero lines
\item
expansions for vertical spacing modes, tag display, |subeqtemplate|
\item
some consolidations
\item
internal rearrangements
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.6.1:} 2025/03/27

\begin{itemize}
\item
|\eqnpunct| can place punctuation within the current equation cell
\item
|numberline=none| now acts as |numberline=all| and |nonumber|
\item
fixed and extended |tagmargin|
with |tagmarginratio| and |tagmarginthreshold|
\item
padding now applies to single-line equations as well
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.6:} 2025/03/11

\begin{itemize}
\item
preliminary PDF tagging support
(\url{https://latex3.github.io/tagging-project/};
\amsmath/ \emph{must} be loaded \emph{before} \ctanpkg{eqnlines}
to avoid errors
\item
classic \latex//\amsmath/ vs.\ \ctanpkg{eqnlines} presets
\item
changed vertical spacing schemes and added further options
\item
supplied dimensions processed by |\glueexpr|
\item
more independent of \amsmath/ structures
\item
internal reorganisations
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v0.5:} 2025/02/25

\begin{itemize}
\item
preview version published on CTAN
\item
thanks to Till Bargheer for testing and reports
\end{itemize}


\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput
%%
%% End of file `eqnlines.tex'.
