From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/dotseqn/dotseqn.dtx | 326 +++++++++++++++++++++++++++++++ macros/latex/contrib/dotseqn/dotseqn.pdf | Bin 0 -> 140008 bytes macros/latex/contrib/dotseqn/readme | 1 + 3 files changed, 327 insertions(+) create mode 100644 macros/latex/contrib/dotseqn/dotseqn.dtx create mode 100644 macros/latex/contrib/dotseqn/dotseqn.pdf create mode 100644 macros/latex/contrib/dotseqn/readme (limited to 'macros/latex/contrib/dotseqn') diff --git a/macros/latex/contrib/dotseqn/dotseqn.dtx b/macros/latex/contrib/dotseqn/dotseqn.dtx new file mode 100644 index 0000000000..ee3f057539 --- /dev/null +++ b/macros/latex/contrib/dotseqn/dotseqn.dtx @@ -0,0 +1,326 @@ +% \iffalse +% +% D O T S E Q N . D T X ver 1.1 +% +% Copyright (C) 1995 by Donald Arseneau +% This file may be freely transmitted and reproduced, but it may +% not be changed unless the name is changed also (except that you +% may freely change the paper-size option for \documentclass). +% This notice must be left intact. +% +%\NeedsTeXFormat{LaTeX2e} +%<*dtx> +\ProvidesFile{dotseqn.dtx} +% +%\ProvidesPackage{dotseqn} +%\ProvidesFile{dotseqn.drv} + [1995/03/22 v1.1 \space Dots leading to equation numbers] +%<*driver> +\makeatletter +\typein[\answer]{Do you want to generate dotseqn.sty? (Yes/No)} +\edef\answer{`\expandafter\@car\answer N\@nil} +\ifodd\answer +\begin{filecontents}{dotseqn.ins} +% dotseqn.ins: This is a temporary file. You can delete it. +\keepsilent +\preamble + +D O T S E Q N . S T Y is Copyright (c) 1995 by Donald Arseneau + +This file may be freely transmitted and reproduced, but it may not be +changed unless the name is changed also. This notice must remain intact. + +\endpreamble +\generateFile{dotseqn.sty}{t}{\from{dotseqn.dtx}{package}} +\Msg{ } +\Msg{You should now copy dotseqn.sty to a directory where LaTeX checks for} +\Msg{input files. \space Run LaTeX again to generate documentation.} +\Msg{ }\endinput +\end{filecontents} +\makeatletter \closein\@inputcheck % because a bug in LaTeX +\def\batchfile{dotseqn.ins} +\csname fi\endcsname\input docstrip.tex % avoid unbalanced if +\fi +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + \documentclass{ltxdoc} +% +% \documentclass[a4paper]{ltxdoc} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\typeout{Generating user documentation for the dotseqn package.} +\typein[\answer]{Do you also want a commented source listing? (Yes/No)} +\edef\answer{`\expandafter\@car\answer N\@nil} +\ifodd\answer \else \OnlyDescription \fi +\DisableCrossrefs +\providecommand{\Lenv}[1]{\textsf{#1}} +\providecommand{\Lopt}[1]{\textsf{#1}} +\providecommand{\pkg}[1]{\texttt{#1}} +\setlength\hfuzz{2pt} +\begin{document} +\DocInput{dotseqn.dtx} +\end{document} +% +% \fi +% \CheckSum{211} +% \GetFileInfo{dotseqn.dtx} +% \renewcommand\baselinestretch{1.13} +% \title{DOTSEQN: Flush-left equations with dotted leaders to the +% equation number} +% \author{Donald Arseneau} +% \date{version \fileversion, revised \filedate} +% \maketitle +% +% \section{Introduction} +% +% The \Lopt{dotseqn} package provides a different format for typesetting +% equations, one reportedly used in `old style Britsh books'~-- equations +% aligned on the left, with dots on the right leading to the equation +% number. Like this +% \begin{itemize} +% \item[]$\displaystyle x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}$\leaders +% \hbox{\kern4pt.\kern4pt}\hfill(1) +% \end{itemize} +% \iffalse +% ! Of course you should type equations normally! +% ! I cheated here so that this documentation could +% ! be printed *without* installing dotseqn.sty. +% \fi +% Equations without numbers have no leaders. +% +% This package behaves a lot like \Lopt{fleqn} (so that option is +% superfluous). In particular, the equations are not centered, but +% indented a constant distance from the left margin, controlled by +% \cs{mathindent}. The default indentation is the same as for lists. +% +% \section{Affected environments} +% +% Math environments with equation numbers, \Lenv{equation} and +% \Lenv{eqnarray}, are changed to produce left-justified equations, +% and to draw dotted leaders between the equation and the equation +% number. If there is no number, as specified by \cs{nonumber}, +% then no leaders are drawn. +% +% Other math environments~-- \Lenv{displaymath}, \Lenv{eqnarray$*$}, +% and |\[|~\dots\,|\]| -- do not produce equation numbers and therefore +% behave the same as they do under the \Lopt{fleqn} document option. +% +% \section{Options} +% +% This package is very similar to the \Lopt{fleqn} document class option, +% so specifying \Lopt{fleqn} is superfluous. The \Lopt{leqno} class +% option is forbidden because it is incompatible with the dotted style +% of equation labeling. (Where would the leaders go?) +% As is the case for the ordinary \Lopt{fleqn} option, the equation +% indentation is controlled by the length \cs{mathindent}, with a default +% indentation equal to the indentation of lists. It can be changed in +% the document preamble (with \cs{setlength}). Reasonable alternatives +% are zero (|0pt|) or the paragraph indentation (\cs{parindent}). +% +% The \pkg{dotseqn} package has two options of its own which can be +% specified with the \cs{usepackage} command. The \Lopt{leftjust} option +% causes the first column in \Lenv{eqnarray} and \Lenv{eqnarray$*$} +% to be flush left. Ordinarily, these pieces are flush right against +% the middle column. +% +% Another option is \Lopt{nocolsep}, which gets rid of that (ridiculous) +% extra space in the second column of \Lenv{eqnarray} equal to twice +% \cs{arraycolsep}. I would prefer to make \Lopt{nocolsep} the default, +% but it seems best that the normal behavior agrees with the usual +% documented behavior of \LaTeX. +% +% This typeset documentation was generated by running \LaTeX\ on +% |dotseqn.dtx|, and |dotseqn.sty| is generated the same way. This +% is my experiment with single-file |dtx| distribution. +% +% \StopEventually{} +% +% \section{The implementation} +% +% \iffalse +%<*package> +% \fi +% +% \begin{macro}{\EqnDots} +% The definitions here are based closely on the class option \Lopt{fleqn}. +% The principal difference is that dotted leaders are used to replace +% some horizontal filling commands. The leaders are given by the fairly +% typical \cs{leaders} command: +% \begin{macrocode} +\newcommand\EqnDots{\leaders\hbox{\kern4\p@ .\kern4\p@}\hfill} +% \end{macrocode} +% which can be changed by the intrepid document designer. +% \end{macro} +% +% \begin{macro}{\mathindent} +% Imitating the definitions for \pkg{fleqn}, we define a math indentation, +% but only if it is not defined already, and set the default indentation +% equal to the outer-level list indentation. +% \begin{macrocode} +\@ifundefined{mathindent}{\newdimen\mathindent \mathindent\leftmargini}{} +% \end{macrocode} +% The implementation in \pkg{fleqn.clo} is complicated by the need +% to delay assigning the default value to \cs{mathindent}, but that is +% not necessary here because packages like this are processed after the +% document class is fully declared. +% \end{macro} +% \begin{environment}{displaymath} +% \begin{macro}{\[} +% The environment \Lenv{displaymath}, alias |\[|~\dots\,|\]|, is +% identical with its definition in \pkg{fleqn.clo}. First the beginning +% \begin{macrocode} +\renewcommand{\[}{\relax \ifmmode\@badmath \else + \begin{trivlist}% + \@beginparpenalty\predisplaypenalty \@endparpenalty\postdisplaypenalty + \item[]\leavevmode \hbox to\linewidth\bgroup $\m@th\displaystyle %$ + \hskip\mathindent\bgroup + \fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\]} +% \dots and then the |\end{displaymath}| or |\]| +% \begin{macrocode} +\renewcommand{\]}{\relax\ifmmode \egroup $\hfil% $ + \egroup \end{trivlist}% + \else \@badmath \fi} +% \end{macrocode} +% \end{macro} +% \end{environment} +% +% \begin{environment}{equation} +% The \Lenv{equation} environment begins exactly the same was as in +% \pkg{fleqn}, but it ends using \cs{EqnDots} in place of \cs{hfil}. +% \begin{macrocode} +\renewenvironment{equation}% + {\@beginparpenalty\predisplaypenalty \@endparpenalty\postdisplaypenalty + \refstepcounter{equation}\trivlist \item[]\leavevmode + \hbox to\linewidth\bgroup $\m@th% $ + \displaystyle \hskip\mathindent}% + {$\EqnDots % $ Replace `\hfil' with dotted leaders `\EqnDots'. + \displaywidth\linewidth\hbox{\@eqnnum}\egroup \endtrivlist} +% \end{macrocode} +% The \Lenv{equation$*$} environment need not be redefined because it +% is defined in terms of \Lenv{equation}, and it has no equation number +% so it needs no \cs{EqnDots}. +% \end{environment} +% +% \begin{environment}{eqnarray} +% The \Lenv{eqnarray} environment has the most changes. In order to make +% the leaders fill the width, the space between the equation and the +% equation number must be part of a column entry; it cannot be filled by +% tabskip glue. Thus, this redefinition has one fewer column~-- there is +% no separate column for the equation number! This also necessitates +% a changed definition for |\\|, so see \cs{@@eqncr} below. As yet, +% \Lenv{eqnarray} is not described in detail in \pkg{classes.dtx}, but +% there are some useful comments in \pkg{ltmath.dtx}. They are reproduced +% here: +% +% \begin{quotation} +% To get a proper \cs{@currentlabel} we have to redefine it for the +% whole display. Note that we can't use \cs{refstepcounter} as this +% results in \cs{@currentlabel} getting [frozen at the beginning] and +% thus always writing the first label to the \texttt{.aux} file. +% Default is for left-hand side of equations to be flushright. +% To make them flushleft, |\let\@eqnsel = \hfil| +% [this is just what the \Lopt{leftjust} option does]. +% \end{quotation} +% +% \noindent In further explanation, I should add that the counter +% \cs{@eqcnt} is globally set in each of the columns so that |\\| +% will know how many column separators (|&|) to insert before the +% equation number. This redefined version has only 3 alignment columns, +% so this insertion is modified (in \cs{@@eqncr}). In the third and +% final column, after the math material, there is a confusing +% |\hskip\@centering|. In fact, this has no effect when an +% equation number is present, because the \cs{EqnDots} are infinitely +% more stretchable, but the \cs{hskip} is left in place for the case +% of \cs{nonumber} which needs some filling. +% +% So, in the absence of tabskip glue, how is the equation forced out +% to the full line width? Using \ |\halign to\linewidth|' \ will not +% work because it only stretches \cs{tabskip} glue. The original +% \ |\halign to\linewidth| \ is retained only to give overfull box +% warnings when an alignment is too wide for the page. To stretch +% the third coulumn out to the full line width, a blank row is added +% at the end of the alignment by |\end{eqnarray}|, with a single entry +% spanning the full line width. This makes use of an often annoying +% behavior of \TeX: when multiple columns need to be enlarged to match +% a spanning entry, all the extra space is added to the final column. +% The extra `phantom' row uses a negative \cs{vskip} and a strut with +% a depth given by \cs{prevdepth} to simulate the depth of the expected +% last line in the equation array. A temporary macro is used to preserve +% the value of \cs{prevdepth} and use it after an end-of-group. +% +% A special command `\cs{DEQ@acs}' surrounds the entry for the second +% column. Ordinarily this gives |\hskip 2\arraycolsep|, but with the +% \Lopt{nocolsep} option it gives |\null| (like~|\mbox{}|), which produces +% the natural math-mode spacing around the entry. +% \begin{macrocode} +\renewenvironment{eqnarray}{% + \stepcounter{equation}% + \def\@currentlabel{\p@equation\theequation}% + \global\@eqnswtrue \m@th \global\@eqcnt\z@ \tabskip\mathindent + \let\\\@eqncr \setlength\abovedisplayskip\topsep + \ifvmode \addtolength\abovedisplayskip\partopsep \fi + \addtolength\abovedisplayskip\parskip + \setlength\belowdisplayskip\abovedisplayskip + \setlength\belowdisplayshortskip\abovedisplayskip + \setlength\abovedisplayshortskip\abovedisplayskip + $$\everycr{}\halign to\linewidth% $$ + \bgroup + \hskip\@centering + $\displaystyle\tabskip\z@skip{##}$\@eqnsel&% + \global\@eqcnt\@ne \hfil${\DEQ@acs##\DEQ@acs}$\hfil&% + \global\@eqcnt\tw@ $\displaystyle{##}$\hskip\@centering\cr% + }% end of "\begin" part + {\@@eqncr + \noalign{% vertical skip up to overlay phantom line + \penalty\@M \vskip-\prevdepth + \edef\@tempa{\omit\span\omit\span\omit % span three columns + \vrule\@depth\the\prevdepth \@width\z@ % strut of proper depth + \kern-\mathindent \kern\linewidth}% % full line width + \nointerlineskip \expandafter % use saved |\@tempa| outside group + }\@tempa\cr + \egroup + \global\advance\c@equation\m@ne$$% $$ + \global\@ignoretrue + } +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\@@eqncr} +% Now the \cs{@@eqncr} macro (alias |\\|) needs redefining. The +% number of inserted |&| separators is reduced, the warning is +% removed because it is quite proper to already be in the last column, +% and the placement of the equation number is changed: instead +% of letting the \cs{halign} template do the spacing, \cs{@@eqncr} +% leaves math mode, inserts the leaders, typesets the equation number +% (using \cs{@eqnnum}), then begins math mode again so things will +% balance when the template tries to end math. Note: \cs{reserved@a} +% is set to something innocuous before \cs{ifcase} just in case it +% was let equal to something like \cs{fi}. +% \begin{macrocode} +\def\@@eqncr{\let\reserved@a\@empty + \ifcase\@eqcnt \def\reserved@a{& &}\or \def\reserved@a{&}\fi + \reserved@a + \if@eqnsw \egroup $\EqnDots \@eqnnum $\bgroup \stepcounter{equation}% + \fi \global\@eqnswtrue\global\@eqcnt\z@\cr} +% \end{macrocode} +% \end{macro} +% +% Finally, we handle the package options \Lopt{leftjust} and +% \Lopt{nocolsep}. Declare the default behavior; declare the optional +% behavior, as described above; and process any options specified. +% \begin{macrocode} +\def\DEQ@acs{\hskip\tw@\arraycolsep} +\DeclareOption{leftjust}{\let\@eqnsel\hfil} +\DeclareOption{nocolsep}{\let\DEQ@acs\null} +\ProcessOptions +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% \Finale +\endinput diff --git a/macros/latex/contrib/dotseqn/dotseqn.pdf b/macros/latex/contrib/dotseqn/dotseqn.pdf new file mode 100644 index 0000000000..c0cb96f43a Binary files /dev/null and b/macros/latex/contrib/dotseqn/dotseqn.pdf differ diff --git a/macros/latex/contrib/dotseqn/readme b/macros/latex/contrib/dotseqn/readme new file mode 100644 index 0000000000..940c27a011 --- /dev/null +++ b/macros/latex/contrib/dotseqn/readme @@ -0,0 +1 @@ +The file dotseqn.dtx is `self-extracting' as well as self-documenting -- cgit v1.2.3