diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/mh/breqn-technotes.tex')
-rw-r--r-- | Master/texmf-dist/source/latex/mh/breqn-technotes.tex | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/mh/breqn-technotes.tex b/Master/texmf-dist/source/latex/mh/breqn-technotes.tex new file mode 100644 index 00000000000..e8c6174cbbf --- /dev/null +++ b/Master/texmf-dist/source/latex/mh/breqn-technotes.tex @@ -0,0 +1,145 @@ +\documentclass{article} +\usepackage{lmodern} +\usepackage[T1]{fontenc} +\usepackage{breqn} +\def\eqnumside{L} +\providecommand*\cs[1]{\texttt{\textbackslash#1}} + +\usepackage{hyperref} + +\title{Technical notes on equation breaking} +\author{Michael J.\ Downes \and Morten H\o gholm} +\begin{document} + +\maketitle + + +\section{Tag placement} + +The method used by the breqn package to place the equation number is +rather more complicated than you might think, and the whole reason is +to allow the number to stay properly centered on the total height even +when the height fluctuates due to stretching or shrinking of the page. + + +Consider the following equation: +\begin{dmath}[number={3.15}] + N_{0} \simeq \left( \frac{\nu}{\lVert u\rVert_{H^{i}}} \right) + \lvert I\rvert^{-1/2} +\end{dmath} +It will have only one line, if the column width is not too narrow. + +Scrutinizing the vertical list will shed light on some of the basic properties +shared by all breqn equations. After that we will look at what would happen if +two or more lines were needed. The numbers added on the left in the following +\cs{showlists} output mark the points of interest. +\begin{verbatim} +[1] \penalty 10000 + \glue(\abovedisplayskip) 0.0 + \penalty 10000 + \glue(\belowdisplayskip) 0.0 +[2] \glue 4.0 plus 4.0 + \glue(\lineskip) 1.0 +[3] \vbox(16.53902+0.0)x0.0, glue set 16.53902fil + .\glue 0.0 plus 1.0fil minus 1.0fil + \penalty 10000 +[4] \glue -8.51945 +[5] \hbox(7.5+2.5)x25.55563 + .\OT1/cmr/m/n/10 ( + .\OT1/cmr/m/n/10 3 + .\OT1/cmr/m/n/10 . + .\OT1/cmr/m/n/10 1 + .\OT1/cmr/m/n/10 5 + .\kern 0.0 + .\OT1/cmr/m/n/10 ) + \penalty 10000 +[6] \glue(\parskip) -18.01956 +[7] \hbox(16.53902+9.50012)x360.0, glue set 1.78647 +\end{verbatim} +\begin{enumerate} +\item These four lines are a hidden display structure from \TeX's + primitive \texttt{\$\$} mechanism. It is used only to get the value + of \cs{predisplaysize} so that we can later calculate by hand + whether to use the short display skips or the regular ones. (The + reason that we have to do it by hand traces back to the fact that + \TeX\ 3.x does not allow unhboxing in math mode.) The penalties come + from \cs{predisplaypenalty} and \cs{postdisplaypenalty}, which were + locally set to 10000 to ensure there would be no unintended page + breaks at these glue nodes. + +\item These two glue nodes are the ones that would normally have been + produced at the top of a display; the first one is the above-display + skip node (though we had to put it in by hand with \cs{vskip}) and + the second one is the usual baselineskip/lineskip node. + +\item This is a dummy copy of the equation's first line, which is + thrown in here to get the proper value of baselineskip (or lineskip + in this case). Why do we need this? Because this ensures that we get + the top spacing right before we fiddle with the glue nodes + surrounding the equation number. And if the equation has a frame, + this box is a good place to add it from. + +\item This is a special glue node that brings us to the right vertical + position for adding the equation number. Its value is calculated + from the variables that you would expect, given the presence of the + dummy first line above the num- ber: starting position of the + equation, height of first line, total height of equation body. If + the equation body had more than one line, with stretchable glue + between the lines, half of the stretch would be added in this glue + node. + +\item The hbox containing the equation number. + +\item Backspace to bring the equation body to the right starting point. We use + \cs{parskip} to put this glue in place because we're going to get a + parskip node here in any case when we add the equation body with (in + essence). If we didn't do this we'd get two glue nodes instead of + one, to no purpose. + +\cs{\noindent} \cs{unhbox}\cs{EQ@box}. + + +\item And lastly we see here the first line of the equation body, + which appears to have height 16.5pt and depth 9.5pt. +\end{enumerate} + +For comparison, the vertical list produced from the above equation in +standard \LaTeX\ would look like this, if the same values of +columnwidth and abovedisplayskip are used: +\begin{verbatim} +[1] \penalty 10000 +[2] \glue(\abovedisplayskip) 4.0 plus 4.0 + \glue(\lineskip) 1.0 + \hbox(16.53902+9.50012)x232.94844 +[3] .\hbox(7.5+2.5)x25.55563 + ..\hbox(7.5+2.5)x25.55563 + ...\OT1/cmr/m/n/10 ( + ...\OT1/cmr/m/n/10 3 + ...\OT1/cmr/m/n/10 . + ...\OT1/cmr/m/n/10 1 + ...\OT1/cmr/m/n/10 5 + ...\kern 0.0 + ...\OT1/cmr/m/n/10 ) + .\kern101.49591 +[4] .\hbox(16.53902+9.50012)x105.8969 + ... +[5] \penalty 0 +[6] \glue(\belowdisplayskip) 4.0 plus 4.0 + \glue(\lineskip) 1.0 + \hbox(6.94444+1.94444)x345.0, glue set 62.1106fil +\end{verbatim} + +\begin{enumerate} + \item \cs{predisplaypenalty} + \item \cs{abovedisplayskip} + \item equation number box + \item equation body + \item \cs{postdisplaypenaltly} + \item \cs{belowdisplayskip} +\end{enumerate} + + + + + +\end{document}
\ No newline at end of file |