ProgTutorial/document/lineno.sty
author Christian Urban <urbanc@in.tum.de>
Fri, 13 Aug 2010 18:52:16 +0800
changeset 447 d21cea8e0bcf
parent 189 069d525f8f1d
permissions -rwxr-xr-x
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
                                \iffalse; awk '/S[H]ELL1/' lineno.sty|sh;exit; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
                                     ... see bottom for .tex documentation ... 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
Macro file lineno.sty for LaTeX: attach line numbers, refer to them. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
                                                                           \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\def\fileversion{v4.41} \def\filedate{2005/11/02}                     %VERSION
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
%%% Copyright 1995--2003 Stephan I. B"ottcher <boettcher@physik.uni-kiel.de>; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
%%% Copyright 2002--2005 Uwe L"uck, http://www.contact-ednotes.sty.de.vu 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
%%%                      for version 4 and code from former Ednotes bundle 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
%%%                      --author-maintained. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
%%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
%%% This file can be redistributed and/or modified under 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
%%% the terms of the LaTeX Project Public License; either 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
%%% version 1.3a of the License, or any later version.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
%%% The latest version of this license is in
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
%%%     http://www.latex-project.org/lppl.txt
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
%%% We did our best to help you, but there is NO WARRANTY. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
%%% $Id: lineno.sty,v 1.1 2006/02/25 18:18:12 wenzelm Exp $ %% was v4.00.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
%                                                      \title{\texttt{\itshape 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
%%                                       %% (UL 2004/10/09:) Italic TT is evil
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
%%                                       %% ... or nice front page layout!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
%         lineno.sty \ \fileversion\ \filedate 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
%                                                               \unskip}\\\ \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
%          A \LaTeX\ package  to attach 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
% \\        line numbers to paragraphs
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
%                                                            \unskip}\author{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
%              Stephan I. B\"ottcher 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
%  \\          Uwe L\"uck 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
%                                                              \unskip}\date{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
%            boettcher@physik.uni-kiel.de 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
%  \\        http://contact-ednotes.sty.de.vu 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
%% \\        stephan@nevis.columbia.edu
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
%% \\        Stephan.Boettcher@cern.ch                     
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
%                                                                          \\}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
%                                      \documentclass[a4paper,12pt]{article}%D
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
%                                                        \usepackage{lineno}%D 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
%%                                                              %% (New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
%                                                     \catcode`\_\active\let_~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
%%                                               %% Beware math!? (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
%                                                                \def~{\verb~} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
%                                                               \let\lessthan< 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
%                                                           \catcode`\<\active
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
%                                   \def<#1>{$\langle${\itshape#1}\/$\rangle$}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
%                                                           \catcode`\|\active
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
%%                                        (New v4.1: \tt star; in box anyway.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
%                                                  \def|#1{\ttfamily\string#1}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
%%                                               \def|#1{{\ttfamily\string#1}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
%%                                                                 (/New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
%                                                        \newenvironment{code}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
%                                                     {\par\runninglinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
%                                                       \modulolinenumbers[1]%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
%                                                           \linenumbersep.3em
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
%                                                                \footnotesize
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
%                                                          \def\linenumberfont
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
%                                                  {\normalfont\tiny\itshape}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
%                                                                           {} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
%%                                                              %% (New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
%                                           {\makeatletter \gdef\scs#1{\texttt
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
%                                                {\protect\@backslashchar#1}}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
%                                                  \def\old{\par\footnotesize}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
%%                                                             %% (/New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
%%                                                               %% (New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
%                                                          {\catcode`\/\active
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
%                                     \gdef\path{\begingroup\catcode`\/\active
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
%                                                          \let/\slash\dopath}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
%                                 \gdef\dopath#1{\slash\unpenalty#1\endgroup}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
%%                                                              %% (/New v4.1)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
%                                                           \begin{document}%D
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
%%                                                         \DocInput{lineno}%D
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
%                                                         \pagewiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
%                                                                   \maketitle 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
%                                                         \pagestyle{headings}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
%                                                             \tableofcontents
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
%                                                                      \sloppy
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
%%                                      %% New v4.00: `...section{%' + \unskip 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
%                    Introductions 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
%%                                                           %% New v4.00: `s'
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
% (New v4.00)           Parts of former first section 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
% have been rendered separate subsections for package 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
% version_v4.00.                         (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
%               Introduction to versions $\textrm{v}\lessthan4$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
%                                                                     \unskip} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
% This package provides line numbers on paragraphs.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
% After \TeX\ has broken a paragraph into lines there will
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
% be line numbers attached to them, with the possibility to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
% make references  through the \LaTeX\ ~\ref~, ~\pageref~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
% cross reference mechanism.  This includes four issues:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
%                                                              \begin{itemize}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
% \item   attach a line number on each line,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
% \item   create references to a line number,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
% \item   control line numbering mode,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
% \item   count the lines and print the numbers.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
%                                                                \end{itemize}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
% The first two points are implemented through patches to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
% the output routine.  The third by redefining ~\par~, ~\@par~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
% and ~\@@par~.  The counting is easy, as long as you want
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
% the line numbers run through the text.  If they shall
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
% start over at the top of each page, the aux-file as well
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
% as \TeX s memory have to carry a load for each counted line.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
% I wrote this package for my wife Petra, who needs it for
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
% transcriptions of interviews.  This allows her to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
% precisely refer to passages in the text.  It works well
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
% together with ~\marginpar~s, but not too well with displaymath.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
% ~\footnote~s are a problem, especially when they
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
% are split, but we may get there. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
% (New v4.00 UL) Version v4.00 overcomes the problem, I believe. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
% (/UL /New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
% lineno.sty works
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
% surprisingly well with other packages, for
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
% example, ~wrapfig.sty~.  So please try if it
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
% works with whatever you need, and if it does,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
% please tell me, and if it does not, tell me as
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
% well, so I can try to fix it.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
%               Introduction to versions v4.00ff. (UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
% ~lineno.sty~ has been maintained by Stephan until version_v3.14.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
% From version_v4.00 onwards, maintenance is shifting towards 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
% Uwe L\"uck (UL), who is the author of v4\dots code and of v4\dots 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
% changes in documentation. This came about as follows. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
% Since late 2002, Christian Tapp and Uwe L\"uck have employed 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
% ~lineno.sty~ for their ~ednotes.sty~, a package supporting 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
% critical editions---cf.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
%                                                                  \[\mbox{\tt 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
%     http://ednotes.sty.de.vu 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
%                                                                   \unskip}\]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
% ---while you find ~ednotes.sty~ and surrounding files in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
% CTAN folder \path{macros/latex/contrib/ednotes}.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
% Soon, some weaknesses of ~lineno.sty~ showed up, mainly since 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
% Christian's critical editions (using ~ednotes.sty~) needed lots 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
% of ~\linelabel~s and footnotes. (These weaknesses are due to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
% weaknesses of \LaTeX's ~\marginpar~ mechanism that Stephan 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
% used for ~\linelabel~.) So we changed some ~lineno.sty~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
% definitions in some extra files, which moreover offered new 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
% features. We sent these files to Stephan, hoping he would take 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
% the changes into ~lineno.sty~. However, he was too short of time. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
% Writing a TUGboat article on Ednotes in 2004, we hoped to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
% reduce the number of files in the Ednotes bundle and so asked 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
% Stephan again. Now he generously offered maintenance to me, so 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
% I could execute the changes on my own. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
% The improvements are as follows: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
%                                                         \begin{itemize}\item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
% [(i)]   Footnotes placement approaches intentions better 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
% (footnotes formerly liked to pile up at late pages). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
% [(ii)]  The number of ~\linelabel~s in one paragraph is no longer 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
% limited to 18. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
% [(iii)] ~\pagebreak~, ~\nopagebreak~, ~\vspace~, and the star 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
% and optional versions of ~\\~ work as one would expect 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
% (section_\ref{s:MVadj}).                                   %% Added for v4.1
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
% [(iv)]  A command is offered which chooses the first line number 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
% to be printed in the margin 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
% (subsection_\ref{ss:Mod}).                                 %% Added for v4.1
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
% [(v)]   (New v4.1) \LaTeX\ tabular environments (optionally) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
% get line numbers as well, and you can refer to them in the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
% usual automatic way. (It may be considered a shortcoming that, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
% precisely, \emph{rows} are numbered, not lines.---See 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
% subsection_\ref{ss:Tab}.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
% [(vi)]  We are moving towards referring to math items 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
% (subsection_\ref{ss:MathRef} and the hooks in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
% subsection_\ref{ss:LL}). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
% (/New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
%                                                                 \end{itemize}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
% (Thanks to Stephan for making this possible!)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
%% Unpublish: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
%% You may trace the earlier developments of these changes by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
%% requesting our files ~linenox0.sty~, ~linenox1.sty~, and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
%% ~lnopatch.sty~. Most of our changes have been in ~linenox0.sty~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
%% Our ~linenox1.sty~ has extended ~linenox0.sty~ for one single 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
%% purpose in a not very stable way. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
%%% (See ~\linenumberpar~ below). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
%% ~lnopatch.sty~ has done the first line number thing referred 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
%% to in case_(iv) up to now. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
%% (New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
%% Case_(v) earlier was provided by our ~edtab02.sty~---now 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
%% called ~edtable.sty~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   202
%% (/New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
% Ednotes moreover profits from Stephan's offer with regard 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
% to the documentation of our code which yielded these 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
% improvements formerly. This documentation now becomes 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
% printable, being part of the ~lineno.sty~ documentation. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
% Of course, Stephan's previous ~lineno.sty~ versions were a great 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
% and ingenious work and exhibit greatest \TeX pertise. I never 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
% could have done this. I learnt a lot in studying the code when 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
% Christian pointed out strange output results and error 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
% messages, and there are still large portions of ~lineno.sty~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
% which I don't understand (consider only pagewise numbering of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
% lines). Fortunately, Stephan has offered future help if 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
% needed.---My code for attaching line numbers to \emph{tabular 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   217
% environments} (as mentioned above, now still in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
% ~edtable.sty~) %%                                                      %% TODO
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
% developed from macros which Stephan and Christian experimented 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
% with in December 2002. Stephan built the basics. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
% (However, I then became too proud to follow his advice only to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
% use and modify ~longtable.sty~.)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
% There are some issues concerning use of counters on which I 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   225
% don't agree with Stephan and where I would like to change the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   226
% code if ~lineno.sty~ is ``mine'' as Stephan offered. However, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   227
% Stephan is afraid of compatibility problems from which, in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
% particular, his wife could suffer in the near future. So he 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
% demanded that I change as little as possible for my first 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
% version. Instead of executing changes that I plan I just offer 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   231
% my opinions at the single occasions. I hope to get in touch 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   232
% this way with users who consider subtle features vital which I 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
% consider strange. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
% On the other hand, the sections on improvements of the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
% implementation have been blown up very much and may be tiring 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
% and litte understandable for mere \emph{users}. These users 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
% may profit from the present presentation just by jumping to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   239
% sections_\ref{s:Opts} and_\ref{s:UserCmds}. There is a user's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
% guide ulineno.tex which may be even more helpful, but it has 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   241
% not been updated for a while.                                        %% TODO
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   244
%               Availability 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   246
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   247
% In case you have found the present file otherwise than from 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
% CTAN: A recent version and documentation of this package 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
% should be available from CTAN folder 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
% \path{macros/latex/contrib/lineno}.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
% Or mail to one of the addresses at top of file. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   254
%               Introductory code
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   255
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   257
% This style option is written for \LaTeXe, November 1994 or later,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   258
% since we need the ~\protected@write~ macro. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   259
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   260
% (New v4.00)               And we use ~\newcommand*~ for 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
% controlling length of user macro arguments, which has been 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   262
% available since December 1994. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   263
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   264
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   265
\NeedsTeXFormat{LaTeX2e}[1994/12/01] 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   266
%%                                                                [1994/11/04] 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   267
\ProvidesPackage{lineno} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   268
  [\filedate\space line numbers on paragraphs \fileversion] 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   269
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   270
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
%% History of versions: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   272
%% v1.00 1995/03/31  SIB: first release for Petra's interview transcriptions
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
%% v1.01 1995/10/28  SIB: added ~pagewise~ mode
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
%% v1.02 1995/11/15  SIB: added ~modulo~ option  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   275
%% v1.03 1995/12/05  SIB: pagewise: try to reduce the hash-size requirements
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
%% v2.00 1995/12/06  SIB:   .. it works, new user interface
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   277
%% v2.01 1996/09/17  SIB: put into CVS
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   278
%% v2.02 1997/03/17  SIB: add: \@reinserts, for footnotes
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   279
%% v2.04 1998/03/09  SIB: add: linenomath environment
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   280
%% v2.05 1998/04/26  SIB: add: prevgraf test
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   281
%% v2.06 1999/03/02  SIB: LPPL added
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   282
%% v3.00 1999/06/11  SiB: include the extension in the main file
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   283
%% v3.01 1999/08/28  SiB: \@reinserts -> \holdinginserts
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   284
%% v3.02 2000/03/10  SiB: \@LN@output
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   285
%% v3.03 2000/07/01  SiB: \@LN@ExtraLabelItems, hyperref
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   286
%% v3.04 2000/12/17  SiB: longtable compatibility.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   287
%% v3.05 2001/01/02  SiB: [fleqn] detection. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
%% v3.05a 2001/01/04 SiB: [fleqn] detection reverted for eqnarray. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
%% v3.06 2001/01/17  SiB: [twocolumn] mode support.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   290
%% v3.07 2001/07/30  SiB: [hyperref] option obsoleted.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
%% v3.08 2001/08/02  SiB: linenomath wrapping for \[ \]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   292
%% v3.08a 2001/08/04 SiB: linenomath wrapping for \[ \] fixed
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   293
%% v3.08b 2002/01/27 SiB: enquotation typo fix
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
%% v3.09 2003/01/14  SIB: hyperref detection fix
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
%% v3.10 2003/04/15  FMi: \MakeLineNo fix for deep boxes
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
%% v3.10a 2003/11/12  Uwe Lück: \lineref typo fix
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
%% v4.00 2004/09/02  UL:  included linenox0, linenox1, lnopatch code with 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   298
%%                        documentation, usually indicated by `New v4.00'; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   299
%%                        discussions of old code, indicated by `UL'; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   300
%%                        LPPL v.1 ->  LPPL v1.3, `program' -> `file'; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   301
%%                        first lines with \filedate and \fileversion, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   302
%%                        according nawk lines; `November 1994 or later', 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
%%                        some earlier documentation typos (including a few 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
%%                        bad minus signs), { -> {% and } -> \unskip} at 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
%%                        line ends (so, e.g., alignment in TOC works); \scs. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
%%       2004/09/03  UL:  removed everything which indicated that the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
%%                        present file were named `lineno4.sty'. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
%% v4.1  2004/09/19  UL:  Inserted Stephan's identification line, removed 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   309
%%                        some TODOs and remarks from v4.00. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
%%       2004/10/04  UL:  Added acknowledgement for Daniel Doherty; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
%%                        `(New v4.00)' with [|\firstlinenumber]; changed 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
%%                        TODOs; Refining -> Redefining (\vadjust). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
%%       2004/10/05  UL:  ednmath0 -> mathrefs; \catcode`\~ -> \active;
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
%%                        \path; refined section on options `mathrefs'; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
%%                        changes in introduction. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   316
%%       2004/10/06  UL:  Changed/removed TODOs, e.g., for edtable.sty. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
%%       2004/10/11  UL:  Reminders: linenox0/1/lnopatch.sty obsolete; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
%%                        \tt star in list of commands.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
%%       2004/10/12  UL:  Corrected blank lines in lineno.tex. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
%%       2004/10/19  UL:  Fixed minor typos; remark on \if@LN@edtable. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
%% v4.1a 2004/11/07  UL:  LPPL v1.3a. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
%% v4.1b 2004/11/13  UL:  Comment on \outputpenalty values. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
%% v4.1c 2005/01/10  UL:  Contact via http. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
%% v4.11 2005/02/20  UL:  Error message with \linelabel when not numbering. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
%%       2005/03/07  UL:  Removed \linelabel from ss:Tab heading, consider 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
%%                        marginal line numbers as well, revised ss:Tab. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
%%                        Added a few lines on missing explanations to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
%%                        s:UserCmds. Corrected some code alignments. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
%%       2005/03/08  UL:  Require recent edtable.sty. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   332
%% v4.2  2005/03/21  UL:  "Physical page" counter works with \include. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   333
%%       2005/04/17  UL:  Raised options section above extensions section 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
%%                        (v4.00 disabled `displaymath' option); 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
%%                        third arg for \@ifundefined{mathindent}; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
%%                        "bunch of options"; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
%%       2005/04/24  UL:  compatibility with tamefloats; vplref.sty. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
%%       2005/04/25  UL:  \number -> \the; wondered -> $$; subsec. appbas; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
%%                        CrtlLN sec -> subsec.; \newcommand* wherever ...; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
%%                        doc. on `other output routines' and `addpageno' 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
%%                        (this changed from `varioref'). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
%%       2005/04/27  UL:  =1\relax -> =\@ne, 0\relax ..., \hb@xt@, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
%%                        \ifx\@@par\@@@par -> \ifLineNumbers, typos, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
%%                        \pagestyle{headings}, LaTeX -> \LaTeX. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
%% v4.21 2005/04/28  UL:  linenomath section: removed wrong \else's, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
%%                        \holding...: \thr@@, \@LN@outer@holdins, \global. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
%% v4.22 2005/05/01  UL:  \unvbox\@outputbox; \@LN@col without #1, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
%%       2005/05/08  UL:  global/local \internall..., \resetl... global, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
%%                        shortened discussions of this and of \newcounter. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
%%       2005/05/09  UL:  corr.: doc. typo, version history, bad lines; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
%%                        percent; \chardef for modulo, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
%%                        \value{firstlinenumber}. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
%% v4.3  2005/05/10  UL:  \@backslashchar -> \char`\\ in \scs. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
%%       2005/05/11  UL:  \linenumbers sets ...outer@holdins; tidied up 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
%%                        documentation regarding earlier versions. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
%%       2005/05/12  UL:  `linenomath' without spurious number above; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
%%                        `displaymath' default; edmac homepage -> 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
%%                        ednotes.sty.de.vu, \endlinenomath without 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
%%                        numbers: no change of \holdinginserts; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
%%                        \linelabel doesn't go to .aux or mark, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
%%                        hyperref detected; undone 2005/05/10 (bad mark). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362
%%       2005/05/13  UL:  Reworked hyperref detection (new subsec.). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   363
%%       2005/05/15  UL:  More typo fixes, corrected terrible confusions in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
%%                        the discussion (v4.22/v4.3) of \new/\stepcounter; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
%%                        new subsec. in `Line number ...'; another 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   366
%%                        implementation of `hyperref' detection. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   367
%%       2005/05/16  UL:  Final minor changes. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   368
%% v4.31b    /06/14  UL:  Extended explanation of \firstlinenumbers 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
%%                        and package options; \@LN@ifgreat@critical; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
%%                        \modulolinenumbers*. Sent to Ednotes.news only.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
%% v4.31 2005/06/15  UL:  \modulolinenumbers* with \firstlinenumber{1}; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   372
%%                        " -> ``/''; more doc. on \firstlinenumber .
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   373
%%       2005/06/20  UL:  Typo fix. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   374
%%       2005/10/01  UL:  Warning about \mod...* with pagewise mode. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   375
%% v4.31a    /10/02  UL:  Minor changes of appearance of doc., e.g., 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   376
%%                        \[ for $$. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   377
%% v4.32b    /10/15  UL:  Support for \addvspace; removed comments that
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
%%                        had been invisible already for some time; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   379
%%                        made clear with which environments the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   380
%%                        linenomath environment is not needed. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   381
%% v4.32ab   /10/15  UL:  Observe \if@nobreak with support for \addvspace. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   382
%% v4.32 2005/10/17  UL:  Just made it official and sent it to CTAN. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   383
%% v4.33b    /10/23  UL:  \if@nobreak\nobreak\fi -> \nobreak . 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   384
%% v4.33ab   /10/24  UL:  \LineNoLaTeXOutput without \@tempswafalse; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   385
%%                        undid v4.22: \[unv]box\@outputbox (space is OK, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   386
%%                        \unvbox pushes short columns down); \@LN@kern@z@ . 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   387
%% v4.4b 2005/10/24  UL:  Another tidying-up of the discussion of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   388
%%                        \stepcounter{linenumber}; \@LN@screenoff@pen 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   389
%%                        replaces \@LN@kern@z@, \@LN@depthbox . 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
%% v4.4  2005/10/27  UL:  Just made official for CTAN. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   391
%% v4.4a 2005/10/29  UL:  Undid change of discussion of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
%%                        \stepcounter{linenumber} (confusion again). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   393
%% v4.41 2005/11/02  UL:  Raised \CheckCommand*. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   395
%% Acknowledgements:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
%% v3.06:  Donald Arseneau, pointed to mparhack.sty.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   397
%% v3.07+: Frank Mittelbach, points out inconsistencies in the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
%%         user interface.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
%% v3.10:  Frank Mittelbach \MakeLineNo fix for deep boxes
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
%% v4.00:  Daniel Doherty points out clash of \pagewise... with resetting 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
%%         page number. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402
%% v4.21:  Much testing work by Erik Luijten. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
%% v4.3:   `displaymath' default by Erik Luijten's suggestion. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404
%% v4.31:  \modulolinenumbers* is an idea of Hillel Chayim Yisraeli's. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   405
%% v4.32:  Support for \addvspace due to Saravanan M.'s observation. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   406
%% v4.33:  Different support for \addvspace due to bug reports by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   407
%%         Saravanan M.'s and David Josef Dev. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   408
%% v4.4:   David Josef Dev points out that \kern\z@ after a paragraph 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   409
%%         tends to place its final baseline wrongly. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   410
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   411
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   412
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   413
%               Put the line numbers to the lines
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   414
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   415
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   416
% (New v4.00)                    This section contained the most 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   417
% basic package code previously. For various purposes of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   418
% version_4\dots, much of these basics have been to be modified. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   419
% Much of my (UL's) reasoning on these modifications has been to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   420
% be reported. Sorry, the present section has been blown up 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   421
% awfully thus and contains ramifications that may be difficult 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   422
% to trace. We add some ~\subsection~ commands in order to cope 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   423
% with the new situation. (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   424
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   425
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   426
%               Basic code of \texttt{lineno.sty} \scs{output}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   427
%                                                    \unskip}\label{ss:output} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   428
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   429
% The line numbers have to be attached by the output
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   430
% routine.  We simply set the ~\interlinepenalty~ to $-100000$.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   431
% The output routine will be called after each line in the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   432
% paragraph,  except the last,  where we trigger by ~\par~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   433
% The ~\linenopenalty~ is small enough to compensate a bunch of
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   434
% penalties (e.g., with ~\samepage~).
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   435
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   436
% (New v3.04)            Longtable uses 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   437
% ~\penalty~$-30000$.  The lineno penalty range was 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   438
% shrunk to $-188000 \dots -32000$.  (/New v3.04)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   439
% (New v4.00) New values are listed below (11111f.). (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   440
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   441
\newcount\linenopenalty\linenopenalty=-100000
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   442
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   443
%% TODO v4.4+: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   444
% (UL)                              Hm. It is never needed below 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   445
% that this is a counter. ~\def\linenopenalty{-100000\relax}~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   446
% would do. (I guess this consumes more memory, but it 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   447
% is more important to save counters than to save memory.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   448
% I was frightened by ~-\linenopenalty~ below, but indeed 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   449
% \TeX\ interprets the string ~--100000~ as 100000. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   450
% Has any user or extension package writer ever called 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   451
% ~\linenopenalty=xxx~, or could I really change this?---The 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   452
% counter is somewhat faster than the macro. Together with the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   453
% compatibility question this seems to support keeping the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   454
% counter. (???) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   455
%% Note that Stephan chose ~\mathchardef~ below, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   456
%% so his choice above seems to have been deliberate. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   457
%% <- no point, \mathchardef token is fast. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   458
% (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   459
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   460
\mathchardef\linenopenaltypar=32000
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   461
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   462
% So let's make a hook to ~\output~,  the direct way. The \LaTeX\ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   463
% macro ~\@reinserts~ puts the footnotes back on the page.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   464
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   465
% (New v3.01)                ~\@reinserts~ badly
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   466
% screws up split footnotes.  The bottom part is
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   467
% still on the recent contributions list, and the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   468
% top part will be put back there after the bottom
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   469
% part. Thus, since lineno.sty does not play well
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   470
% with ~\inserts~ anyway, we can safely experiment
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   471
% with ~\holdinginserts~, without making things
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   472
% much worse.    
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   473
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   474
% Or that's what I thought, but:  Just activating
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   475
% ~\holdinginserts~ while doing the ~\par~ will
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   476
% not do the trick:  The ~\output~ routine may be
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   477
% called for a real page break before all line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   478
% numbers are done, and how can we get control
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   479
% over ~\holdinginserts~ at that point?
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   480
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   481
% Let's try this:  When the ~\output~ routine is
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   482
% run with ~\holdinginserts=3~ for a real page
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   483
% break, then we reset ~\holdinginserts~ and
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   484
% restart ~\output~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   485
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   486
% Then, again, how do we keep the remaining
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   487
% ~\inserts~ while doing further line numbers? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   488
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   489
% If we find ~\holdinginserts~=$-3$ we activate it again 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   490
% after doing ~\output~.             (/New v3.01)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   491
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   492
% (New v3.02)                    To work with
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   493
% multicol.sty, the original output routine is now
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   494
% called indirectly, instead of being replaced.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   495
% When multicol.sty changes ~\output~, it is a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   496
% toks register, not the real thing. (/New v3.02)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   497
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   498
% (New v4.00)               Two further complications are added. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   499
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   500
%% TODO v4.3+: Or three, ~\@nobreakfalse~ after ~\MakeLineNo~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   501
%% for getting rid of ~\@LN@nopagebreak~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   502
%                                                         \begin{itemize}\item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   503
% [(i)]  Problems with footnotes formerly resulted from 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   504
% \LaTeX's ~\@reinserts~ in ~\@specialoutput~ which Stephan's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   505
% ~\linelabel~ called via the ~\marginpar~ mechanism. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   506
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   507
% [(ii)] \LaTeX\ commands using ~\vadjust~ formerly didn't work 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   508
% as one would have hoped. The problem is as follows: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   509
% Printing the line number results from 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   510
% a box that the output routine inserts at the place of the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   511
% ~\interlinepenalty~. ~\vadjust~ items appear \emph{above} the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   512
% ~\interlinepenalty~ (\TeX book p._105). So ~\pagebreak~, e.g., 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   513
% formerly sent the line number to the next page, while the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   514
% penalty from ~\nopagebreak~ could not tie the following line, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   515
% since it was screened off by the line number box.---Our trick 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   516
% is putting the ~\vadjust~ items into a list macro from which 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   517
% the output routine transfers them into the vertical list, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   518
% below the line number box. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   519
%                                                                \end{itemize}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   520
% In this case_(ii), like in case_(i), footnotes would suffer 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   521
% if ~\holdinginserts~ were non-positive. Indeed, in both 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   522
% cases_(i) and_(ii) we tackle the footnote problem by extending 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   523
% that part of Stephan's output routine that is active when 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   524
% ~\holdinginserts~ is positive. This extension writes the line 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   525
% number ~\newlabel~ to the .aux file (which was formerly done 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   526
% under $~\holdinginserts~=-3$) and handles the ~\vadjust~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   527
% items.---To trigger ~\output~ and its ~\linelabel~ or, resp., 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   528
% ~\vadjust~ part, the list of signal penalties started 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   529
% immediately before is increased here (first for ~\linelabel~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   530
% second for postponed ~\vadjust~ items): 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   531
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   532
\mathchardef\@Mllbcodepen=11111 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   533
\mathchardef\@Mppvacodepen=11112 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   534
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   535
% (/New v4.00) (New v4.2) David Kastrup urges to use a private 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   536
% name instead of ~\the\output~ (LaTeX-L-list). Otherwise an 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   537
% ~\output~ routine loaded later and using ~\newtoks\output~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   538
% again may get lost entirely. So we change use of ~\@LN@output~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   539
% using it for the former purpose. Reference to what appeared 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   540
% with the name of ~\output~ here lasts for a few lines and then 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   541
% is given away. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   542
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   543
\let\@tempa\output
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   544
\newtoks\output
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   545
\let\@LN@output\output
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   546
\output=\expandafter{\the\@tempa}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   547
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   548
% Now we add two cases to Stephan's output routine. (New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   549
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   550
\@tempa={%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   551
% (/New 4.2)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   552
            \LineNoTest
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   553
            \if@tempswa
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   554
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   555
%% (UL) Learnt that even in def.s blank line means ~\par~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   556
%% to leave visual space in present file with having a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   557
%% blank line neither in present nor in .tex file, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   558
%% use double comment mark (`%%'). (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   559
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   560
% (New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   561
% We insert recognition of waiting ~\linelabel~ items--- 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   562
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   563
              \ifnum\outputpenalty=-\@Mllbcodepen 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   564
                \WriteLineNo 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   565
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   566
% ---and of waiting ~\vadjust~ items: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   567
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   568
              \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   569
                \ifnum\outputpenalty=-\@Mppvacodepen 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   570
                  \PassVadjustList 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   571
                \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   572
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   573
%% Now we give control back to Stephan. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   574
% (/New v4.00) (New v4.2) Outsource ``Standard'' output 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   575
% ---which occurs so rarely---to subsection_\ref{ss:LLO}: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   576
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   577
                  \LineNoLaTeXOutput 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   578
% (/New v4.2) (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   579
% Two new ~\fi~s for the ~\linelabel~ and ~\vadjust~ tests--- 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   580
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   581
                \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   582
              \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   583
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   584
% ---and the remaining is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   585
%%%next three lines are 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   586
% Stephan's code again: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   587
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   588
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   589
            \else  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   590
              \MakeLineNo
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   591
            \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   592
            }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   593
 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   594
% (New v4.00)                                  Our new macros 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   595
% ~\WriteLineNo~ and ~\PassVadjustList~ will be dealt with in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   596
% sections_\ref{s:LNref} and_\ref{ss:PVadj}. (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   597
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   598
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   599
%               \scs{LineNoTest}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   600
%                                                                     \unskip} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   601
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   602
% The float mechanism inserts ~\interlinepenalty~s during
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   603
% ~\output~.  So carefully reset it before going on.  Else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   604
% we get doubled line numbers on every float placed in
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   605
% horizontal mode, e.g, from ~\linelabel~.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   606
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   607
% Sorry, neither a ~\linelabel~ nor a ~\marginpar~ should
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   608
% insert a penalty, else the following linenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
% could go to the next page. Nor should any other
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   610
% float.  So let us suppress the ~\interlinepenalty~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   611
% altogether with the ~\@nobreak~ switch.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   612
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   613
% Since (ltspace.dtx, v1.2p)[1996/07/26], the ~\@nobreaktrue~ does
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   614
% it's job globally.  We need to do it locally here.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   615
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   616
\def\LineNoTest{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   617
  \let\@@par\@@@par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   618
  \ifnum\interlinepenalty<-\linenopenaltypar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   619
     \advance\interlinepenalty-\linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   620
     \@LN@nobreaktrue
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   621
     \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   622
  \@tempswatrue
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   623
  \ifnum\outputpenalty>-\linenopenaltypar\else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   624
     \ifnum\outputpenalty>-188000\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   625
       \@tempswafalse
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   626
       \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   627
     \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   628
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   629
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   630
\def\@LN@nobreaktrue{\let\if@nobreak\iftrue} % renamed v4.33
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   631
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   632
% (UL)                                      I thought here were 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   633
% another case of the save stack problem explained in \TeX book, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   634
% p._301, namely through both local and global changing 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   635
% ~\if@nobreak~. However, ~\@LN@nobreak~ is called during 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   636
% ~\@LN@output~ only, while ~\@nobreaktrue~ is called by \LaTeX's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   637
% ~\@startsection~ only. The latter never happens during 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   638
% ~\@LN@output~. So there is no local value of ~\if@nobreak~ on 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   639
% save stack when ~\@nobreaktrue~ acts, since ~\the\@LN@output~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   640
% (where ~\@LN@output~ is a new name for the original ~\output~) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   641
% is executed within a group (\TeX book p._21).
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   642
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   643
%%           2004/09/19 Removed nonsense here according to Stephan 2004/09/04.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   644
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   645
% (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   646
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   647
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   648
%               Other output routines (v4.2)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   649
%                                                       \unskip}\label{ss:LLO} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   650
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   651
% I had thought of dealing with bad interference of footnotes 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   652
% (and ~\enlargethispage~) with (real) ~\marginpar~s and floats 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   653
% \emph{here}. Yet this is done in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   654
%                                                                           \[
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   655
%     ~http://~\mbox{[CTAN]}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   656
%           ~/macros/latex/contrib/tamefloats/tameflts.sty~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   657
%                                                                           \]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   658
% now, and I prefer striving for compatibility with the latter. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   659
% (See there for expanding on the problem.)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   660
% This requires returning the special absolute value of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   661
% ~\holdinginserts~ that ~lineno.sty~ finds at the end of a newly 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   662
% typeset paragraph---now done in subsection_\ref{ss:calls}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   663
% (~\linenumberpar~). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   664
% The former ~\LineNoHoldInsertsTest~ has been filled into here. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   665
%% ---`3' is replaced by ~\thr@@~ for a while. ~\thr@@~ is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   666
%% useful practice since plain \TeX, but Stephan may have been 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   667
%% wise in suspecting that \LaTeX\ once could forsake ~\thr@@~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   668
%% The same holds for ~\@M=10000~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   669
% Note: when the following code is invoked, we have 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   670
% ~\if@tempswa~_ =_~\iftrue~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   671
% WARNING: I am still not sure whether the present code is good 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   672
% for cooperating with other packages that use ~\holdinginserts~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   673
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   674
\def\LineNoLaTeXOutput{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   675
  \ifnum \holdinginserts=\thr@@   % v4.33 without \@tempswafalse
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   676
    \global\holdinginserts-\thr@@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   677
    \unvbox\@cclv 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   678
    \ifnum \outputpenalty=\@M \else \penalty\outputpenalty \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   679
  \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   680
    \if@twocolumn \let\@makecol\@LN@makecol \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   681
    \the\@LN@output % finally following David Kastrup's advice. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   682
    \ifnum \holdinginserts=-\thr@@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   683
      \global\holdinginserts\thr@@ \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   684
  \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   685
}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   686
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   687
% \textit{More on dealing with output routines from other 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   688
%         packages:} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   689
% Since ~lineno.sty~'s output routine is called at least once 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   690
% for each output line, I think it should be in \TeX's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   691
% original ~\output~, while output routines dealing with 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   692
% building pages and with floats etc.\ should be filled into 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   693
% registers addressed by ~\output~ after ~\newtoks\output~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   694
% Therefore                                                  \begin{enumerate}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   695
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   696
%   ~tameflts.sty~ should be loaded \emph{after} ~lineno.sty~; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   697
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   698
%   if a class changes ~\output~ (APS journal class revtex4, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   699
%   e.g.), ~lineno.sty~ should be loaded by ~\RequirePackage~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   700
%   [here presumably following some options in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   701
%   brackets]~{lineno}~ \emph{preceding} ~\documentclass~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   702
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   703
%   If you actually maintain such a class, please consider 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   704
%   loading ~lineno.sty~ on some draft option. The bunch of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   705
%   lineno's package options may be a problem, but perhaps the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   706
%   purpose of your class is offering only very few of lineno's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   707
%   options anyway, maybe just one. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   708
%                                                              \end{enumerate} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   709
% The latter may also be needed with classes that don't follow 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   710
% David Kastrup's rule on changing ~\output~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   711
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   712
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   713
%               \scs{MakeLineNo}: Actually attach line number 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   714
%                                                       \unskip}\label{ss:MLN} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   715
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   716
% We have to return all the page to the current page, and
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   717
% add a box with the line number, without adding
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   718
% breakpoints, glue or space.  The depth of our line number
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   719
% should be equal to the previous depth of the page, in
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   720
% case the page breaks here,  and the box has to be moved up
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   721
% by that depth.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   722
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   723
% The ~\interlinepenalty~ comes after the ~\vadjust~ from a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   724
% ~\linelabel~,  so we increment the line number \emph{after}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   725
% printing it. The macro ~\makeLineNumber~ produces the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   726
% text of the line number, see section \ref{appearance}.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   727
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   728
% (UL)                        I needed a while to understand 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   729
% the sentence on incrementing. Correctly: writing the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   730
% ~\newlabel~ to the .aux file is triggered by the signal 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   731
% penalty that ~\end@float~ inserts via ~\vadjust~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   732
% However, this could be changed by our new ~\PostponeVadjust~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   733
% After ~\c@linenumber~ has been introduced as a \LaTeX\ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   734
% counter, it might be preferable that it behaved like standard 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   735
% \LaTeX\ counters which are incremented shortly before printing. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   736
% But this may be of little practical relevance in this case, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   737
% as ~\c@linenumber~ is driven in a very non-standard 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   738
% way.---However still, this behaviour of ~\c@linenumber~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   739
% generates a problem with our ~edtable.sty~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   740
%% \unskip---Before, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   741
%% I thought that Stephan had reported his reasoning incorrectly 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   742
%% and rather did this because of his ~\resetlinenumber~ which 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   743
%% initializes ~\c@linenumber~ to 1 instead of 0---the latter is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   744
%% usual with \LaTeX\ counters. Cf._additional comment at 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   745
%% ~\resetlinenumber~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   746
% (/UL). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   747
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   748
% Finally we put in the natural ~\interlinepenalty~, except
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   749
% after the last line. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   750
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   751
% (New v3.10) Frank Mittelbach points out that box255 may be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   752
% less deep than the last box inside, so he proposes to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   753
% measure the page depth with ~\boxmaxdepth=\maxdimen~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   754
% (/New v3.10)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   755
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   756
% (UL, New v4.00)               We also resume the matter of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   757
% ~\vadjust~ items that was started in section_\ref{ss:output}. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   758
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   759
% \TeX\ puts only nonzero interline 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   760
% penalties into the vertical list (\TeX book p._105), while 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   761
% ~lineno.sty~ formerly replaced the signal interline penalty by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   762
% something closing with an explicit penalty of the value that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   763
% the interline penalty would have without ~lineno.sty~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   764
% This is usually 0. Now, explicit vertical penalties can be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   765
% very nasty with respect to ~\nopagebreak~, e.g., a low (even 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   766
% positive) ~\widowpenalty~ may force a widow where you 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   767
% explicitly tried to forbid it by ~\nopagebreak~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   768
% (see explanation soon below). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   769
% The ~\nopagebreak~ we create here would never work if all 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   770
% those zero penalties were present.---On 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   771
% the other hand, we cannot just omit Stephan's zero penalties, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   772
% because \TeX\ puts a penalty of 10000 after what ~lineno.sty~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   773
% inserts (\TeX book p._125). This penalty must be overridden 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   774
% to allow page breaks between ordinary lines. To revive 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   775
% ~\nopagebreak~, we therefore replace those zero (or low) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   776
% penalties by penalties that the user demanded by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   777
% ~\nopagebreak~.---This mechanism is not perfect and does not 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   778
% exactly restore the original \LaTeX\ working of ~\pagebreak~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   779
% and ~\nopagebreak~. Viz., if there are several vertical 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   780
% penalties after a line which were produced by closely sitting 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   781
% ~\[no]pagebreak~s, without ~lineno.sty~ the lowest penalty would 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   782
% be effective (cf._\TeX book exercise_14.10). Our mechanism, by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   783
% contrast, chooses the \emph{last} user-set penalty of the line 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   784
% as the effective one. It would not be very difficult to come 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   785
% more close to the original mechanism, but until someone urges 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   786
% us we will cling to the present simple way. You may consider an 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   787
% advantage of the difference between our mechanism and the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   788
% original one that the user here can actually override low 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   789
% penalties by ~\nopagebreak~, which may be what a lay \LaTeX\ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   790
% user would expect. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   791
%% ---Zero glue would do instead of zero 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   792
%% penalty! This could make things easier. Maybe next time. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   793
%% <- v4.4: No, problem with column depth. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   794
% (/UL, /New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   795
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   796
\def\MakeLineNo{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   797
   \@LN@maybe@normalLineNumber                        % v4.31 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   798
   \boxmaxdepth\maxdimen\setbox\z@\vbox{\unvbox\@cclv}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   799
   \@tempdima\dp\z@ \unvbox\z@
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   800
   \sbox\@tempboxa{\hb@xt@\z@{\makeLineNumber}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   801
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   802
% (New v4.00) Previously, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   803
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   804
% %    \stepcounter{linenumber}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   805
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   806
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   807
%%                                         %% TODO: Still first `\begin{old}'?
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   808
% followed. (Of course, there was no 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   809
% comment mark; I put it there to make 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   810
% reading the actual code easy.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   811
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   812
% (New v4.22: improved) Why not just 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   813
%   \[~\global\advance\c@linenumber\@ne~?\]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   814
% ~\stepcounter~ additionally resets ``subordinate'' 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   815
% counters, but which could these (usefully) be? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   816
% Again, may be column counters with ~edtable.sty~!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   817
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   818
% But then, our ~edtable.sty~ and its ~longtable~ option 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   819
% should use it as well. So use a shorthand supporting 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   820
% uniformity. You can even use it as a hook for choosing 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   821
% ~\global\advance\c@linenumber\@ne~ instead of our choice. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   822
% (/New v4.22) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   823
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   824
   \stepLineNumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   825
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   826
%  (New v4.4)   Now 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   827
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   828
   \ht\@tempboxa\z@ \@LN@depthbox 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   829
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   830
% appends the box containing the line number without changing 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   831
% ~\prevdepth~---see end of section. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   832
% Now is the time for inserting the $\dots$ (/New v4.4) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   833
%% The line number has now been placed (it may be invisible 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   834
%% depending on the modulo feature), so 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   835
%% we can insert the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   836
% ~\vadjust~ items. We cannot do this much later, because 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   837
% their right place is above the artificial interline 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   838
% penalty which Stephan's code will soon insert 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   839
% (cf._\TeX book p._105). The next command is just ~\relax~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   840
% if no ~\vadjust~ items have been accumulated for the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   841
% current line. Otherwise it is a list macro inserting 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   842
% the ~\vadjust~ items and finally resetting itself. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   843
% (This is made in section_\ref{ss:PVadj} below.)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   844
% If the final item is a penalty, it is stored so it can 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   845
% compete with other things about page breaking. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   846
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   847
   \@LN@do@vadjusts 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   848
   \count@\lastpenalty 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   849
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   850
% At this place, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   851
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   852
% %    \ifnum\outputpenalty=-\linenopenaltypar\else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   853
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   854
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   855
% originally followed. We need something \emph{before} the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   856
% ~\else~: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   857
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   858
   \ifnum\outputpenalty=-\linenopenaltypar 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   859
     \ifnum\count@=\z@ \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   860
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   861
% So final ~\pagebreak[0]~ or ~\nopagebreak[0]~ has no 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   862
% effect---but this will make a difference after headings only, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   863
% where nobody should place such a thing anyway. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   864
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   865
       \xdef\@LN@parpgbrk{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   866
         \penalty\the\count@
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   867
         \global\let\noexpand\@LN@parpgbrk
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   868
                      \noexpand\@LN@screenoff@pen}% v4.4 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   869
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   870
% That penalty will replace former ~\kern\z@~ in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   871
% ~\linenumberpar~, see subsection_\ref{ss:calls}.---A
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   872
% few days earlier, I tried to send just a penalty value. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   873
% However, the ~\kern\z@~ in ~\linenumberpar~ is crucial, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   874
% as I then found out. See below.---The final penalty is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   875
% repeated, but this does no harm. (It would not be very 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   876
% difficult to avoid the repeating, but it may even be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   877
% less efficient.) It may be repeated due to the previous 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   878
% ~\xdef~, but it may be repeated as well below in the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   879
% present macro where artificial interline penalty is to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   880
% be overridden.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   881
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   882
     \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   883
   \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   884
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   885
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   886
%%                                        Corrected code alignment with v4.11. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   887
     \@tempcnta\outputpenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   888
     \advance\@tempcnta -\linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   889
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   890
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   891
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   892
% %        \penalty\@tempcnta
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   893
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   894
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   895
% followed previously. To give ~\nopagebreak~ a chance, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   896
% we do 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   897
%%                                        Corrected code alignment with v4.11. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   898
     \penalty \ifnum\count@<\@tempcnta \@tempcnta \else \count@ \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   899
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   900
% instead.---In ~linenox0.sty~, the ~\else~ thing once was omitted. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   901
% Sergei Mariev's complaint (thanks!) showed that it is vital 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   902
% (see comment before ~\MakeLineNo~). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   903
% The remaining ~\fi~ from previous package version closes the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   904
% ~\ifnum\outputpenalty~\dots 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   905
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   906
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   907
   \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   908
   }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   909
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   910
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   911
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   912
\newcommand\stepLineNumber{\stepcounter{linenumber}} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   913
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   914
% For reason, see use above. (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   915
%%                                   %% TODO v4.4+: ~\newcommand~ more often!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   916
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   917
% (New v4.4)   The depth preserving trick is drawn here from 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   918
% ~\MakeLineNo~ because it will be used again in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   919
% section_\ref{ss:calls}.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   920
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   921
\def\@LN@depthbox{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   922
  \dp\@tempboxa=\@tempdima
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   923
  \nointerlineskip \kern-\@tempdima \box\@tempboxa} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   924
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   925
% (/New v4.4) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   926
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   927
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   928
%               Control line numbering 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   929
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   930
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   931
%                  Inserting \scs{output} calls           %% own subsec. v4.4. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   932
%                                                     \unskip}\label{ss:calls}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   933
% The line numbering is controlled via ~\par~.  \LaTeX\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   934
% saved the \TeX-primitive ~\par~ in ~\@@par~.  We push it
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   935
% one level further out, and redefine ~\@@par~ to insert
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   936
% the ~\interlinepenalty~ needed to trigger the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   937
% line numbering. And we need to allow pagebreaks after a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   938
% paragraph. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   939
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   940
% New (2.05beta): the prevgraf test.  A paragraph that ends with a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   941
% displayed equation, a ~\noindent\par~ or ~wrapfig.sty~ produce empty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   942
% paragraphs. These should not get a spurious line number via
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   943
% ~\linenopenaltypar~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   944
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   945
\let\@@@par\@@par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   946
\newcount\linenoprevgraf
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   947
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   948
% (UL)                          And needs ~\linenoprevgraf~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   949
% to be a counter? Perhaps there may be a paragraph having 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   950
% thousands of lines, so ~\mathchardef~ doesn't suffice (really??). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   951
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   952
%%                      %% TODO: limitations of lines per paragraph elsewhere? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   953
%%                      %% Signal penalties, e.g.!? ~\deadcycles~!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   954
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   955
% A macro ending on ~\relax~ might suffice, but would be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   956
% somewhat slow. I think I will use ~\mathchardef~ next time. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   957
% Or has any user used ~\linenoprevgraf~? (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   958
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   959
%% v4.33: changed code alignment for better understanding. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   960
\def\linenumberpar{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   961
  \ifvmode \@@@par \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   962
    \ifinner \@@@par \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   963
      \xdef\@LN@outer@holdins{\the\holdinginserts}% v4.2 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   964
      \advance \interlinepenalty \linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   965
      \linenoprevgraf \prevgraf
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   966
      \global \holdinginserts \thr@@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   967
      \@@@par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   968
      \ifnum\prevgraf>\linenoprevgraf
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   969
        \penalty-\linenopenaltypar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   970
      \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   971
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   972
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   973
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   974
% %          \kern\z@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   975
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   976
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   977
% was here previously. What for? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   978
% According to \TeX book p._125, Stephan's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   979
% interline penalty is changed into 10000. At the end of a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   980
% paragraph, the ~\parskip~ would follow that penalty of 10000, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   981
% so there could be a page break neither at the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   982
% ~\parskip~ nor at the ~\baselineskip~ (\TeX book p._110)---so 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   983
% there could never be a page break between two paragraphs. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   984
% So something must screen off the 10000 penalty. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   985
% Indeed, the ~\kern~ is a place to break. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   986
% (Stephan once knew this: see `allow pagebreaks' above.)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   987
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   988
% Formerly, I tried to replace ~\kern\z@~ by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   989
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   990
% %         \penalty\@LN@parpgpen\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   991
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   992
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   993
% ---but this allows a page break after heading. So: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   994
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   995
      \@LN@parpgbrk 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   996
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   997
%% After heading, ~\kern\z@~ resulting from previous line 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   998
%% (see below) is followed by ~\write~ or ~\penalty10000~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   999
%% so causes no page break. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1000
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1001
% These and similar changes were formerly done by ~linenox1.sty~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1002
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1003
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1004
% (New v4.4) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1005
% A ~\belowdisplayskip~ may precede the previous when the paragraph 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1006
% ends on a display-math; or there may be a ~\topsep~ from a list, etc. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1007
% ~\addvspace~ couldn't take account for it with ~\kern\z@~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1008
% here. v4.32 therefore moved the space down -- with at least two 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1009
% bad consequences. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1010
% Moreover, David Josef Dev observes that ~\kern\z@~ may 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1011
% inappropriately yield column depth 0pt. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1012
% For these reasons, we introduce ~\@LN@screenoff@pen~ below. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1013
% (/New v4.4) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1014
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1015
      \global\holdinginserts\@LN@outer@holdins % v4.2
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1016
      \advance\interlinepenalty -\linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1017
    \fi     % from \ifinner ... \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1018
  \fi}      % from \ifvmode ... \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1019
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1020
% (New v4.00, v4.4) Initialize ~\@LN@parpgbrk~, accounting 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1021
% for earlier space and for appropriate columndepth. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1022
% We use former ~\MakeLineNo~'s depth-preverving trick 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1023
% ~\@LN@depthbox~ again: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1024
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1025
\def\@LN@screenoff@pen{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1026
  \ifdim\lastskip=\z@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1027
    \@tempdima\prevdepth \setbox\@tempboxa\null 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1028
    \@LN@depthbox                           \fi}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1029
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1030
\global\let\@LN@parpgbrk\@LN@screenoff@pen 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1031
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1032
% (/New v4.4, v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1033
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1034
%                  Turning on/off                         %% own subsec. v4.4.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1035
%                                                     \unskip}\label{ss:OnOff}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1036
% The basic commands to enable and disable line numbers.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1037
% ~\@par~ and ~\par~ are only touched, when they are ~\let~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1038
% to ~\@@@par~/~\linenumberpar~.  The line number may be
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1039
% reset to 1 with the star-form, or set by an optional
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1040
% argument ~[~<number>~]~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1041
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1042
% (New v4.00)        We add ~\ifLineNumbers~ etc.\ since 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1043
% a number of our new adjustments need to know whether 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1044
% linenumbering is active. This just provides a kind of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1045
% shorthand for ~\ifx\@@par\linenumberpar~; moreover it is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1046
% more stable: who knows what may happen to ~\@@par~?---A 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1047
% caveat: ~\ifLineNumbers~ may be wrong. E.g., it may be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1048
% ~\iffalse~ where it acts, while a ~\linenumbers~ a few 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1049
% lines below---in the same paragraph---brings about that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1050
% the line where the ~\ifLineNumbers~ appears gets a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1051
% marginal number. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1052
%%                                      Better implementation suggested below. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1053
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1054
% (New v4.3)        Just noticed: Such tricks have been 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1055
% disallowed with v4.11, see subsections_\ref{ss:LL} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1056
% and_\ref{ss:OnOff}.---Moreover, the switching between
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1057
% meanings of ~\linelabel~ for a possible error message 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1058
% as of v4.11 is removed. Speed is difficult to esteem 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1059
% and also depends on applications. Just use the most 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1060
% simple code you find.                      (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1061
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1062
\newif\ifLineNumbers \LineNumbersfalse 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1063
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1064
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1065
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1066
\def\linenumbers{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1067
     \LineNumberstrue                            % v4.00 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1068
     \xdef\@LN@outer@holdins{\the\holdinginserts}% v4.3 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1069
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1070
% (New v4.3) The previous line is for ~{linenomath}~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1071
% in a first numbered paragraph.         (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1072
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1073
     \let\@@par\linenumberpar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1074
 %      \let\linelabel\@LN@linelabel % v4.11, removed v4.3 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1075
     \ifx\@par\@@@par\let\@par\linenumberpar\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1076
     \ifx\par\@@@par\let\par\linenumberpar\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1077
     \@LN@maybe@moduloresume         % v4.31 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1078
     \@ifnextchar[{\resetlinenumber}%]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1079
                 {\@ifstar{\resetlinenumber}{}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1080
     }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1081
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1082
\def\nolinenumbers{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1083
  \LineNumbersfalse                              % v4.00
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1084
  \let\@@par\@@@par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1085
 %   \let\linelabel\@LN@LLerror      % v4.11, removed v4.3 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1086
  \ifx\@par\linenumberpar\let\@par\@@@par\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1087
  \ifx\par\linenumberpar\let\par\@@@par\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1088
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1089
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1090
% (New v4.00)               Moreover, it is useful to switch to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1091
% ~\nolinenumbers~ in ~\@arrayparboxrestore~. We postpone this 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1092
% to section_\ref{ss:ReDef} where we'll have an appending macro 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1093
% for doing this.                                  (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1094
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1095
% What happens with a display math?  Since ~\par~ is not executed,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1096
% when breaking the lines before a display, they will not get
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1097
% line numbers.  Sorry, but I do not dare to change
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1098
% ~\interlinepenalty~ globally, nor do I want to redefine
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1099
% the display math environments here.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1100
%   \begin{displaymath}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1101
%                       display \ math
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1102
%   \end{displaymath}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1103
% See the subsection below, for a wrapper environment to make
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1104
% it work.  But that requires to wrap each and every display
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1105
% in your \LaTeX\ source %%.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1106
%% v4.3: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1107
% (see option ~displaymath~ in subsections_\ref{ss:v3opts} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1108
% and_\ref{ss:display} for some relief [UL]). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1109
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1110
% The next two commands are provided to turn on line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1111
% numbering in a specific mode. Please note the difference:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1112
% for pagewise numbering, ~\linenumbers~ comes first to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1113
% inhibit it from seeing optional arguments, since
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1114
% re-/presetting the counter is useless. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1115
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1116
\def\pagewiselinenumbers{\linenumbers\setpagewiselinenumbers}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1117
\def\runninglinenumbers{\setrunninglinenumbers\linenumbers}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1118
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1119
% Finally, it is a \LaTeX\ style, so we provide for the use
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1120
% of environments, including the suppression of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1121
% following paragraph's indentation.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1122
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1123
%% TODO: v4.4+: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1124
% (UL)                                I am drawing the following 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1125
% private thoughts of Stephan's to publicity so that others may 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1126
% think about them---or to remind myself of them in an efficient 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1127
% way.                                                     (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1128
%% UL changed `%%%' to `% %' below. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1129
%% TODO: add \par to \linenumbers, if called from an environment. %% v4.3 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1130
%% ToDO: add an \@endpe hack if \linenumbers are turned on
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1131
%                                                  \begin{old}\begin{verbatim} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1132
% % TO DO: add \par to \linenumbers, if called from an environment.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1133
% % To DO: add an \@endpe hack if \linenumbers are turned on
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1134
% %        in horizontal mode. {\par\parskip\z@\noindent} or
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1135
% %        something.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1136
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1137
%                                                                    \end{old} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1138
% (UL)     However, I rather think that ~\linenumbers~ and        %% v4.31 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1139
% ~\nolinenumbers~ should execute a ~\par~ already. (Then the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1140
% ~\par~s in the following definitions should be removed.) (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1141
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1142
\@namedef{linenumbers*}{\par\linenumbers*}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1143
\@namedef{runninglinenumbers*}{\par\runninglinenumbers*}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1144
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1145
\def\endlinenumbers{\par\@endpetrue}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1146
\let\endrunninglinenumbers\endlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1147
\let\endpagewiselinenumbers\endlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1148
\expandafter\let\csname endlinenumbers*\endcsname\endlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1149
\expandafter\let\csname endrunninglinenumbers*\endcsname\endlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1150
\let\endnolinenumbers\endlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1151
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1152
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1153
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1154
%                  Display math
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1155
%                                                        \unskip}\label{ss:DM}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1156
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1157
% Now we tackle the problem to get display math working.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1158
% There are different options.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1159
%                                                      \begin{enumerate}\item[
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1160
% 1.]  Precede every display math with a ~\par~.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1161
%      Not too good.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1162
%                                                                       \item[
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1163
% 2.]  Change ~\interlinepenalty~ and associates globally.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1164
%      Unstable.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1165
%                                                                       \item[
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1166
% 3.]  Wrap each display math with a ~{linenomath}~  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1167
%      environment. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1168
%                                                              \end{enumerate}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1169
% We'll go for option 3.  See if it works:  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1170
% \begin{linenomath}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1171
%   \begin{equation}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1172
%      display \ math
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1173
%   \end{equation}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1174
% \end{linenomath}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1175
% The star form ~{linenomath*}~ should also number the lines
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1176
% of the display itself,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1177
% \begin{linenomath*}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1178
%   \begin{eqnarray}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1179
%     multi   && line \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1180
%     display && math \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1181
%     & 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1182
%     \begin{array}{c}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1183
%       with \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1184
%       array
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1185
%     \end{array}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1186
%     &
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1187
%   \end{eqnarray}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1188
% \end{linenomath*}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1189
% including multline displays.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1190
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1191
% First, here are two macros to turn
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1192
% on linenumbering on paragraphs preceeding displays, with
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1193
% numbering the lines of the display itself, or without.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1194
% The ~\ifx..~ tests if line numbering is turned on.  It
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1195
% does not harm to add these wrappers in sections that are
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1196
% not numbered.  Nor does it harm to wrap a display
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1197
% twice, e.q, in case you have some ~{equation}~s wrapped
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1198
% explicitely, and later you redefine ~\equation~ to do it
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1199
% automatically. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1200
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1201
% (New v4.3)  To avoid the spurious line number above a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1202
% display in vmode, I insert ~\ifhmode~.       (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1203
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1204
\newcommand\linenomathNonumbers{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1205
  \ifLineNumbers 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1206
%%  \ifx\@@par\@@@par\else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1207
    \ifnum\interlinepenalty>-\linenopenaltypar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1208
      \global\holdinginserts\thr@@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1209
      \advance\interlinepenalty \linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1210
     \ifhmode                                   % v4.3 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1211
      \advance\predisplaypenalty \linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1212
     \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1213
    \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1214
  \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1215
  \ignorespaces
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1216
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1217
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1218
\newcommand\linenomathWithnumbers{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1219
  \ifLineNumbers 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1220
%%  \ifx\@@par\@@@par\else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1221
    \ifnum\interlinepenalty>-\linenopenaltypar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1222
      \global\holdinginserts\thr@@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1223
      \advance\interlinepenalty \linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1224
     \ifhmode                                   % v4.3 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1225
      \advance\predisplaypenalty \linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1226
     \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1227
      \advance\postdisplaypenalty \linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1228
      \advance\interdisplaylinepenalty \linenopenalty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1229
    \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1230
  \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1231
  \ignorespaces
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1232
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1233
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1234
% The ~{linenomath}~ environment has two forms, with and
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1235
% without a star.  The following two macros define the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1236
% environment, where the stared/non-stared form does/doesn't number the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1237
% lines of the display or vice versa.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1238
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1239
\newcommand\linenumberdisplaymath{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1240
  \def\linenomath{\linenomathWithnumbers}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1241
  \@namedef{linenomath*}{\linenomathNonumbers}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1242
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1243
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1244
\newcommand\nolinenumberdisplaymath{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1245
  \def\linenomath{\linenomathNonumbers}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1246
  \@namedef{linenomath*}{\linenomathWithnumbers}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1247
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1248
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1249
\def\endlinenomath{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1250
  \ifLineNumbers                            % v4.3 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1251
   \global\holdinginserts\@LN@outer@holdins % v4.21 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1252
  \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1253
   \global % v4.21 support for LaTeX2e earlier than 1996/07/26. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1254
   \@ignoretrue
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1255
}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1256
\expandafter\let\csname endlinenomath*\endcsname\endlinenomath
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1257
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1258
% The default is not to number the lines of a display.  But
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1259
% the package option ~mathlines~ may be used to switch
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1260
% that behavior.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1261
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1262
\nolinenumberdisplaymath
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1263
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1264
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1265
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1266
%               Line number references
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1267
%                                                      \unskip}\label{s:LNref} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1268
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1269
%                  Internals                              %% New subsec. v4.3. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1270
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1271
% The only way to get a label to a line number in a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1272
% paragraph is to ask the output routine to mark it.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1273
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1274
% (New v4.00) The following two paragraphs don't hold any 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1275
% longer, see below. (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1276
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1277
% % We use the marginpar mechanism to hook to ~\output~ for a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1278
% % second time.  Marginpars are floats with number $-1$, we
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1279
% % fake marginpars with No $-2$. Originally, every negative
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1280
% % numbered float was considered to be a marginpar.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1281
% % 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1282
% % The float box number ~\@currbox~ is used to transfer the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1283
% % label name in a macro called ~\@LNL@~<box-number>.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1284
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1285
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1286
% A ~\newlabel~ is written to the aux-file.  The reference
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1287
% is to ~\theLineNumber~, \emph{not} ~\thelinenumber~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1288
% This allows to hook in, as done below for pagewise line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1289
% numbering. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1290
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1291
% (New v3.03) The ~\@LN@ExtraLabelItems~ are added for a hook
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1292
% to keep packages like ~{hyperref}~ happy.      (/New v3.03)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1293
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1294
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1295
% We fire the ~\marginpar~ mechanism, so we leave \LaTeX's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1296
% ~\@addmarginpar~ untouched. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1297
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1298
% % \let\@LN@addmarginpar\@addmarginpar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1299
% % \def\@addmarginpar{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1300
% %    \ifnum\count\@currbox>-2\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1301
% %      \expandafter\@LN@addmarginpar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1302
% %    \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1303
% %      \@cons\@freelist\@currbox
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1304
% %      \protected@write\@auxout{}{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1305
% %          \string\newlabel
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1306
% %             {\csname @LNL@\the\@currbox\endcsname}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1307
% %             {{\theLineNumber}{\thepage}\@LN@ExtraLabelItems}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1308
% %    \fi}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1309
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1310
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1311
% OK, we keep Stephan's ~\@LN@ExtraLabelItems~: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1312
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1313
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1314
\let\@LN@ExtraLabelItems\@empty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1315
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1316
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1317
% We imitate the ~\marginpar~ mechanism without using the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1318
% ~\@freelist~ boxes. ~\linelabel~ will indeed place a signal 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1319
% penalty (~\@Mllbcodepen~, new), and it will put a label into 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1320
% some list macro ~\@LN@labellist~. A new part of the output 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1321
% routine will take the labels from the list and will write 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1322
% ~\newlabel~s to the .aux file. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1323
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1324
% The following is a version of \LaTeX's ~\@xnext~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1325
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1326
\def\@LN@xnext#1\@lt#2\@@#3#4{\def#3{#1}\gdef#4{#2}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1327
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1328
% This takes an item ~#1~ from a list ~#4~ into ~#3~; 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1329
% to be used as ~\expandafter\@LN@xnext#4\@@#3#4~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1330
% Our lists use ~\@lt~ after each item for separating. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1331
% Indeed, there will be another list macro which can 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1332
% appear as argument ~#4~, this will be used for moving 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1333
% ~\vadjust~ items (section_\ref{ss:PVadj}). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1334
% The list for ~\linelabel~s is the following: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1335
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1336
\global\let\@LN@labellist\@empty 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1337
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1338
% The next is the new part of the output routine writing the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1339
% ~\newlabel~ to the .aux file. Since it is no real page output, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1340
% the page is put back to top of the main vertical list. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1341
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1342
\def\WriteLineNo{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1343
  \unvbox\@cclv 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1344
  \expandafter \@LN@xnext \@LN@labellist \@@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1345
                          \@LN@label \@LN@labellist 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1346
  \protected@write\@auxout{}{\string\newlabel{\@LN@label}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1347
         {{\theLineNumber}{\thepage}\@LN@ExtraLabelItems}}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1348
}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1349
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1350
% (/New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1351
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1352
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1353
%                  The \scs{linelabel} command
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1354
%                                                        \unskip}\label{ss:LL}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1355
% To refer to a place in line ~\ref{~<foo>~}~ at page
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1356
% ~\pageref{~<foo>~}~ you place a ~\linelabel{~<foo>~}~ at
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1357
% that place.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1358
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1359
%                   \linelabel{demo}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1360
%                   \marginpar{\tiny\raggedright
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1361
%                       See if it works: This paragraph
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1362
%                       starts on page \pageref{demo}, line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1363
%                       \ref{demo}.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1364
%                   \unskip}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1365
% (New v4.11) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1366
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1367
% % If you use this command outside a ~\linenumbers~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1368
% % paragraph, you will get references to some bogus
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1369
% % line numbers, sorry.  But we don't disable the command,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1370
% % because only the ~\par~ at the end of a paragraph  may
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1371
% % decide whether to print line numbers on this paragraph
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1372
% % or not.  A ~\linelabel~ may legally appear earlier than
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1373
% % ~\linenumbers~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1374
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1375
%                                                                    \end{old} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1376
% This trick is better not allowed---see subsections_\ref{ss:LL} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1377
% and_\ref{ss:OnOff}.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1378
% (/New v4.11)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1379
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1380
% ~\linelabel~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1381
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1382
% %, via a fake float number $-2$, %% new mechanism v4.00
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1383
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1384
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1385
% puts a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1386
% ~\penalty~ into a ~\vadjust~, which triggers the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1387
% pagebuilder after putting the current line to the main
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1388
% vertical list.  A ~\write~ is placed on the main vertical
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1389
% list, which prints a reference to the current value of
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1390
% ~\thelinenumber~ and ~\thepage~ at the time of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1391
% ~\shipout~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1392
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1393
% A ~\linelabel~ is allowed only in outer horizontal mode.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1394
% In outer vertical mode we start a paragraph, and ignore
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1395
% trailing spaces (by fooling ~\@esphack~).
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1396
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1397
% (New v4.00) We aim at relaxing the previous condition. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1398
% We insert a hook ~\@LN@mathhook~ and a shorthand 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1399
% ~\@LN@postlabel~ to support the ~mathrefs~ option which 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1400
% allows ~\linelabel~ in math mode. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1401
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1402
% The next paragraph is no longer valid. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1403
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1404
% % The argument of ~\linelabel~ is put into a macro with a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1405
% % name derived from the number of the allocated float box.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1406
% % Much of the rest is dummy float setup.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1407
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1408
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1409
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1410
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1411
% (New v4.11) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1412
%                                                  \begin{old}\begin{verbatim} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1413
% % \def\linelabel#1{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1414
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1415
%                                                                    \end{old} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1416
% I forgot ~\linenumbers~ today, costed me hours or so. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1417
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1418
\def\@LN@LLerror{\PackageError{lineno}{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1419
  \string\linelabel\space without \string\linenumbers}{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1420
  Just see documentation. (New feature v4.11)}\@gobble}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1421
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1422
% (New v4.3)         Here some things have changed for v4.3. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1423
% The previous ~#1~ has been replaced by ~\@gobble~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1424
% Ensuing, the ~\linelabel~ error message is re-implemented. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1425
% I find it difficult to compare efficiency of slight 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1426
% alternatives---so choose an easy one. Explicit switching 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1427
% in ~\linenumbers~ and ~\nolinenumbers~ is an additional 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1428
% command that may better be avoided. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1429
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1430
\newcommand\linelabel{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1431
  \ifLineNumbers \expandafter \@LN@linelabel 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1432
  \else          \expandafter \@LN@LLerror   \fi}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1433
%%\let\linelabel\@LN@LLerror 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1434
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1435
\gdef\@LN@linelabel#1{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1436
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1437
% ~\gdef~ for hyperref ``symbolically''. (/New v4.11) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1438
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1439
  \ifx\protect\@typeset@protect 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1440
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1441
% $\gets$ And a ~\linelabel~ should never be replicated in a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1442
% mark or a TOC entry.                           (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1443
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1444
   \ifvmode
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1445
       \ifinner \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1446
          \leavevmode \@bsphack \@savsk\p@
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1447
       \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1448
   \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1449
       \@bsphack
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1450
   \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1451
   \ifhmode
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1452
     \ifinner
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1453
       \@parmoderr
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1454
     \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1455
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1456
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1457
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1458
       \@LN@postlabel{#1}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1459
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1460
% %        \@floatpenalty -\@Mii
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1461
% %        \@next\@currbox\@freelist
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1462
% %            {\global\count\@currbox-2%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1463
% %             \expandafter\gdef\csname @LNL@\the\@currbox\endcsname{#1}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1464
% %            {\@floatpenalty\z@ \@fltovf \def\@currbox{\@tempboxa}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1465
% %        \begingroup
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1466
% %            \setbox\@currbox \color@vbox \vbox \bgroup \end@float
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1467
% %        \endgroup
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1468
% %        \@ignorefalse \@esphack
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1469
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1470
%                                                                    \end{old} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1471
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1472
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1473
       \@esphack 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1474
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1475
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1476
% The ~\@ignorefalse~ was appropriate before because the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1477
% ~\@Esphack~ in ~\end@float~ set ~\@ignoretrue~. Cf._\LaTeX's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1478
% ~\@xympar~. (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1479
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1480
     \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1481
   \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1482
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1483
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1484
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1485
     \@LN@mathhook{#1}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1486
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1487
% %     \@parmoderr
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1488
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1489
%                                                                    \end{old} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1490
% Instead of complaining, you may just do your job. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1491
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1492
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1493
   \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1494
  \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1495
   }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1496
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1497
% (New v4.00)   The shorthand just does what happened 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1498
% with ~linenox0.sty~ before ~ednmath0.sty~ (New v4.1: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1499
% now ~mathrefs~ option) appeared, and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1500
% the hook is initialized to serve the same purpose. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1501
% So errors come just where Stephan had built them in, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1502
% and this is just the \LaTeX\ ~\marginpar~ behaviour. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1503
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1504
\def\@LN@postlabel#1{\g@addto@macro\@LN@labellist{#1\@lt}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1505
       \vadjust{\penalty-\@Mllbcodepen}} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1506
\def\@LN@mathhook#1{\@parmoderr}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1507
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1508
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1509
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1510
%                                                        \modulolinenumbers[3] 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1511
%                                                          \firstlinenumber{1}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1512
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1513
%               The appearance of the line numbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1514
%                                                   \unskip}\label{appearance}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1515
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1516
%                  Basic code                             %% own subsec. v4.2. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1517
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1518
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1519
% The line numbers are set as ~\tiny\sffamily\arabic{linenumber}~,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1520
% $10pt$ left of the text.  With options to place it
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1521
% right of the text, or . . .
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1522
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1523
%      . . . here are the hooks:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1524
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1525
\def\makeLineNumberLeft{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1526
  \hss\linenumberfont\LineNumber\hskip\linenumbersep}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1527
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1528
\def\makeLineNumberRight{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1529
  \linenumberfont\hskip\linenumbersep\hskip\columnwidth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1530
  \hb@xt@\linenumberwidth{\hss\LineNumber}\hss}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1531
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1532
\def\linenumberfont{\normalfont\tiny\sffamily}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1533
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1534
\newdimen\linenumbersep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1535
\newdimen\linenumberwidth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1536
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1537
\linenumberwidth=10pt
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1538
\linenumbersep=10pt
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1539
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1540
% Margin switching requires ~pagewise~ numbering mode, but
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1541
% choosing the left or right margin for the numbers always
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1542
% works. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1543
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1544
\def\switchlinenumbers{\@ifstar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1545
    {\let\makeLineNumberOdd\makeLineNumberRight
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1546
     \let\makeLineNumberEven\makeLineNumberLeft}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1547
    {\let\makeLineNumberOdd\makeLineNumberLeft
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1548
     \let\makeLineNumberEven\makeLineNumberRight}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1549
    }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1550
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1551
\def\setmakelinenumbers#1{\@ifstar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1552
  {\let\makeLineNumberRunning#1%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1553
   \let\makeLineNumberOdd#1%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1554
   \let\makeLineNumberEven#1}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1555
  {\ifx\c@linenumber\c@runninglinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1556
      \let\makeLineNumberRunning#1%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1557
   \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1558
      \let\makeLineNumberOdd#1%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1559
      \let\makeLineNumberEven#1%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1560
   \fi}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1561
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1562
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1563
\def\leftlinenumbers{\setmakelinenumbers\makeLineNumberLeft}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1564
\def\rightlinenumbers{\setmakelinenumbers\makeLineNumberRight}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1565
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1566
\leftlinenumbers*
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1567
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1568
% ~\LineNumber~ is a hook which is used for the modulo stuff.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1569
% It is the command to use for the line number, when you
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1570
% customize ~\makeLineNumber~.  Use ~\thelinenumber~ to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1571
% change the outfit of the digits.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1572
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1573
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1574
% We will implement two modes of operation:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1575
%                                                              \begin{itemize}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1576
% \item  numbers ~running~ through (parts of) the text
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1577
% \item  ~pagewise~ numbers starting over with one on top of
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1578
%        each page.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1579
%                                                                \end{itemize}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1580
% Both modes have their own count register, but only one is
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1581
% allocated as a \LaTeX\ counter, with the attached
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1582
% facilities serving both.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1583
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1584
\newcounter{linenumber}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1585
\newcount\c@pagewiselinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1586
\let\c@runninglinenumber\c@linenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1587
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1588
% Only the running mode counter may be reset, or preset,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1589
% for individual paragraphs.  The pagewise counter must
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1590
% give a unique anonymous number for each line.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1591
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1592
% (New v4.3)                  ~\newcounter{linenumber}~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1593
% was the only ~\newcounter~ in the whole package, and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1594
% formerly I was near using ~\newcount~ instead. Yet 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1595
% ~\newcounter~ may be quite useful for ~\includeonly~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1596
% It also supports resetting ``subcounters'', but what 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1597
% could these be? Well, ~edtable~ might introduce a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1598
% subcounter for columns. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1599
% (Note that \LaTeX's setting commands would work with 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1600
% ~\newcount\c@linenumber~ already, apart from this. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1601
% And perhaps sometimes ~\refstepcounter{linenumber}~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1602
% wouldn't work---cf._my discussion of ~\stepcounter~ in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1603
% subsection_\ref{ss:MLN}, similarly ~\refstep...~ would 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1604
% be quite useless. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1605
% Even the usual redefinitions of ~\thelinenumber~ would 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1606
% work. It is nice, on the other hand, that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1607
% ~\thelinenumber~ is predefined here. \LaTeX's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1608
% initialization of the value perhaps just serves making 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1609
% clear \LaTeX\ counters should always be changed 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1610
% globally.---Shortened and improved the discussion here.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1611
% (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1612
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1613
% (New v4.22) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1614
% ~\c@linenumber~ usually is---globally---incremented by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1615
% ~\stepcounter~ (at present), so resetting it locally would 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1616
% raise the save stack problem of \TeX book p._301, moreover 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1617
% it would be is useless, there is no hope of keeping the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1618
% values local (but see subsection_\ref{ss:ILN}). So I insert 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1619
% ~\global~:        (/New v4.22) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1620
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1621
\newcommand*\resetlinenumber[1][\@ne]{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1622
  \global                             % v4.22
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1623
  \c@runninglinenumber#1\relax}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1624
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1625
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1626
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1627
% % \newcommand\resetlinenumber[1][1]{\c@runninglinenumber#1}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1628
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1629
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1630
% Added ~\relax~, being quite sure that this does no harm 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1631
% and is quite important, as with ~\setcounter~ etc. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1632
% I consider this a bug fix (although perhaps no user has 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1633
% ever had a problem with this).    (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1634
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1635
% (v4.22: I had made much fuss about resetting subordinate 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1636
% counters here---removed, somewhat postponed.)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1637
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1638
%% TODO v4.4+: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1639
%% \newcommand*\resetlinenumber[1][\@ne]{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1640
%%   \ifx\c@linenumber\c@runninglinenumber 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1641
%%     \global\c@linenumber#1\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1642
%%     \global\advance\c@linenumber\m@ne 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1643
%%     \stepLineNumber 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1644
%%   \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1645
%%     \PackageError{lineno}%% Shorthand!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1646
%%       {You can't reset line number in pagewise mode}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1647
%%       {This should suffice.}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1648
%%   \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1649
%% } 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1650
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1651
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1652
%                  Running line numbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1653
%                                                                     \unskip} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1654
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1655
% Running mode is easy,  ~\LineNumber~ and ~\theLineNumber~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1656
% produce ~\thelinenumber~, which defaults to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1657
% ~\arabic{linenumber}~, using the ~\c@runninglinenumber~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1658
% counter.  This is the default mode of operation.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1659
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1660
\def\makeRunningLineNumber{\makeLineNumberRunning}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1661
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1662
\def\setrunninglinenumbers{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1663
   \def\theLineNumber{\thelinenumber}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1664
   \let\c@linenumber\c@runninglinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1665
   \let\makeLineNumber\makeRunningLineNumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1666
   }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1667
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1668
\setrunninglinenumbers\resetlinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1669
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1670
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1671
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1672
%                  Pagewise line numbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1673
%                                                        \unskip}\label{ss:PW} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1674
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1675
% Difficult, if you think about it.  The number has to be
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1676
% printed when there is no means to know on which page it
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1677
% will end up,  except through the aux-file.  My solution  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1678
% is really expensive, but quite robust.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1679
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1680
% With version ~v2.00~ the hashsize requirements are
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1681
% reduced, because we do not need one controlsequence for
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1682
% each line any more.  But this costs some computation time
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1683
% to find out on which page we are.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1684
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1685
% ~\makeLineNumber~ gets a hook to log the line and page
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1686
% number to the aux-file.  Another hook tries to find out
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1687
% what the page offset is, and subtracts it from the counter
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1688
% ~\c@linenumber~.  Additionally, the switch
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1689
% ~\ifoddNumberedPage~ is set true for odd numbered pages,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1690
% false otherwise.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1691
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1692
\def\setpagewiselinenumbers{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1693
   \let\theLineNumber\thePagewiseLineNumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1694
   \let\c@linenumber\c@pagewiselinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1695
   \let\makeLineNumber\makePagewiseLineNumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1696
   }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1697
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1698
\def\makePagewiseLineNumber{\logtheLineNumber\getLineNumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1699
  \ifoddNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1700
     \makeLineNumberOdd
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1701
  \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1702
     \makeLineNumberEven
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1703
  \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1704
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1705
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1706
% Each numbered line gives a line to the aux file
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1707
%                                                                \begin{verse}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1708
%     ~\@LN{~<line>~}{~<page>~}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1709
%                                                                  \end{verse}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1710
% very similar to the ~\newlabel~ business, except that we need
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1711
% an arabic representation of the page number, not what
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1712
% there might else be in ~\thepage~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1713
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1714
\def\logtheLineNumber{\protected@write\@auxout{}{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1715
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1716
% (New v4.00) (UL)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1717
% As Daniel Doherty observed, the earlier line 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1718
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1719
% %    \string\@LN{\the\c@linenumber}{\noexpand\the\c@page}}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1720
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1721
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1722
% here may lead into an infinite loop when the user resets 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1723
% the page number (think of ~\pagenumbering~, e.g.). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1724
% Stephan and I brief\/ly discussed the matter and decided 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1725
% to introduce a ``physical''-page counter to which 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1726
% ~\logtheLineNumber~ refers. It was Stephan's idea to use 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1727
% ~\cl@page~ for reliably augmenting the ``physical''-page 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1728
% counter. However, this relies on the output routine once 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1729
% doing ~\stepcounter{page}~. Before Stephan's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1730
% suggestion, I had thought of appending the stepping to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1731
% \LaTeX's ~\@outputpage~.---So the macro definition ends 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1732
% as follows. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1733
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1734
   \string\@LN{\the\c@linenumber}{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1735
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1736
% (New v4.2) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1737
%%     \noexpand\number\n@LN@truepage}}} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1738
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1739
% The `truepage' counter must start with ~\c@~ so it works 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1740
% with ~\include~, and the ~\@addtoreset~ below is needed 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1741
% for the same purpose. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1742
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1743
     \noexpand\the\c@LN@truepage}}} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1744
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1745
%% \newcount\n@LN@truepage 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1746
%% \g@addto@macro\cl@page{\global\advance\n@LN@truepage\@ne}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1747
\newcount\c@LN@truepage 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1748
\g@addto@macro\cl@page{\global\advance\c@LN@truepage\@ne}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1749
\@addtoreset{LN@truepage}{@ckpt}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1750
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1751
% (/New v4.2)                I had thought of offering more 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1752
% features of a \LaTeX\ counter. However, the user should 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1753
% better \emph{not} have access to this counter. ~\c@page~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1754
% should suffice as a pagewise master counter.---To be sure, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1755
% along the present lines the user \emph{can} manipulate 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1756
% ~\c@LN@truepage~ by ~\stepcounter{page}~. E.g., she might 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1757
% do this in order to manually insert a photograph. Well, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1758
% seems not to harm. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1759
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1760
% The above usage of ~\g@addto@macro~ and ~\cl@page~ may be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1761
% not as stable as Stephan intended. His proposal used 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1762
% ~\xdef~ directly. But he used ~\cl@page~ as well, and who 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1763
% knows \dots{} And as to ~\g@addto@macro~, I have introduced 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1764
% it for list macros anyway. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1765
% (/UL) (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1766
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1767
% From the aux-file we get one macro ~\LN@P~<page> for each
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1768
% page with line numbers on it.  This macro calls four other
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1769
% macros with one argument each.  These macros are
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1770
% dynamically defined to do tests and actions, to find out
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1771
% on which page the current line number is located.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1772
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1773
% We need sort of a pointer to the first page with line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1774
% numbers, initiallized to point to nothing:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1775
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1776
\def\LastNumberedPage{first} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1777
\def\LN@Pfirst{\nextLN\relax}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1778
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1779
% The four dynamic macros are initiallized to reproduce
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1780
% themselves in an ~\xdef~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1781
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1782
\let\lastLN\relax  % compare to last line on this page
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1783
\let\firstLN\relax % compare to first line on this page
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1784
\let\pageLN\relax  % get the page number, compute the linenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1785
\let\nextLN\relax  % move to the next page
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1786
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1787
% During the end-document run through the aux-files, we
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1788
% disable ~\@LN~.  I may put in a check here later, to give
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1789
% a rerun recommendation.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1790
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1791
\AtEndDocument{\let\@LN\@gobbletwo}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1792
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1793
% Now, this is the tricky part.  First of all, the whole
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1794
% definition of ~\@LN~ is grouped, to avoid accumulation
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1795
% on the save stack. Somehow ~\csname~<cs>~\endcsname~ pushes
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1796
% an entry, which stays after an ~\xdef~ to that <cs>.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1797
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1798
% If ~\LN@P~<page> is undefined, initialize it with the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1799
% current page and line number, with the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1800
% \emph{pointer-to-the-next-page} pointing to nothing.  And
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1801
% the macro for the previous page will be redefined to point
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1802
% to the current one. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1803
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1804
% If the macro for the current page already exists, just
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1805
% redefine the \emph{last-line-number} entry.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1806
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1807
% Finally, save the current page number, to get the pointer to the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1808
% following page later.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1809
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1810
\def\@LN#1#2{{\expandafter\@@LN
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1811
                 \csname LN@P#2C\@LN@column\expandafter\endcsname
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1812
                 \csname LN@PO#2\endcsname
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1813
                 {#1}{#2}}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1814
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1815
\def\@@LN#1#2#3#4{\ifx#1\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1816
    \ifx#2\relax\gdef#2{#3}\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1817
    \expandafter\@@@LN\csname LN@P\LastNumberedPage\endcsname#1% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1818
    \xdef#1{\lastLN{#3}\firstLN{#3}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1819
            \pageLN{#4}{\@LN@column}{#2}\nextLN\relax}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1820
  \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1821
    \def\lastLN##1{\noexpand\lastLN{#3}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1822
    \xdef#1{#1}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1823
  \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1824
  \xdef\LastNumberedPage{#4C\@LN@column}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1825
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1826
% The previous page macro gets its pointer to the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1827
% current one, replacing the ~\relax~ with the cs-token
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1828
% ~\LN@P~<page>.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1829
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1830
\def\@@@LN#1#2{{\def\nextLN##1{\noexpand\nextLN\noexpand#2}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1831
                \xdef#1{#1}}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1832
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1833
% Now, to print a line number, we need to find the page,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1834
% where it resides.  This will most probably be the page where
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1835
% the last one came from, or maybe the next page.  However, it can
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1836
% be a completely different one.  We maintain a cache,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1837
% which is ~\let~ to the last page's macro.  But for now
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1838
% it is initialized to expand ~\LN@first~, where the poiner
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1839
% to the first numbered page has been stored in. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1840
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1841
\def\NumberedPageCache{\LN@Pfirst}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1842
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1843
% To find out on which page the current ~\c@linenumber~ is, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1844
% we define the four dynamic macros to do something usefull
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1845
% and execute the current cache macro.  ~\lastLN~ is run
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1846
% first, testing if the line number in question may be on a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1847
% later page.  If so, disable ~\firstLN~, and go on to the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1848
% next page via ~\nextLN~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1849
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1850
\def\testLastNumberedPage#1{\ifnum#1<\c@linenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1851
      \let\firstLN\@gobble
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1852
  \fi}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1853
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1854
% Else, if ~\firstLN~ finds out that we need an earlier
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1855
% page,  we start over from the beginning. Else, ~\nextLN~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1856
% will be disabled, and ~\pageLN~ will run
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1857
% ~\gotNumberedPage~ with four arguments: the first line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1858
% number on this column, the page number, the column 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1859
% number, and the first line on the page.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1860
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1861
\def\testFirstNumberedPage#1{\ifnum#1>\c@linenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1862
     \def\nextLN##1{\testNextNumberedPage\LN@Pfirst}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1863
  \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1864
      \let\nextLN\@gobble
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1865
      \def\pageLN{\gotNumberedPage{#1}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1866
  \fi}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1867
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1868
% We start with ~\pageLN~ disabled and ~\nextLN~ defined to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1869
% continue the search with the next page.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1870
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1871
\long\def \@gobblethree #1#2#3{}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1872
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1873
\def\testNumberedPage{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1874
  \let\lastLN\testLastNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1875
  \let\firstLN\testFirstNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1876
  \let\pageLN\@gobblethree
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1877
  \let\nextLN\testNextNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1878
  \NumberedPageCache
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1879
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1880
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1881
% When we switch to another page, we first have to make
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1882
% sure that it is there.  If we are done with the last 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1883
% page, we probably need to run \TeX\ again, but for the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1884
% rest of this run, the cache macro will just return four
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1885
% zeros. This saves a lot of time, for example if you have
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1886
% half of an aux-file from an aborted run,  in the next run
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1887
% the whole page-list would be searched in vain again and
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1888
% again for the second half of the document.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1889
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1890
% If there is another page, we iterate the search. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1891
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1892
\def\testNextNumberedPage#1{\ifx#1\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1893
     \global\def\NumberedPageCache{\gotNumberedPage0000}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1894
     \PackageWarningNoLine{lineno}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1895
                    {Linenumber reference failed,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1896
      \MessageBreak  rerun to get it right}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1897
   \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1898
     \global\let\NumberedPageCache#1%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1899
   \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1900
   \testNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1901
   }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1902
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1903
%                             \linelabel{demo2}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1904
%                             \marginpar{\tiny\raggedright
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1905
%                                 Let's see if it finds the label
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1906
%                                 on page \pageref{demo}, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1907
%                                 line \ref{demo}, and back here
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1908
%                                 on page \pageref{demo2}, line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1909
%                                 \ref{demo2}. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1910
%                             \unskip}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1911
% To separate the official hooks from the internals there is
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1912
% this equivalence, to hook in later for whatever purpose:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1913
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1914
\let\getLineNumber\testNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1915
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1916
% So, now we got the page where the number is on.  We
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1917
% establish if we are on an odd or even page, and calculate
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1918
% the final line number to be printed.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1919
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1920
\newif\ifoddNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1921
\newif\ifcolumnwiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1922
\columnwiselinenumbersfalse
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1923
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1924
\def\gotNumberedPage#1#2#3#4{\oddNumberedPagefalse
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1925
  \ifodd \if@twocolumn #3\else #2\fi\relax\oddNumberedPagetrue\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1926
  \advance\c@linenumber\@ne 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1927
  \ifcolumnwiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1928
     \subtractlinenumberoffset{#1}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1929
  \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1930
     \subtractlinenumberoffset{#4}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1931
  \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1932
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1933
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1934
% You might want to run the pagewise mode with running line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1935
% numbers, or you might not.  It's your choice:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1936
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1937
\def\runningpagewiselinenumbers{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1938
  \let\subtractlinenumberoffset\@gobble
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1939
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1940
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1941
\def\realpagewiselinenumbers{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1942
  \def\subtractlinenumberoffset##1{\advance\c@linenumber-##1\relax}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1943
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1944
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1945
\realpagewiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1946
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1947
% For line number references, we need a protected call to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1948
% the whole procedure, with the requested line number stored
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1949
% in the ~\c@linenumber~ counter.  This is what gets printed
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1950
% to the aux-file to make a label:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1951
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1952
\def\thePagewiseLineNumber{\protect 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1953
       \getpagewiselinenumber{\the\c@linenumber}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1954
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1955
% And here is what happens when the label is refered to:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1956
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1957
\def\getpagewiselinenumber#1{{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1958
  \c@linenumber #1\relax\testNumberedPage
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1959
  \thelinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1960
  }}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1961
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1962
%                                                                            %
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1963
% A summary of all per line expenses:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1964
%                                                     \begin{description}\item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1965
% [CPU:]  The ~\output~ routine is called for each line,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1966
%         and the page-search is done.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1967
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1968
% [DISK:] One line of output to the aux-file for each
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1969
%         numbered line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1970
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1971
% [MEM:]  One macro per page. Great improvement over v1.02,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1972
%         which had one control sequence per line in
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1973
%         addition.  It blew the hash table after some five
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1974
%         thousand lines. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1975
%                                                            \end{description}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1976
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1977
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1978
%                  Twocolumn mode (New v3.06)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1979
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1980
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1981
% Twocolumn mode requires another patch to the ~\output~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1982
% routine, in order to print a column tag to the .aux 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1983
% file.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1984
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1985
\AtBeginDocument{% v4.2, revtex4.cls (e.g.). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1986
 % <- TODO v4.4+: Or better in \LineNoLaTeXOutput!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1987
  \let\@LN@orig@makecol\@makecol} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1988
\def\@LN@makecol{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1989
   \@LN@orig@makecol
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1990
   \setbox\@outputbox \vbox{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1991
      \boxmaxdepth \@maxdepth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1992
      \protected@write\@auxout{}{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1993
          \string\@LN@col{\if@firstcolumn1\else2\fi}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1994
      }%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1995
      \box\@outputbox 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1996
   }% \vbox
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1997
} %% TODO cf. revtexln.sty. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1998
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1999
\def\@LN@col{\def\@LN@column} % v4.22, removed #1. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2000
\@LN@col{1}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2001
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2002
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2003
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2004
%                  Numbering modulo $m$, starting at $f$ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2005
%%                  Numbering modulo 5
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2006
%                                                       \unskip}\label{ss:Mod} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2007
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2008
% Most users want to have only one in five lines numbered.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2009
% ~\LineNumber~ is supposed to produce the outfit of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2010
% line number attached to the line,  while ~\thelinenumber~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2011
% is used also for references, which should appear even if
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2012
% they are not multiples of five.   
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2013
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2014
% (New v4.00)                   Moreover, some users want to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2015
% control which line number should be printed first. Support 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2016
% of this is now introduced here---see ~\firstlinenumber~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2017
% below.---~numline.sty~ by Michael Jaegermann and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2018
% James Fortune offers controlling which \emph{final} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2019
% line numbers should not be printed. What is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2020
% it good for? We ignore this here until some user demands 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2021
% it.---Peter Wilson's ~ledmac.sty~ offers much different 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2022
% choices of line numbers to be printed, due to Wayne Sullivan. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2023
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2024
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2025
% (New v4.22)   ~\c@linenumbermodulo~ is rendered a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2026
% fake counter, as discussed since v4.00. So it can 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2027
% no longer be set by ~\setcounter~. ~\modulolinenumbers~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2028
% serves this purpose. Well, does anybody want to do 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2029
% what worked with ~\addtocounter~? (Then please tell 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2030
% me.)---At least, ~\value~ still works. For the same 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2031
% purpose I rename the fake `firstlinenumber' counter 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2032
% ~\n@...~ to ~\c@...~.                  (/New v4.22) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2033
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2034
% % \newcount\c@linenumbermodulo % removed for v4.22 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2035
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2036
%                                                                    \end{old}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2037
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2038
%% Removed for v4.22: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2039
%% (UL)                                On my question why, e.g., 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2040
%% ~\chardef~ would not have sufficed, Stephan couldn't remember 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2041
%% exactly; guessed that he wanted to offer \LaTeX\ counter 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2042
%% facilities. However, the typical ones don't come this way. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2043
%% So I'm quite sure that I will change this next time. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2044
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2045
%% However, I observed at least two times that users gave a very 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2046
%% high value to ~\c@linenumbermodulo~ in order to suppress 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2047
%% printing of the line number. One of these users preferred an 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2048
%% own way of handling line numbers, just wanted to use 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2049
%% ~\linelabel~ and ~ednotes.sty~ features. Should we support this? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2050
%% I rather would like to advise them to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2051
%% ~\let\makeLineNumber\relax~.      (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2052
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2053
% (New v4.00)                                                             \par 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2054
% ~\themodulolinenumber~ waits for being declared 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2055
% ~\LineNumber~ by ~\modulolinenumbers~. (This has 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2056
% been so before, no change.) Here is how it 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2057
% looked before: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2058
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2059
% % \def\themodulolinenumber{{\@tempcnta\c@linenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2060
% %   \divide\@tempcnta\c@linenumbermodulo
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2061
% %   \multiply\@tempcnta\c@linenumbermodulo
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2062
% %   \ifnum\@tempcnta=\c@linenumber\thelinenumber\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2063
% %   }}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2064
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2065
%                                                                    \end{old} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2066
% (UL)                   This was somewhat slow. This arithmetic 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2067
% happens at every line. This time I tend to declare an extra 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2068
%% TODO v4.4+ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2069
% line counter (as opposed to my usual recommendations to use 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2070
% counters as rarely as possible) which is stepped every line. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2071
% It could be incremented in the same way as ~\c@LN@truepage~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2072
% is incremented via ~\cl@page~! This is another point in favour 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2073
% of ~{linenumber}~ being a \LaTeX\ counter! 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2074
% When this new counter equals ~\c@linenumbermodulo~, it is reset, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2075
% and ~\thelinenumber~ is executed.---It gets much slower by my 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2076
% support of controlling the first line number below. I should 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2077
% improve this.---On
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2078
%%                                                   %% TODO v4.4+--pagewise!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2079
% the other hand, time expense means very little nowadays, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2080
% while the number of \TeX\ counters still is limited. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2081
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2082
% For the same purpose, moreover, attaching the line number 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2083
% box could be intercepted earlier (in ~\MakeLineNo~), 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2084
% without changing ~\LineNumber~. However, this may be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2085
% bad for the latter's announcement as a wizard interface 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2086
% in section_\ref{s:UserCmds}.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2087
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2088
%% I wonder about Stephan's group. Its only effect is that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2089
%% ~\@tempcnta~ is restored after using it. What for is this? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2090
%% I tend to remove the group braces.                            %% TODO v4.4+
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2091
% (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2092
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2093
% Here is the new code. It is very near to my ~lnopatch.sty~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2094
% code which introduced the first line number feature 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2095
% before.---I add starting with a ~\relax~ which is so often 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2096
% recommended---without understanding this really. At least, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2097
% it will not harm.---Former group braces appear as 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2098
% ~\begingroup~/~\endgroup~ here. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2099
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2100
\def\themodulolinenumber{\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2101
  \ifnum\c@linenumber<\c@firstlinenumber \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2102
    \begingroup 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2103
      \@tempcnta\c@linenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2104
      \advance\@tempcnta-\c@firstlinenumber 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2105
      \divide\@tempcnta\c@linenumbermodulo
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2106
      \multiply\@tempcnta\c@linenumbermodulo
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2107
      \advance\@tempcnta\c@firstlinenumber 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2108
      \ifnum\@tempcnta=\c@linenumber \thelinenumber \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2109
    \endgroup 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2110
  \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2111
}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2112
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2113
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2114
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2115
% The user command to set the modulo counter:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2116
% (New v4.31) \dots\ a star variant is introduced to implement 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2117
% Hillel Chayim Yisraeli's idea to print the first line number 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2118
% after an interruption of the edited text by some editor's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2119
% text, regardless of the modulo. If it is 1, it is printed only 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2120
% with ~\firstlinenumber{1}~. I.e., you use ~\modulolinenumbers*~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2121
% for the new feature, without the star you get the simpler 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2122
% behaviour that we have had so far. And you can switch back 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2123
% from the refined behaviour to the simple one by using 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2124
% ~\modulolinenumbers~ without the star.---This enhancement 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2125
% is accompanied by a new package option ~modulo*~ which just 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2126
% executes ~\modulolinenumbers*~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2127
% (subsection_\ref{ss:v3opts}).---`With ~\firstlinenumber{1}~' 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2128
% exactly means: `1' is printed if and only if the last 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2129
% ~\firstlinenumber~ before or in the paragraph that follows 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2130
% the ``interruption'' has argument `1' (or something 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2131
% \emph{expanding} to `1', or (to) something that \TeX\ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2132
% ``reads'' as 1, e.g.: a \TeX\ count register storing 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2133
% 1).---At present, this behaviour may be unsatisfactory with 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2134
% pagewise line-numbering $\dots$ I'll make an experimental 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2135
% extra package if someone complains \dots
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2136
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2137
\newcommand\modulolinenumbers{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2138
  \@ifstar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2139
    {\def\@LN@maybe@moduloresume{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2140
       \global\let\@LN@maybe@normalLineNumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2141
                            \@LN@normalLineNumber}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2142
                                       \@LN@modulolinenos}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2143
    {\let\@LN@maybe@moduloresume\relax \@LN@modulolinenos}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2144
}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2145
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2146
\global\let\@LN@maybe@normalLineNumber\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2147
\let\@LN@maybe@moduloresume\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2148
\gdef\@LN@normalLineNumber{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2149
  \ifnum\c@linenumber=\c@firstlinenumber \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2150
    \ifnum\c@linenumber>\@ne
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2151
      \def\LineNumber{\thelinenumber}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2152
    \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2153
  \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2154
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2155
% ~\def~ instead of ~\let~ enables taking account of a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2156
% redefinition of ~\thelinenumber~ in a present numbering 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2157
% environment (e.g.). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2158
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2159
  \global\let\@LN@maybe@normalLineNumber\relax}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2160
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2161
% Instead of changing ~\LineNumber~ directly by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2162
% ~LN@moduloresume~, these tricks enable ~\modulolinenumbers*~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2163
% to act as locally as I can make it. I don't know how to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2164
% avoid that the output routine switches back to the normal 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2165
% modulo behaviour by a global change. (An ~\aftergroup~ may 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2166
% fail in admittedly improbable cases.)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2167
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2168
\newcommand*\@LN@modulolinenos[1][\z@]{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2169
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2170
% The definition of this macro is that of the former 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2171
% ~\modulolinenumbers~.                 (/New v4.31) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2172
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2173
  \let\LineNumber\themodulolinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2174
  \ifnum#1>\@ne 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2175
    \chardef                      % v4.22, note below 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2176
      \c@linenumbermodulo#1\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2177
  \else\ifnum#1=\@ne 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2178
%                                                  \begin{old}\begin{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2179
% %    \def\LineNumber{\thelinenumber}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2180
% \end{verbatim}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2181
%                                                                    \end{old} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2182
% (New v4.00)         I am putting something here to enable 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2183
% ~\firstlinenumber~ with $~\c@linenumbermodulo~=1$. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2184
% With ~lnopatch.sty~, a trick was offered for this purpose. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2185
% It is now obsolete. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2186
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2187
    \def\LineNumber{\@LN@ifgreat\thelinenumber}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2188
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2189
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2190
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2191
  \fi\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2192
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2193
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2194
% (New v4.00)                The default of ~\@LN@ifgreat~ is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2195
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2196
\let\@LN@ifgreat\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2197
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2198
% The previous changes as soon as ~\firstlinenumber~ is used: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2199
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2200
\newcommand*\firstlinenumber[1]{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2201
  \chardef\c@firstlinenumber#1\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2202
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2203
% No counter, little values allowed only---OK?---(UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2204
% The change is local---OK? The good thing is that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2205
% ~\global\firstlinenumber{~<number>~}~ works. Moreover, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2206
% ~\modulolinenumbers~ acts locally as well.    (/UL)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2207
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2208
% (New v4.31) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2209
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2210
  \let\@LN@ifgreat\@LN@ifgreat@critical} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2211
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2212
\def\@LN@ifgreat@critical{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2213
  \ifnum\c@linenumber<\c@firstlinenumber 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2214
    \expandafter \@gobble 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2215
  \fi}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2216
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2217
% (/New v4.31) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2218
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2219
% The default 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2220
% value of ~\c@firstlinenumber~                                %% v4.31 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2221
% is 0. This is best for what one would expect from modulo 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2222
% printing. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2223
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2224
\let\c@firstlinenumber=\z@
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2225
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2226
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2227
% For usage and effects of ~\modulolinenumbers~ and            %% v4.31 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2228
% ~\firstlinenumbers~, please consult section_\ref{s:UserCmds}. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2229
% Two details on ~\firstlinenumbers~ here: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2230
% (i)_~\firstlinenumber~ acts on a paragraph if and only if 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2231
% (a)_the paragraph is broken into lines ``in line-numbering 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2232
% mode'' (after ~\linenumbers~, e.g.); 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2233
% (b)_it is the last occurrence of a ~\firstlinenumbers~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2234
% before or in the paragraph. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2235
% (The practical applications of this that I can imagine 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2236
% don't seem appealing to me.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2237
% Cf._the explanation above of how ~\modulolinenumbers~ and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2238
% ~\firstlinenumbers~ interact---for this and for (ii), 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2239
% which is concerned with possible arguments for 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2240
% ~\firstlinenumbers~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2241
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2242
% Note that the line numbers of the present section 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2243
% demonstrate the two devices.         (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2244
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2245
%%\setcounter{linenumbermodulo}{5}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2246
\chardef\c@linenumbermodulo=5      % v4.2; ugly? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2247
\modulolinenumbers[1]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2248
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2249
% (New v4.22)       The new implementation through ~\chardef~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2250
% decreases the functionality and raises certain compatibility 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2251
% problems. I face this without fear. The maximum modulo value 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2252
% is now ~255~. I expect that this suffices for usual applications. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2253
% However, some users have ``abused'' ~lineno.sty~ to get 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2254
% ~ednotes.sty~ features without line numbers, so have set the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2255
% modulo to a value beyond the total number of lines in their 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2256
% edition. This ought to be replaced by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2257
% ~\let\makeLineNumber\relax~.          (/New v4.22) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2258
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2259
%                                                                   \section{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2260
%               Package options
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2261
%                                                       \unskip}\label{s:Opts} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2262
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2263
% (New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2264
% The last heading formerly was the heading of what is now 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2265
% subsection_\ref{ss:v3opts}. The options declared there were 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2266
% said to execute user commands only. This was wrong already 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2267
% concerning ~displaymath~ and ~hyperref~. At least, however, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2268
% these options were no or almost no occasion to skip definitions 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2269
% or allocations. This is different with the options that we now 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2270
% insert. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2271
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2272
%% (New v4.2)   v4.00 moved the ``options'' below the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2273
%% ``extensions''. This was bad with ~\do@mlineno~ in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2274
%% subsection_\ref{ss:v3opts} which is to control 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2275
%% subsection_\ref{ss:display}---undone here.  (/New v4.2) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2276
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2277
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2278
%               Extended referencing to line numbers. (v4.2)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2279
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2280
% This subsection explains and declares package option ~addpageno~.   %% v4.31
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2281
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2282
% If a line to whose number you refer by ~\ref~ is not on the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2283
% present page, it may be useful to add the number of the page 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2284
% on which the line occurs---and perhaps it should not be added 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2285
% otherwise. In general, you could use the Standard \LaTeX\ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2286
% package varioref for this. However, the latter usually 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2287
% produces verbose output like `on the preceding page'---
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2288
% unless costumized---, while in critical editions, e.g., one 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2289
% may prefer just adding the page number and some mark on the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2290
% left of the line number, irrespectively of how far the page is 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2291
% apart etc. To support this, package option ~addpageno~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2292
% provides a command ~\vpagelineref~ to be used in place of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2293
% ~\ref~. This produces, e.g., `34.15' when referring to line_15 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2294
% on page_34 while the present page is not 34. You can customize 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2295
% the outcome, see the package file ~vplref.sty~ where the code 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2296
% and further details are. You may conceive of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2297
% ~\vpagelineref~ as a certain customization of varioref's 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2298
% ~\vref~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2299
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2300
% This implies that option ~addpageno~ requires the files 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2301
% ~vplref.sty~ and ~varioref.sty~. ~addpageno~ automatically 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2302
% loads both of them. Yet you can also load ~varioref.sty~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2303
% on your own to use its package options. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2304
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2305
% Of course, you might better introduce a shorter command name 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2306
% for ~\vpagelineref~ for your work, while we cannot predict 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2307
% here what shorthand will fit your work. E.g., 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2308
% ~\newcommand{\lref}{\vpagelineref}~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2309
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2310
% If you really want to add the page number in \emph{any} case, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2311
% use, e.g., some ~\myref~ instead of ~\ref~, after 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2312
%   \[~newcommand*{\myref}{\pageref{#1}.\ref{#1}}~\] 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2313
% or what you like. You don't need the ~addpageno~ option in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2314
% this case. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2315
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2316
% ~addpageno~ is due to a suggestion by Sergei Mariev. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2317
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2318
\DeclareOption{addpageno}{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2319
  \AtEndOfPackage{\RequirePackage{vplref}[2005/04/25]}} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2320
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2321
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2322
%               \scs{linelabel} in math mode 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2323
%                                                   \unskip}\label{ss:MathRef}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2324
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2325
% We have made some first steps towards allowing ~\linelabel~ in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2326
% math mode. Because our code for this is presently experimental, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2327
% we leave it to the user to decide for the experiment by calling 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2328
% option ~mathrefs~. We are in a hurry now and thus leave the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2329
% code, explanations, and discussion in the separate package 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2330
% ~ednmath0.sty~. Maybe we later find the time to improve the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2331
% code and move the relevant content of ~ednmath0.sty~ to here. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2332
% The optimal situation would be to define ~\linelabel~ from 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2333
% the start so it works in math mode, omitting the ~mathrefs~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2334
% option. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2335
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2336
% Actually, this package even provides adjustments for analogously 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2337
% allowing ~ednotes.sty~ commands in math mode. Loading the package 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2338
% is postponed to ~\AtBeginDocument~ when we know whether these 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2339
% adjustments are needed. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2340
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2341
\DeclareOption{mathrefs}{\AtBeginDocument 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2342
  {\RequirePackage{ednmath0}[2004/08/20]}} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2343
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2344
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2345
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2346
%               Arrays, tabular environments (Revised v4.11)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2347
%                                                       \unskip}\label{ss:Tab} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2348
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2349
% This subsection explains and declares package options               %% v4.31
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2350
% ~edtable~, ~longtable~, and ~nolongtablepatch~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2351
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2352
% The standard \LaTeX\ tabular environments come as single 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2353
% boxes, so the ~lineno.sty~ versions before v4.00 treated them as 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2354
% (parts of) single lines, printing (at most) one line number 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2355
% beside each and stepping the line number counter once only. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2356
% Moreover, ~\linelabel~s got lost. Of course, tables are 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2357
% usually so high that you will want to treat each row like a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2358
% line. (Christian Tapp even desires that the lines of table 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2359
% entries belonging to a single row are treated like ordinary 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2360
% lines.) Footnotes get lost in such environments as well, which 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2361
% was bad for ~ednotes.sty~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2362
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2363
% We provide adjustments to count lines, print their numbers 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2364
% etc.\ as desired at least for \emph{some} \LaTeX\ tabular 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2365
% environments. (Like with other details, ``some'' is to some 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2366
% extent explained in ~edtable.sty~.) We do this similarly as 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2367
% with option ~mathrefs~ before.               We leave code 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2368
% and explanations in the separate package ~edtable.sty~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2369
% (For wizards: this package provides adjustments for 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2370
% ~ednotes.sty~ as well. However, in the present case we don't try 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2371
% to avoid them unless ~ednotes.sty~ is loaded.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2372
% Package option ~edtable~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2373
% defines---by loading ~edtable.sty~---an environment ~{edtable}~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2374
% which is able to change some \LaTeX\ tabular environments 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2375
% with the desired effects. (v4.11: ~edtable.sty~ v1.3 counts 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2376
% \LaTeX's ~{array}~ [etc.\@] as a ``tabular environment'' as 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2377
% well.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2378
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2379
% The ~{edtable}~ environment doesn't help with ~longtable.sty~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2380
% however. To make up for this, ~{longtable}~ is adjusted in a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2381
% different way---and this happens only when another ~lineno.sty~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2382
% option ~longtable~ is called. In this case, option ~edtable~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2383
% needn't be called explicitly: option ~longtable~ works as if 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2384
% ~edtable~ had been called. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2385
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2386
% Now, we are convinced that vertical spacing around 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2387
% ~{longtable}~ works wrongly---see \LaTeX\ bugs database 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2388
% tools/3180 and 3485, or see explanations in the package 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2389
% ~ltabptch.sty~ (which is to be obtained from CTAN folder
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2390
% \path{macros/latex/ltabptch}). Our conviction is so strong
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2391
% that the ~longtable~ option loads---after ~longtable.sty~---the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2392
% patch package ~ltabptch.sty~. If the user doesn't want this
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2393
% (maybe preferring her own arrangement with the vertical 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2394
% spacing), she can forbid it by calling ~nolongtablepatch~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2395
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2396
% The following code just collects some choices, which are 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2397
% then executed in section_\ref{ss:ExOpt}. We use an ~\if...~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2398
% without ~\newif~ since ~\if...true~ and ~\if...false~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2399
% would occur at most two times and only within the present 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2400
% package. (~\AtEndOfClass{\RequirePackage{edtable}}~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2401
% could be used instead, I just overlooked this. Now I don't 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2402
% change it because it allows to change the version requirement 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2403
% at one place only.)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2404
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2405
\let\if@LN@edtable\iffalse 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2406
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2407
\DeclareOption{edtable}{\let\if@LN@edtable\iftrue}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2408
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2409
\DeclareOption{longtable}{\let\if@LN@edtable\iftrue 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2410
  \PassOptionsToPackage{longtable}{edtable}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2411
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2412
\DeclareOption{nolongtablepatch}{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2413
  \PassOptionsToPackage{nolongtablepatch}{edtable}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2414
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2415
% (/New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2416
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2417
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2418
%               Switch among settings 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2419
%                                                    \unskip}\label{ss:v3opts}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2420
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2421
% There is a bunch of package options that execute                     %% v4.2 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2422
%% There is a bunch of package options, all of them executing 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2423
%% executing only user commands (see below). %% Cf. start of section. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2424
% user commands only. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2425
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2426
% Options ~left~ (~right~) put the line numbers on the left
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2427
% (right) margin.  This works in all modes.  ~left~ is the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2428
% default.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2429
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2430
\DeclareOption{left}{\leftlinenumbers*}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2431
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2432
\DeclareOption{right}{\rightlinenumbers*}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2433
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2434
% Option ~switch~ (~switch*~) puts the line numbers on the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2435
% outer (inner) margin of the text.   This requires running
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2436
% the pagewise mode,  but we turn off the page offset
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2437
% subtraction, getting sort of running numbers again.  The
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2438
% ~pagewise~ option may restore true pagewise mode later.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2439
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2440
\DeclareOption{switch}{\setpagewiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2441
                       \switchlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2442
                       \runningpagewiselinenumbers}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2443
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2444
\DeclareOption{switch*}{\setpagewiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2445
                        \switchlinenumbers*%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2446
                        \runningpagewiselinenumbers}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2447
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2448
% In twocolumn mode, we can switch the line numbers to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2449
% the outer margin, and/or start with number 1 in each
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2450
% column.  Margin switching is covered by the ~switch~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2451
% options.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2452
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2453
\DeclareOption{columnwise}{\setpagewiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2454
                           \columnwiselinenumberstrue
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2455
                           \realpagewiselinenumbers}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2456
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2457
% The options ~pagewise~ and ~running~ select the major
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2458
% linenumber mechanism.  ~running~ line numbers refer to a real
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2459
% counter value, which can be reset for any paragraph,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2460
% even getting  multiple paragraphs on one page starting
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2461
% with line number one.  ~pagewise~ line numbers get a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2462
% unique hidden number within the document,  but with the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2463
% opportunity to establish the page on which they finally
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2464
% come to rest.  This allows the subtraction of the page
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2465
% offset, getting the numbers starting with 1 on top of each
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2466
% page, and margin switching in twoside formats becomes
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2467
% possible.  The default mode is ~running~.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2468
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2469
% The order of declaration of the options is important here
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2470
% ~pagewise~ must come after ~switch~, to overide running
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2471
% pagewise mode. ~running~ comes last, to reset the running
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2472
% line number mode, e.g, after selecting margin switch mode
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2473
% for ~pagewise~ running.  Once more, if you specify all
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2474
% three of the options ~[switch,pagewise,running]~, the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2475
% result is almost nothing, but if you later say
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2476
% ~\pagewiselinenumbers~,  you get margin switching, with
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2477
% real pagewise line numbers.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2478
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2479
\DeclareOption{pagewise}{\setpagewiselinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2480
                         \realpagewiselinenumbers}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2481
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2482
\DeclareOption{running}{\setrunninglinenumbers}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2483
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2484
% The option ~modulo~ causes only those linenumbers to be
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2485
% printed which are multiples of five. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2486
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2487
\DeclareOption{modulo}{\modulolinenumbers\relax}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2488
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2489
% Option ~modulo*~ modifies ~modulo~ in working like 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2490
% ~\modulolinenumbers*~---see section_\ref{s:UserCmds}. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2491
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2492
\DeclareOption{modulo*}{\modulolinenumbers*\relax}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2493
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2494
% The package option ~mathlines~ switches the behavior of
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2495
% the ~{linenomath}~ environment with its star-form.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2496
% Without this option, the ~{linenomath}~ environment does
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2497
% not number the lines of the display, while the star-form
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2498
% does.  With this option, its just the opposite.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2499
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2500
%%% 1999-06-10: renamed ~displaymath~ to ~mathlines~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2501
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2502
\DeclareOption{mathlines}{\linenumberdisplaymath}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2503
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2504
% ~displaymath~ now calls for wrappers of the standard 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2505
% \LaTeX\ display math environment.  This was previously 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2506
% done by ~mlineno.sty~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2507
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2508
% (New v4.3) Option `displaymath' becomes default according 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2509
% to Erik \mbox{Luijten}'s suggestion. I was finally convinced 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2510
% of this as soon as I discovered how to avoid a spurious line 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2511
% number above ~\begin{linenomath}~ (subsection_\ref{ss:DM}). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2512
% ~\endlinenomath~ provides ~\ignorespaces~, so what could go 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2513
% wrong now? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2514
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2515
\DeclareOption{displaymath}{\PackageWarningNoLine{lineno}{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2516
                Option [displaymath] is obsolete -- default now!}} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2517
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2518
%%\let\do@mlineno\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2519
%%\DeclareOption{displaymath}{\let\do@mlineno\@empty}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2520
% (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2521
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2522
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2523
%               Compatibility with \texttt{hyperref}      %% own subsec. v4.3. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2524
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2525
% The ~hyperref~ package, via ~nameref~, requires three more 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2526
% groups in the second argment of a ~\newlabel~.  Well, why 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2527
% shouldn't it get them?  (New v3.07) The presence of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2528
% ~nameref~ package is now detected automatically
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2529
% ~\AtBeginDocument~. (/New v3.07) (Fixed in v3.09)  We try
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2530
% to be smart, and test ~\AtBeginDocument~ if the ~nameref~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2531
% package is loaded, but ~hyperref~ postpones the loading of
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2532
% ~nameref~ too, so this is all in vain.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2533
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2534
% (New v4.3)  But we can also test at the first ~\linelabel~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2535
% Regarding the error-message for misplaced ~\linelabel~ from v4.11: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2536
% previously, ~\linenumbers~ rendered ~\linelabel~ the genuine 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2537
% version of ~\linelabel~ from the start on. This doesn't work 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2538
% now, since ~\@LN@linelabel~ may change its meaning after the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2539
% first ~\linenumbers~ and before a next one (if there is some). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2540
%     (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2541
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2542
\DeclareOption{hyperref}{\PackageWarningNoLine{lineno}{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2543
                Option [hyperref] is obsolete. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2544
  \MessageBreak The hyperref package is detected automatically.}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2545
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2546
\AtBeginDocument{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2547
  \@ifpackageloaded{nameref}{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2548
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2549
% (New v4.3)  ``Global'' is merely ``symbolic'' ~\AtBeginDoc...~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2550
% If ~nameref~ is not detected here, the next ~\@LN@linelabel~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2551
% will do almost the same, then globally indeed. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2552
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2553
    \gdef\@LN@ExtraLabelItems{{}{}{}}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2554
  }{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2555
    \global\let\@LN@@linelabel\@LN@linelabel 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2556
    \gdef\@LN@linelabel{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2557
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2558
% ~\@ifpackageloaded~ is ``preamble only'', its---very 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2559
% internal---preamble definition is replicated here: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2560
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2561
     \expandafter 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2562
      \ifx\csname ver@nameref.sty\endcsname\relax \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2563
        \gdef\@LN@ExtraLabelItems{{}{}{}}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2564
      \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2565
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2566
% Now aim at the ``usual'' behaviour: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2567
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2568
      \global\let\@LN@linelabel\@LN@@linelabel 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2569
      \global\let\@LN@@linelabel\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2570
      \@LN@linelabel
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2571
    }% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2572
  }%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2573
} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2574
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2575
% (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2576
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2577
% (New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2578
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2579
%               A note on calling so many options 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2580
%                                                                     \unskip} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2581
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2582
% The number of package options may stimulate worrying about how to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2583
% \emph{enter} all the options that one would like to use---they may 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2584
% not fit into one line. Fortunately, you can safely break code lines 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2585
% after the commas separating the option names in the ~\usepackage~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2586
% command (no comment marks needed). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2587
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2588
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2589
%               Execute options
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2590
%                                                     \unskip}\label{ss:ExOpt}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2591
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2592
% We stop declaring options and execute the ones that are 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2593
% called by the user.       (/New v4.1)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2594
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2595
\ProcessOptions
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2596
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2597
% (New v4.1)        Now we know whether ~edtable.sty~ is wanted 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2598
% and (if it is) with which options it is to be called. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2599
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2600
\if@LN@edtable \RequirePackage{edtable}[2005/03/07] \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2601
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2602
% (/New v4.1) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2603
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2604
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2605
%               Former package extensions 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2606
%                                                         \label{s:Xt}\unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2607
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2608
% The extensions in this section were previously supplied 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2609
% in separate ~.sty~ files. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2610
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2611
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2612
%              $display math$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2613
%                                                   \unskip}\label{ss:display}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2614
%% (New v4.32) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2615
% (New v4.3)    From now on, you no longer need to type 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2616
% the ~{linenomath}~ environment with the ~\[~, ~{equation}~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2617
% and ~{eqnarray}~ environments---and you no longer need to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2618
% use the former package option ~displaymath~ for this feature. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2619
%                                                   (/New v4.3) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2620
%% (/New v4.32) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2621
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2622
%  The standard \LaTeX\ display math environments are
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2623
%  wrapped in a ~{linenomath}~ environment.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2624
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2625
% (New 3.05)  The ~[fleqn]~ option of the standard
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2626
% \LaTeX\ classes defines the display math
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2627
% environments such that line numbers appear just
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2628
% fine.  Thus, we need not do any tricks when
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2629
% ~[fleqn]~ is loaded, as indicated by presents of
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2630
% the ~\mathindent~ register.           (/New 3.05)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2631
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2632
% (New 3.05a)  for ~{eqnarray}~s we rather keep the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2633
% old trick.                            (/New 3.05a)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2634
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2635
% (New 3.08) Wrap ~\[~ and ~\]~ into ~{linenomath}~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2636
% instead of ~{displaymath}~.  Also save the definition
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2637
% of ~\equation~, instead of replicating the current 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2638
% \LaTeX\ definition.                    (/New 3.08)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2639
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2640
%%\ifx\do@mlineno\@empty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2641
 \@ifundefined{mathindent}{
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2642
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2643
%% \AtBeginDocument{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2644
  \let\LN@displaymath\[%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2645
  \let\LN@enddisplaymath\]%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2646
  \renewcommand\[{\begin{linenomath}\LN@displaymath}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2647
  \renewcommand\]{\LN@enddisplaymath\end{linenomath}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2648
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2649
  \let\LN@equation\equation
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2650
  \let\LN@endequation\endequation
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2651
  \renewenvironment{equation}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2652
     {\linenomath\LN@equation}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2653
     {\LN@endequation\endlinenomath}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2654
%% }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2655
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2656
 }{}% \@ifundefined{mathindent} -- 3rd arg v4.2, was \par! 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2657
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2658
%%\AtBeginDocument{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2659
  \let\LN@eqnarray\eqnarray
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2660
  \let\LN@endeqnarray\endeqnarray
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2661
  \renewenvironment{eqnarray}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2662
     {\linenomath\LN@eqnarray}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2663
     {\LN@endeqnarray\endlinenomath}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2664
%%}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2665
  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2666
%%\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2667
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2668
% (UL)        Indeed. The \LaTeX\ macros are saved for 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2669
% unnumbered mode, which is detected by ~\linenomath~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2670
% (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2671
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2672
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2673
%      Line numbers in internal vertical mode
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2674
%                                                       \unskip}\label{ss:ILN}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2675
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2676
% The command ~\internallinenumbers~ adds line numbers in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2677
% internal vertical mode, but with limitations: we assume
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2678
% fixed baseline skip.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2679
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2680
% (v4.22)       v3.10 provided a global (~\global\advance~) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2681
% as well as a local version (star-form, using 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2682
% ~\c@internallinenumber~). ~\resetlinenumbers~ acted 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2683
% locally and was here used with the global version---save 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2684
% stack danger, \TeX book p._301---in v4.00 I 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2685
% disabled the global version therefore. Now I find that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2686
% it is better to keep a global version, and the now global 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2687
% ~\resetlinenumbers~ is perfect for this. The global version 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2688
% allows continuing the ``internal'' numbers in the ensuing 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2689
% ``external'' text, and---unless reset by brackets 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2690
% argument---continuing the above series of line numbers. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2691
% As with v3.10, the local version always starts with 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2692
% line number one. A new ~\@LN@iglobal~ steps ~\global~ly 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2693
% in the global version, otherwise it is ~\relax~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2694
% (I also remove all my stupid discussions as of v4.00. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2695
% And I use ~\newcommand~.)     (v4.22)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2696
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2697
\let\@LN@iglobal\global                           % v4.22 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2698
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2699
\newcommand\internallinenumbers{\setrunninglinenumbers 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2700
     \let\@@par\internallinenumberpar
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2701
     \ifx\@par\@@@par\let\@par\internallinenumberpar\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2702
     \ifx\par\@@@par\let\par\internallinenumberpar\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2703
     \ifx\@par\linenumberpar\let\@par\internallinenumberpar\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2704
     \ifx\par\linenumberpar\let\par\internallinenumberpar\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2705
     \@ifnextchar[{\resetlinenumber}%]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2706
                 {\@ifstar{\let\c@linenumber\c@internallinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2707
                           \let\@LN@iglobal\relax % v4.22
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2708
                           \c@linenumber\@ne}{}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2709
     }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2710
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2711
\let\endinternallinenumbers\endlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2712
\@namedef{internallinenumbers*}{\internallinenumbers*}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2713
\expandafter\let\csname endinternallinenumbers*\endcsname\endlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2714
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2715
\newcount\c@internallinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2716
\newcount\c@internallinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2717
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2718
\newcommand\internallinenumberpar{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2719
     \ifvmode\@@@par\else\ifinner\@@@par\else\@@@par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2720
     \begingroup
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2721
        \c@internallinenumbers\prevgraf
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2722
        \setbox\@tempboxa\hbox{\vbox{\makeinternalLinenumbers}}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2723
        \dp\@tempboxa\prevdepth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2724
        \ht\@tempboxa\z@
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2725
        \nobreak\vskip-\prevdepth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2726
        \nointerlineskip\box\@tempboxa
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2727
     \endgroup 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2728
     \fi\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2729
     }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2730
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2731
\newcommand\makeinternalLinenumbers{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2732
   \ifnum\c@internallinenumbers>\z@               % v4.2
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2733
   \hb@xt@\z@{\makeLineNumber}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2734
   \@LN@iglobal                                   % v4.22 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2735
     \advance\c@linenumber\@ne
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2736
   \advance\c@internallinenumbers\m@ne
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2737
   \expandafter\makeinternalLinenumbers\fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2738
   }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2739
 % TODO v4.4+: star: line numbers right!? cf. lnocapt.sty
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2740
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2741
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2742
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2743
%      Line number references with offset
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2744
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2745
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2746
% This extension defines macros to refer to line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2747
% numbers with an offset, e.g., to refer to a line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2748
% which cannot be labeled directly (display math).
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2749
% This was formerly knows as ~rlineno.sty~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2750
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2751
% To refer to a pagewise line number with offset:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2752
%                                                                \begin{quote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2753
%   ~\linerefp[~<OFFSET>~]{~<LABEL>~}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2754
%                                                                  \end{quote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2755
% To refer to a running line number with offset:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2756
%                                                                \begin{quote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2757
%   ~\linerefr[~<OFFSET>~]{~<LABEL>~}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2758
%                                                                  \end{quote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2759
% To refer to a line number labeled in the same mode as currently
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2760
% selected:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2761
%                                                                \begin{quote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2762
%   ~\lineref[~<OFFSET>~]{~<LABEL>~}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2763
%                                                                  \end{quote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2764
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2765
\newcommand\lineref{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2766
  \ifx\c@linenumber\c@runninglinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2767
     \expandafter\linerefr
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2768
  \else
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2769
     \expandafter\linerefp
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2770
  \fi
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2771
}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2772
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2773
\newcommand*\linerefp[2][\z@]{{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2774
   \let\@thelinenumber\thelinenumber
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2775
   \edef\thelinenumber{\advance\c@linenumber#1\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2776
                       \noexpand\@thelinenumber}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2777
   \ref{#2}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2778
}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2779
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2780
% This goes deep into \LaTeX's internals.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2781
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2782
\newcommand*\linerefr[2][\z@]{{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2783
   \def\@@linerefadd{\advance\c@linenumber#1}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2784
   \expandafter\@setref\csname r@#2\endcsname
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2785
   \@linerefadd{#2}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2786
}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2787
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2788
\newcommand*\@linerefadd[2]{\c@linenumber=#1\@@linerefadd\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2789
                            \thelinenumber}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2790
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2791
%%                           TODO v4.4+: Insert `LN' in internal command names? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2792
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2793
%                                                                 \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2794
%      Numbered quotation environments
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2795
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2796
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2797
% The ~{numquote}~ and ~{numquotation}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2798
% environments are like ~{quote}~ and
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2799
% ~{quotation}~, except there will be line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2800
% numbers.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2801
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2802
% An optional argument gives the number to count
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2803
% from.  A star ~*~ (inside or outside the closing
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2804
% ~}~) prevent the reset of the line numbers.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2805
% Default is to count from one.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2806
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2807
% (v4.22: A local version using ~\c@internallinenumber~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2808
% might be useful, see subsection_\ref{ss:ILN}.)                 %% TODO v4.4+
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2809
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2810
\newcommand\quotelinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2811
   {\@ifstar\linenumbers{\@ifnextchar[\linenumbers{\linenumbers*}}}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2812
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2813
\newdimen\quotelinenumbersep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2814
\quotelinenumbersep=\linenumbersep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2815
\let\quotelinenumberfont\linenumberfont
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2816
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2817
\newcommand\numquotelist
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2818
   {\leftlinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2819
    \linenumbersep\quotelinenumbersep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2820
    \let\linenumberfont\quotelinenumberfont
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2821
    \addtolength{\linenumbersep}{-\@totalleftmargin}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2822
    \quotelinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2823
   }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2824
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2825
\newenvironment{numquote}     {\quote\numquotelist}{\endquote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2826
\newenvironment{numquotation} {\quotation\numquotelist}{\endquotation}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2827
\newenvironment{numquote*}    {\quote\numquotelist*}{\endquote}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2828
\newenvironment{numquotation*}{\quotation\numquotelist*}{\endquotation}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2829
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2830
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2831
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2832
%      Frame around a paragraph
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2833
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2834
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2835
% The ~{bframe}~ environment draws a frame around
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2836
% some text, across page breaks, if necessary.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2837
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2838
% This works only for plain text paragraphs,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2839
% without special height lines. All lines must be
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2840
% ~\baselineskip~ apart, no display math.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2841
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2842
\newenvironment{bframe}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2843
  {\par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2844
   \@tempdima\textwidth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2845
   \advance\@tempdima 2\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2846
   \setbox\bframebox\hb@xt@\textwidth{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2847
      \hskip-\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2848
      \vrule\@width\bframerule\@height\baselineskip\@depth\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2849
      \advance\@tempdima-2\bframerule
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2850
      \hskip\@tempdima
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2851
      \vrule\@width\bframerule\@height\baselineskip\@depth\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2852
      \hskip-\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2853
   }%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2854
   \hbox{\hskip-\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2855
         \vrule\@width\@tempdima\@height\bframerule\@depth\z@}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2856
   \nointerlineskip
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2857
   \copy\bframebox
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2858
   \nobreak
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2859
   \kern-\baselineskip
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2860
   \runninglinenumbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2861
   \def\makeLineNumber{\copy\bframebox\hss}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2862
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2863
  {\par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2864
   \kern-\prevdepth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2865
   \kern\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2866
   \nointerlineskip
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2867
   \@tempdima\textwidth
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2868
   \advance\@tempdima 2\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2869
   \hbox{\hskip-\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2870
         \vrule\@width\@tempdima\@height\bframerule\@depth\z@}%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2871
  }
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2872
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2873
\newdimen\bframerule
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2874
\bframerule=\fboxrule
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2875
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2876
\newdimen\bframesep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2877
\bframesep=\fboxsep
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2878
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2879
\newbox\bframebox
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2880
 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2881
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2882
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2883
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2884
%               Move \scs{vadjust} items (New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2885
%                                                      \unskip}\label{s:MVadj} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2886
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2887
% This section completes reviving ~\pagebreak~, ~\nopagebreak~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2888
% ~\vspace~, and the star and optional form of ~\\~. This was 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2889
% started in section_\ref{ss:output} and resumed in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2890
% section_\ref{ss:MLN} and subsection_\ref{ss:calls}.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2891
% The problem was explained in section_\ref{ss:output}: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2892
% ~\vadjust~ items come out at a bad position, and the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2893
% \LaTeX\ commands named before work with ~\vadjust~ indeed. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2894
% Our solution was sketched there as well. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2895
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2896
% According to the caveat in subsection_\ref{ss:OnOff} concerning
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2897
% ~\ifLineNumbers~, the \LaTeX\ commands enumerated may go 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2898
% wrong if you switch line numbering inside or at the end of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2899
% a paragraph. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2900
%%                                                               %% TODO v4.4+
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2901
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2902
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2903
%               Redefining \scs{vadjust}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2904
%                                                     \unskip}\label{ss:PVadj}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2905
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2906
% ~\vadjust~ will temporarily be changed into the following 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2907
% command. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2908
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2909
\def\PostponeVadjust#1{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2910
  \global\let\vadjust\@LN@@vadjust 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2911
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2912
% This undoes a ~\global\let\vadjust\PostponeVadjust~ which will 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2913
% start each of the refined \LaTeX\ commands. The ~\global~s 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2914
% are most probably superfluous. They might be useful should one 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2915
% ~\vadjust~ appear in a group starting after the change of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2916
% ~\vadjust~ into ~\PostponeVadjust~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2917
% (UL) Even the undoing may be superfluous, cf._discussion 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2918
% in section_\ref{ss:ReDef} below.  (UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2919
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2920
  \vadjust{\penalty-\@Mppvacodepen}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2921
  \g@addto@macro\@LN@vadjustlist{#1\@lt}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2922
}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2923
\let\@LN@@vadjust\vadjust 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2924
\global\let\@LN@vadjustlist\@empty 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2925
\global\let\@LN@do@vadjusts\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2926
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2927
% These ~\global~s are just to remind that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2928
% all the changes of the strings after ~\let~ should be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2929
% ~\global~ (\TeX book p._301). ~\@LN@vadjustlist~ collects 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2930
% the ~\vadjust~ items of a paragraph. ~\PassVadjustList~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2931
% tears one ~\vadjust~ item for the current line out of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2932
% ~\@LN@vadjustlist~ and puts it into ~\@LN@do@vadjusts~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2933
% The latter is encountered each line in ~\MakeLineNo~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2934
% (section_\ref{ss:MLN}), while those \LaTeX\ ~\vadjust~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2935
% commands will come rather rarely. So I decided that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2936
% ~\@LN@do@vadjust~ is ~\relax~ until a ~\vadjust~ item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2937
% is waiting. In the latter case, ~\@LN@do@vadjusts~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2938
% is turned into a list macro which resets itself to 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2939
% ~\relax~ when the other contents have been placed in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2940
% the vertical list.---~\PassVadjustList~ is invoked by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2941
% the output routine (section_\ref{ss:output}), so the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2942
% ~\box255~ must be put back. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2943
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2944
\def\PassVadjustList{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2945
  \unvbox\@cclv 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2946
  \expandafter \@LN@xnext \@LN@vadjustlist \@@ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2947
                          \@tempa \@LN@vadjustlist 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2948
  \ifx\@LN@do@vadjusts\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2949
    \gdef\@LN@do@vadjusts{\global\let\@LN@do@vadjusts\relax}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2950
  \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2951
  \expandafter \g@addto@macro \expandafter \@LN@do@vadjusts 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2952
    \expandafter {\@tempa}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2953
} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2954
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2955
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2956
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2957
%               Redefining the \LaTeX\ commands 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2958
%                                                     \unskip}\label{ss:ReDef}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2959
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2960
% Now we change ~\pagebreak~ etc.\ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2961
% so that they use ~\PostponeVadjust~ in place of ~\vadjust~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2962
% We try to do this as independently as possible of the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2963
% implementation of the \LaTeX\ commands to be redefined. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2964
% Therefore, we don't just copy macro definition code from any 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2965
% single implementation (say, latest \LaTeX) and insert our 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2966
% changes, but attach a conditional 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2967
% ~\global\let\vadjust\PostponeVadjust~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2968
% to their left ends in a way which should work rather 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2969
% independantly of their actual code. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2970
% However, ~\vadjust~ should be the primitive again after 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2971
% execution of the command. So the ~\global\let...~ may be used 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2972
% only if it's guaranteed that a ~\vadjust~ is near.---(UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2973
% Sure? In line numbering mode, probably each ~\vadjust~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2974
% coming from a \LaTeX\ command should be ~\PostponeVadjust~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2975
% ~\marginpar~s and floats seem to be the only cases which 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2976
% are not explicitly dealt with in the present section. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2977
% This would be a way to avoid ~\@LN@nobreaktrue~! 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2978
% Of course, the ~\vadjust~s that the present package uses 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2979
% then must be replaced by ~\@LN@@vadjust~.---Maybe 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2980
% next time.      (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2981
%%                                                               %% TODO v4.4+ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2982
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2983
% The next command and something else will be added to the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2984
% \LaTeX\ commands we are concerned with here. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2985
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2986
\DeclareRobustCommand\@LN@changevadjust{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2987
  \ifvmode\else\ifinner\else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2988
    \global\let\vadjust\PostponeVadjust 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2989
  \fi\fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2990
} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2991
 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2992
% (UL) What about math mode? Math display? Warn? (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2993
%%                                                               %% TODO v4.4+
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2994
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2995
% ~\@tempa~ will now become a two place macro which adds first 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2996
% argument (single token), enclosed by ~\ifLineNumbers~\,\dots
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2997
% ~\fi~ to the left of second argument. As long as we need it, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2998
% we can't use the star form of ~\DeclareRobustCommand~ or 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2999
% the like, because AMS-\LaTeX\ uses ~\@tempa~ for ~\@ifstar~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3000
% (New v4.41) And for the same reason, that ~\CheckCommand*~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3001
% had to be raised! (/New v4.41)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3002
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3003
\CheckCommand*\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3004
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3005
\def\@tempa#1#2{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3006
  \expandafter \def \expandafter#2\expandafter{\expandafter
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3007
    \ifLineNumbers\expandafter#1\expandafter\fi#2}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3008
} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3009
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3010
% (UL)              This ~\ifLineNumber~ can be fooled by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3011
% ~\linenumbers~ ahead etc. It might be better to place 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3012
% a signal penalty in any case and let the output routine 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3013
% decide what to do. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3014
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3015
%% And when this has been done, remove warnings about this. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3016
% (/UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3017
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3018
% We use the occasion to switch off linenumbers where they 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3019
% don't work anyway and where we don't want them, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3020
% especially in footnotes: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3021
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3022
\@tempa\nolinenumbers\@arrayparboxrestore 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3023
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3024
% We hope this suffices $\dots$ let's check one thing 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3025
% at least: [(New v4.41) see ~\CheckCommand~ above (/New v4.41)]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3026
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3027
% Now for the main theme of the section. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3028
% The next lines assume that ~\vspace~, ~\pagebreak~, and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3029
% ~\nopagebreak~ use ~\vadjust~ whenever they occur outside 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3030
% vertical mode; moreover, that they don't directly read 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3031
% an argument. Indeed ~\pagebreak~ and ~\nopagebreak~ first 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3032
% call something which tests for a left bracket ahead, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3033
% while ~\vspace~ first tests for a star. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3034
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3035
\@tempa\@LN@changevadjust\vspace 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3036
\@tempa\@LN@changevadjust\pagebreak 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3037
\@tempa\@LN@changevadjust\nopagebreak 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3038
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3039
% ~\\~, however, uses ~\vadjust~ only in star or optional form. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3040
% We relax independency of implementation in assuming 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3041
% that ~\@normalcr~ is the fragile version of ~\\~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3042
% (and we use ~\@ifstar~!). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3043
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3044
%% \@ifstar reimplemented 1995/10/16, but seems to be much older. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3045
%% TODO v4.4+: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3046
%% \def\@LN@cr{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3047
%%   \@ifnextchar*{\@LN@changevadjust\@normalcr}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3048
%%      {\@ifnextchar[{\@LN@changevadjust\@normalcr}\@normalcr}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3049
%% } 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3050
%% ---same number of tokens, expansion step less. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3051
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3052
% (Using a copy of ~\\~ would be safer, but an ugly repetition 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3053
% of ~\protect~.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3054
%%                                                               %% TODO v4.4+ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3055
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3056
\DeclareRobustCommand\\{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3057
  \ifLineNumbers 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3058
    \expandafter \@LN@cr 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3059
  \else 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3060
    \expandafter \@normalcr 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3061
  \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3062
} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3063
\def\@LN@cr{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3064
  \@ifstar{\@LN@changevadjust\@normalcr*}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3065
          {\@ifnextchar[{\@LN@changevadjust\@normalcr}\@normalcr}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3066
} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3067
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3068
% Moreover we hope that ~\newline~ never leads to a ~\vadjust~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3069
% although names of some commands invoked by ~\\~ contain 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3070
% ~newline~. At last, this seems to have been OK since 1989 or 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3071
% even earlier. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3072
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3073
%                                                        \modulolinenumbers[1]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3074
%                                                          \firstlinenumber{0} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3075
% Let's have a few tests.\vspace*{.5\baselineskip} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3076
% Testing ~\pagebreak~ and ~\nopagebreak~ would be too expensive 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3077
% here, but---oops!---we have just experienced a successful 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3078
% ~\vspace*{.5\baselineskip}~. A 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3079
% ~\\*[.5\baselineskip]~\\*[.5\baselineskip] may look even more 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3080
% drastical, but this time we are happy about it. Note that the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3081
% line numbers have moved with the lines. Without our changes, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3082
% one line number\vadjust{\kern.5\baselineskip} would have 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3083
% ``anticipated'' the move of the next line, just as you can 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3084
% observe it now. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3085
% (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3086
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3087
%                                                           \switchlinenumbers 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3088
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3089
%                                                                \subsection{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3090
%               Reminder on obsoleteness 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3091
%                                                                     \unskip} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3092
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3093
% (New v4.1)    We have completed inclusion of the earlier 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3094
% extension packages ~linenox0.sty~, ~linenox1.sty~, and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3095
% ~lnopatch.sty~. If one of them is loaded, though, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3096
% we produce an error message before something weird happens. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3097
% We avoid ~\newif~ because the switchings occur so rarely. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3098
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3099
\AtBeginDocument{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3100
  \let\if@LN@obsolete\iffalse 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3101
  \@ifpackageloaded{linenox0}{\let\if@LN@obsolete\iftrue}\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3102
  \@ifpackageloaded{linenox1}{\let\if@LN@obsolete\iftrue}\relax 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3103
  \@ifpackageloaded{lnopatch}{\let\if@LN@obsolete\iftrue}\relax
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3104
  \if@LN@obsolete 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3105
    \PackageError{lineno}{Obsolete extension package(s)}{% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3106
    With lineno.sty version 4.00 or later,\MessageBreak 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3107
    linenox0/linenox1/lnopatch.sty must no longer be loaded.}% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3108
  \fi 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3109
} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3110
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3111
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3112
%                                                        \modulolinenumbers[1]
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3113
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3114
%               The final touch
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3115
%                                                                     \unskip}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3116
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3117
% There is one deadcycle for each line number.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3118
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3119
\advance\maxdeadcycles 100
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3120
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3121
\endinput
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3122
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3123
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3124
%                                                                   \section{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3125
%               The user commands
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3126
%                                                   \unskip}\label{s:UserCmds} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3127
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3128
% The user commands to turn on and off line numbering 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3129
% are 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3130
%                                                     \begin{description}\item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3131
% [|\linenumbers]                                                       \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3132
%     Turn on line numbering in the current mode.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3133
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3134
%                                                                        \item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3135
% [|\linenumbers*]                                              \ \par$\qquad$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3136
%        and reset the line number to 1.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3137
%                                                      \def\NL{<number>]}\item 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3138
%%                         %% Boldface italic occurs here, which is evil. (UL) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3139
% [|\linenumbers[\NL]                                           \ \par$\qquad$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3140
%        and start with <number>.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3141
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3142
% [|\nolinenumbers]                                                     \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3143
%     Turn off line numbering.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3144
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3145
% [|\runninglinenumbers*[\NL]                                           \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3146
%     Turn on ~running~ line numbers, with the same optional
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3147
%     arguments as ~\linenumbers~.  The numbers are running
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3148
%     through the text over pagebreaks.  When you turn
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3149
%     numbering off and on again, the numbers will continue,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3150
%     except, of cause, if you ask to reset or preset the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3151
%     counter.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3152
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3153
% [|\pagewiselinenumbers]                                               \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3154
%     Turn on ~pagewise~ line numbers.  The lines on each
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3155
%     page are numbered beginning with one at the first
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3156
%     ~pagewise~ numbered line.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3157
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3158
% [|\resetlinenumber[\NL]                                               \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3159
%     Reset ~[~Set~]~ the line number to 1
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3160
%     ~[~<number>~]~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3161
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3162
% [|\setrunninglinenumbers]                                             \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3163
%     Switch to ~running~ line number mode. Do \emph{not}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3164
%     turn it on or off.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3165
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3166
% [|\setpagewiselinenumbers]                                            \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3167
%     Switch to ~pagewise~ line number mode. Do \emph{not}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3168
%     turn it on or off.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3169
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3170
% [|\switchlinenumbers*]                                                \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3171
%     Causes margin switching in pagewise modes. With the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3172
%     star,  put the line numbers on the inner margin.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3173
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3174
% [|\leftlinenumbers*]                                                  \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3175
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3176
% [|\rightlinenumbers*]                                                 \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3177
%     Set the line numbers in the left/right margin. With the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3178
%     star this works for both modes of operation, without
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3179
%     the star only for the currently selected mode. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3180
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3181
% [|\runningpagewiselinenumbers]                                        \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3182
%     When using the pagewise line number mode,  do not
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3183
%     subtract the page offset.  This results in running
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3184
%     line numbers again,  but with the possibility to switch
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3185
%     margins.  Be careful when doing line number
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3186
%     referencing,  this mode status must be the same while
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3187
%     setting the paragraph and during references.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3188
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3189
% [|\realpagewiselinenumbers]                                           \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3190
%     Reverses the effect of ~\runningpagewiselinenumbers~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3191
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3192
% [|\modulolinenumbers[\NL]                                             \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3193
%     Give a number only to lines which are multiples of
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3194
%     ~[~<number>~]~.  If <number> is not specified, the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3195
%     current value in the counter ~linenumbermodulo~ is
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3196
%     retained.  <number>=1 turns this off without changing
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3197
%     ~linenumbermodulo~.  The counter is initialized to 5.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3198
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3199
%%                               %% TODO v4.4+: `counter', he says. Cf._above. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3200
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3201
%%                                                                 (New v4.31) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3202
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3203
% [|\modulolinenumbers*[\NL]                                            \ \par 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3204
%     Like ~\modulolinenumbers~, the only difference being 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3205
%     that the first line number after a ~\linenumbers~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3206
%     (or ~\runninglinenumbers~, ~\pagewiselinenumbers~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3207
%     ~\quotelinenumbers~) is printed regardless of the 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3208
%     modulo---yet `1' is printed only after (or \dots) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3209
%     ~\firstlinenumber{1}~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3210
%     This also applies to the first line of a 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3211
%     ~{linenumbers}~ or respective environment. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3212
%     See subsection_\ref{ss:Mod} for another explanation. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3213
%     The behaviour may be unsatisfactory with pagewise 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3214
%     line-numbering. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3215
%%                                                                (/New v4.31) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3216
%%                                                                 (New v4.00)
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3217
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3218
% [|\firstlinenumber]                                                   \ \par 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3219
%     ~\firstlinenumber{~<filino>~}~ brings about that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3220
%     (after it) line numbers less than <filino> do 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3221
%     \emph{not} appear in the margin. Moreover, with 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3222
%     ~\modulolinenumbers[~<number>~]~, just the line 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3223
%     numbers which are <filino> plus a multiple of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3224
%     <number> are printed.---If you had 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3225
%     ~\firstlinenumber{~<pos>~}~ with some $\mbox{<pos>}>0$ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3226
%     and want to switch to printing multiples of, e.g., 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3227
%     4, you best do ~\modulolinenumbers[4]~ and 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3228
%     ~\firstlinenumber{0}~. (See subsection_\ref{ss:Mod} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3229
%     for technical details.) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3230
%%                                                                (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3231
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3232
% [|\linenumberdisplaymath]                                             \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3233
%     Number the lines of a display math in a ~{linenomath}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3234
%     environment, but do not in a ~{linenomath*}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3235
%     environment.  This is used by the package option
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3236
%     ~[mathlines]~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3237
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3238
% [|\nolinenumberdisplaymath]                                           \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3239
%     Do not Number the lines of a display math in a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3240
%     ~{linenomath}~ environment, but do in a
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3241
%     ~{linenomath*}~ environment.  This is the default.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3242
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3243
% [|\linelabel]                                                         \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3244
%     Set a ~\linelabel{~<foo>~}~ to the line number where
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3245
%     this commands is in.  Refer to it with the \LaTeX\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3246
%     referencing commands ~\ref{~<foo>~}~ and
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3247
%     ~\pageref{~<foo>~}~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3248
%                                                            \end{description}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3249
% The commands can be used globally, locally within groups
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3250
% or as environments.  It is important to know that they 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3251
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3252
%%                                                %% TODO: \linelabel? others? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3253
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3254
% take action only when the ~\par~ is executed.  The
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3255
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3256
%%                     %% TODO: sure? ~\modulo...~, e.g.? well, in a sense ... 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3257
%%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3258
% ~\end{~<mode>~linenumbers}~ commands provide a ~\par~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3259
% Examples:
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3260
%                                                                \begin{verse}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3261
%   ~{\linenumbers~  <text> ~\par}~                                         \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3262
%                                                                         \ \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3263
%   ~\begin{linenumbers}~                                                   \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3264
%       <text>                                                              \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3265
%   ~\end{linenumbers}~                                                     \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3266
%                                                                         \ \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3267
%   <paragraph> ~{\linenumbers\par}~                                        \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3268
%                                                                         \ \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3269
%   ~\linenumbers~                                                          \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3270
%     <text> ~\par~                                                         \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3271
%   ~\nolinenumbers~                                                        \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3272
%                                                                         \ \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3273
%   ~\linenumbers~                                                          \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3274
%   <paragraph> ~{\nolinenumbers\par}~                                      \\
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3275
%                                                                  \end{verse}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3276
% (New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3277
% However, the examples containing <paragraph> show what you 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3278
% should \emph{not} do, at least if you use ~\pagebreak~, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3279
% ~\nopagebreak~, ~\vspace~, ~\\*~ or 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3280
% ~\\[~<space>~]~---cf._section_\ref{s:MVadj}. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3281
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3282
% The same care should be applied to the ``wizard'' devices 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3283
% ~\ifLineNumbers~ (subsection_\ref{ss:OnOff}) and
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3284
% ~\PostponeVadjust~ (section_\ref{ss:PVadj}). 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3285
%  (/New v4.00) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3286
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3287
% (New v4.11) Oh, and the commands and environments of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3288
% section_{s:Xt} are missing. Sorry, I am in a hurry now. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3289
% May be next time.%                                             %% TODO v4.4+ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3290
% ---And the  environments ~{linenomath}~ and ~{linenomath*}~should 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3291
% get an own paragraph. In short, each math display, equation, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3292
% or ~{eqnarray}~ should be ``wrapped'' in one of ~{linenomath}~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3293
% and ~{linenomath*}~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3294
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3295
%                                                                \subsection{%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3296
%                 Customization hooks
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3297
%                                                                     \unskip} 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3298
% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3299
% There are several hooks to customize the appearance of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3300
% line numbers, and some low level hooks for special
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3301
% effects. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3302
%                                                     \begin{description}\item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3303
% [|\thelinenumber]                                                     \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3304
%     This macro should give the representation of the line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3305
%     number in the \LaTeX-counter ~linenumber~.  The
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3306
%     default is provided by \LaTeX:                              \par$\qquad$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3307
%         ~\arabic{linenumber}~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3308
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3309
% [|\makeLineNumberLeft]                                                \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3310
%     This macro is used to attach a line number to the left
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3311
%     of the text page.  This macro should fill an ~\hbox to 0pt~ 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3312
%     which will be placed at the left margin of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3313
%     page, with the reference point aligned to the line to
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3314
%     which it should give a number.  Please use the macro
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3315
%     ~\LineNumber~ to refer to the line number. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3316
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3317
%     The default definition is                                   \par$\qquad$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3318
%         ~\hss\linenumberfont\LineNumber\hskip\linenumbersep~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3319
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3320
% [|\makeLineNumberRight]                                               \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3321
%     Like ~\makeLineNumberLeft~, but for line numbers on
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3322
%     the right margin.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3323
%
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3324
%     The default definition is                                   \par$\qquad$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3325
%        ~\linenumberfont\hskip\linenumbersep\hskip\textwidth~    \par$\qquad$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3326
%        ~\hbox to\linenumberwidth{\hss\LineNumber}\hss~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3327
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3328
% [|\linenumberfont]                                                    \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3329
%     This macro is initialized to                                \par$\qquad$
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3330
%         ~\normalfont\tiny\sffamily~
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3331
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3332
% [|\linenumbersep]                                                     \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3333
%     This dimension register sets the separation of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3334
%     linenumber to the text. Default value is ~10pt~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3335
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3336
% [|\linenumberwidth]                                                   \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3337
%     This dimension register sets the width of the line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3338
%     number box on the right margin.  The distance of the
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3339
%     right edge of the text to the right edge of the line
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3340
%     number is ~\linenumbersep~ + ~\linenumberwidth~. The
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3341
%     default value is ~10pt~.  
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3342
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3343
% [|\theLineNumber] (for wizards)                                       \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3344
%     This macro is called for printing a ~\newlabel~ entry
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3345
%     to the aux-file.  Its definition depends on the mode.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3346
%     For running line numbers it's just ~\thelinenumber~,
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3347
%     while in pagewise mode, the page offset subtraction
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3348
%     is done in here.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3349
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3350
% [|\makeLineNumber] (for wizards)                                      \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3351
%     This macro produces the line numbers.  The definition
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3352
%     depends on the mode.  In the running line numbers
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3353
%     mode it just expands ~\makeLineNumberLeft~.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3354
%                                                                        \item
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3355
% [|\LineNumber] (for wizards)                                          \ \par
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3356
%     This macro is called by ~\makeLineNumber~ to typeset
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3357
%     the line number.  This hook is changed by the modulo
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3358
%     mechanism 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3359
%%                                                                        %%%.
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3360
%     and by ~\firstlinenumber~. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3361
%%                                                                %% New v4.00 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3362
%                                                            \end{description}
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3363
%% 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3364
%% TODO: \stepLineNumber---another wizard command!? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3365
%% Not sure, may be retreated. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3366
%                                                             \end{document}%D
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3367
------------------------------------------------------------------------------
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3368
                                                                       %SSTOPP
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3369
%% TODO v4.4+:  Check for unwanted comment marks in new comments 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3370
%%             (resulting from manual aligning): search `New v4.2' 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3371
%%             and/or ` % '! 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3372
%% TODO v4.4+:  Check for missing comment marks where a paragraph 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3373
%%             should end/start. Also to prevent empty "code" lines. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3374
%%             Especially, new comments at section ends must be 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3375
%%             followed by comment mark lines. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3376
%%             And prevent ~\par~s from blank lines in definitions! 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3377
%%             See `visual space' above. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3378
%%             For proper appearance in lineno.tex, note that a comment 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3379
%%             in a final code line changes behaviour. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3380
%% TODO v4.4+:  Require README for redistribution? 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3381
%% TODO v4.4+:  Since discussions of code have increased so much, it 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3382
%%             would be appropriate not to give to this file 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3383
%%             extension `.sty' (e.g., `dty'!??). ?? Is quickly read though! 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3384
%%             A .sty extraction may be possible even if the present 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3385
%%             file is neither a .doc nor a .dtx. (!???) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3386
%%             Use awk line below (etc.) for .doc at least; + .ins or so. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3387
%%                 ^ must not be caps! To escape awk. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3388
%% TODO v4.4+:  Underfull lines!? (due to long code quotations) 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3389
%% TODO v4.4+:  Sometimes paragraph indents may be appropriate. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3390
%% TODO        Swap first line (`\iffalse...') with corresponding below. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3391
               Or do *not* swap, maybe nawk is more reliable. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3392
%% TODO v4.4+:  Ponder Stephan's mail from 2004/09/02. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3393
%% TODO v4.4+: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3394
%% use \@ET@makeLineNumber. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3395
%% plus almost all `(UL)' 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3396
%% plus lots of bad boxes messages 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3397
%% change v4.3 TODOs when postponed 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3398
%% remove {old} environments. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3399
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3400
------------------------------------------------------------------------------
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3401
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3402
# awk command lines for v4.00, mixed with former ones: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3403
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3404
echo "Don't bother about unknown 'iffalse'."                  # SHELL1 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3405
nawk '/A[W]K/' lineno.sty | nawk -f - lineno.sty >lineno.tex; # SHELL1
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3406
latex lineno; latex lineno; latex lineno; latex lineno;       # SHELL1
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3407
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3408
BEGIN{DOC=-1;                                     # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3409
 BEGINCODE = "\\begin{code}\\begin{verbatim}";    # AWK
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3410
 ENDCODE   = "\\end{verbatim}\n\\end{code}";   }  # AWK
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3411
 BEGINCODE = "%    \\begin{macrocode}";           #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3412
 ENDCODE   = "%    \\end{macrocode}";          }  #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3413
/^[ \t]*$/ { ECNT++; next; }                      # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3414
/\\documentclass/{ sub("article","ltxdoc") }      #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3415
/%D$/      { sub("^%* *",""); sub("%D$","");      #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3416
             print > "lineno.drv"; next        }  #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3417
/^%%/      { next; }                              # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3418
/^%/       { if (!DOC) { print ENDCODE; }         # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3419
             DOC=1; ECNT=0;                       # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3420
             sub("^% *","");                      # AWK
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3421
             sub("^% *","% ");                    #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3422
             print; next;                      }  # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3423
/%VERSION/ { sub("%VERSION",""); print; next; }   # AWK 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3424
/%SSTOPP/  { exit }                               # AWK 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3425
DOC<0      { next }                               # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3426
/^-+-$/    { if (!DOC) print ENDCODE; exit }      # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3427
{ if (DOC) { ECNT=DOC=0; print BEGINCODE; }       # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3428
  while (ECNT>0) { print " "; ECNT--; }           # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3429
  print $0;                                    }  # AWK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3430
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3431
# New v4.00, UL: know nothing about awk; found present solution 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3432
# in hours of trial and error. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3433
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3434
% Earlier (should be inhibited by %SSTOPP above and otherwise): 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3435
echo "expect errors for unknown commands 'iffalse' and 'fi'";# SHELL0 SHELL#1 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3436
awk '/A[W]K/' lineno.sty | awk -f - lineno.sty >lineno.tex;  # SHELL0
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3437
latex lineno; latex lineno; latex lineno; latex lineno;      # SHELL0
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3438
nawk '/A[W]K/' lineno4.sty | nawk -f - lineno4.sty >lineno4.tex;  # SHELL#1
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3439
latex lineno4; latex lineno4; latex lineno4; latex lineno4;       # SHELL#1
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3440
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3441
awk '/DOC A [W] K/' lineno.sty | awk -f - lineno.sty >lineno.doc; # DOC SH
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3442
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3443
BEGIN{DOC=-1;                                     # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3444
 BEGINCODE = "\\begin{code}\\begin{verbatim}";    # A#WK
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3445
 ENDCODE   = "\\end{verbatim}\n\\end{code}";   }  # A#WK
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3446
 BEGINCODE = "%    \\begin{macrocode}";           #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3447
 ENDCODE   = "%    \\end{macrocode}";          }  #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3448
/^[ \t]*$/ { ECNT++; next; }                      # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3449
/\\documentclass/{ sub("article","ltxdoc") }      #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3450
/%D$/      { sub("^%* *",""); sub("%D$","");      #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3451
             print > "lineno.drv"; next        }  #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3452
/^%%/      { next; }                              # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3453
/^%/       { if (!DOC) { print ENDCODE; }         # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3454
             DOC=1; ECNT=0;                       # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3455
             sub("^% *","");                      # A#WK
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3456
             sub("^% *","% ");                    #     DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3457
             print; next;                      }  # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3458
DOC<0      { next }                               # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3459
/^-+-$/    { if (!DOC) print ENDCODE; exit }      # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3460
{ if (DOC) { ECNT=DOC=0; print BEGINCODE; }       # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3461
  while (ECNT>0) { print " "; ECNT--; }           # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3462
  print $0;                                    }  # A#WK DOC A W K
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3463
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3464
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3465
------------------------------------------------------------------------------
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3466
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3467
If you are looking here because of the two top lines of the file: 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3468
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3469
A .tex documentation of this macro file can be obtained by 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3470
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3471
    sh lineno.sty 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3472
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3473
under UNIX.--You may find this hint little helpful. One 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3474
reason may be that the awk versions to which you have access 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3475
don't work suitably. Another reason may be that you don't have 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3476
access to UNIX (in some sense). However, a .tex, .dvi, or .pdf 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3477
version of such a documentation should be available from CTAN, 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3478
in the same folder as the present file. When we typed this, that 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3479
folder was /macros/latex/contrib/lineno. If this has changed in 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3480
the meantime, a CTAN search should lead you to a folder 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3481
containing such a documentation. Or you may get help from one of 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3482
the e-mail addresses above. 
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3483
c346c156a7cd completes the recipie on antiquotations
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  3484