Received: by nummer-3.proteosys id <01C19443.462823FC@nummer-3.proteosys>; Thu, 3 Jan 2002 11:42:00 +0100 MIME-Version: 1.0 x-vm-v5-data: ([nil nil nil nil nil nil nil t nil][nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C19443.462823FC" X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: counts.tex Date: Mon, 2 Sep 1991 01:00:00 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: Sender: "LaTeX-L Mailing list" To: "Rainer M. Schoepf" Reply-To: "LaTeX-L Mailing list" Status: R X-Status: X-Keywords: X-UID: 373 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19443.462823FC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable \chapter{Support for accurate page-selection from {\tt dvi} files} \label{counts} \section{Objectives} Although I assume that it is open to anyone writing style-files to do whatever they like with the 10 \verb+\count+ registers \cite[p.\ 119]{knuth-90}, I think that it would be worth trying to set a good precedent in the \LaTeX\ 3.0 \lq\lq standard styles''. I therefore = suggest that there should be a scheme for using the \verb+\count+ registers in = such a way that pages can always be specified unambiguously in those {\tt report}-like and {\tt book}-like documents that have: \begin{itemize} \item roman-numbered \lq\lq front matter'' followed by arabic-numbered body text, and/or \item pages numbered \lq\lq within chapters''. \end{itemize} In practice, I have the impression that documents which have pages = numbered \lq\lq within chapters'' are in a minority. It may therefore be worth having a scheme that can be used selectively, i.e, such that, if a = style-file writer knows that it will be important to distinguish between certain units of a document but not between others, the \verb+\count+s for the = former can have the non-zero values given by the scheme, while those for the latter can be zero. This would make for consistency (i.e., if a \verb+\count+ is non-zero, then it would be used in the same way in one standard style-file as in another) without unnecessary clutter (e.g., if all \verb+\count+ registers but \verb+\count0+ can be set zero without ambiguity, the user would get monitoring of the form {\tt [1] [2] [3] = [4] ..\ } rather than of the form {\tt [1.1.1] [2.1.1] [3.1.1] [4.1.1] ...\ = }). \section{A scheme} \label{a-scheme} The following scheme would probably achieve the objectives suggested = above. \begin{center} \begin{footnotesize} \begin{tabular}{lllll} \hline\hline Major division & Minor = divisions&\verb+\count0+&\verb+\count1+&\verb+\count2+\\ \hline\hline Front matter & --- & page-number & {\tt -1} & {\tt 0} = \\ \hline Main text & chapters & page-number & chapter-number & {\tt = 0} \\ & & & {\tt 1, 2, ... }& = \\ \hline Back matter: & appendices &page-number&appendix number& = {\tt 1}\\ appendices & & & {\tt 1, 2, ... }& = \\ \hline Back matter: & glossary, &page-number&other-unit & {\tt = 2}\\ other units & bibliography, & &number = \\ & index, etc. & & {\tt 1, 2, ... } = \\ \hline\hline \end{tabular} \end{footnotesize} \end{center} \subsection*{Examples} \begin{enumerate} \item A pamphlet that is numbered in arabic throughout would only use \verb+\count0+. \item A traditional book could have \verb+\count1+ set to {\tt -1} in the front matter and set to {\tt 0} thereafter. \item A manual that is to be numbered in the style of DEC's VAX/VMS = manuals would use the full scheme, i.e. \begin{itemize} \item \verb+\count2+ set to {\tt 1} within the appendices and set to {\tt 2} after the appendices \item \verb+\count1+ set to {\tt -1} in the front matter, set to \lq\lq chapter number'' within the body text, set to \lq\lq appendix number'' or \lq\lq other-unit number'' in the \lq\lq back matter''. \item \verb+\count0+ reset at the start of each chapter and each unit of \lq\lq back matter''. \end{itemize} \item It would be open to someone producing a style-file for a \lq\lq traditional book'' to increment \verb+\count1+ and \verb+\count2+ in the way suggested for \lq\lq a manual'' above, even though \verb+\count0+ would {\em not} be reset at the start of each chapter. Although (after the \lq\lq front matter'') = neither \verb+\count1+ nor \verb+\count2+ would affect the printed page-numbers, their settings would, for example, enable someone \begin{itemize} \item using DVItoVDU \cite{trevorrow-86} to give a command that means \lq\lq go to the start of chapter 2'' \item using {\tt dviselect} \cite{torek} to specify \lq\lq pick out all the pages in chapter 2''. \end{itemize} \end{enumerate} Thus there would be consistency across most common classes of document regarding the use of non-zero settings for the \verb+\count+ registers, = but the number of registers used in a particular style-file could, if = desired, be limited to those needed to avoid ambiguous page-specifications at the {\tt dvi}-file processing stage. \subsection*{Notes} \noindent \begin{enumerate} \item Although the \verb+\count+ registers give 10 possible \lq\lq dimensions'' of page-identification, Knuth defines yet another = \lq\lq dimension'' with the \lq\lq roman-numbered pages have a negative \verb+\count0+'' convention in the \lq\lq plain'' macros \cite[p.\ 252,362]{knuth-90}. I guess that the \lq\lq plain'' macros are intended for typesetting a certain class of document (draft = papers?), and that the convention is adequate for this class. However, = \LaTeX\ is intended to be used for a wide variety of classes of documents, = so I think it is better to \lq\lq start from first principles'' and = find a scheme that can cope well with the classes of documents for which \LaTeX\ is likely to be used. The scheme suggested in the above = table does not aim for compatibility with \lq\lq plain'' since: \begin{itemize} \item in terms of \lq\lq logical structure'' there doesn't seem any reason to treat \verb+\count0+ differently in the \lq\lq front matter'' rather than (for example) in \lq\lq = chapter 2'' or in the \lq\lq back matter''. \item if the end-user learns that \lq\lq \verb+\count1+ and \verb+\count2+ specify the division you are in'', this will be the only concept they need. They can select the 4th page in the \lq\lq front matter'' and page 4 of chapter 5 in a consistent way, e.g., if {\tt dvitops} \cite{clark} is used, \begin{verbatim} dvitops -f 4.-1 root \end{verbatim} and \begin{verbatim} dvitops -f 4.5 root \end{verbatim} respectively. If \LaTeX\ 3.0 had the additional concept that \lq\lq roman-numbered pages have \verb+\count0+ = negative'', this would be an unnecessary, redundant, concept for the end-user to learn. \end{itemize} \item In terms of \lq\lq logical structure'', there is a case for = treating the \lq\lq front matter'' in precisely the same way as the \lq\lq = back matter''. This would imply the modifications shown below: \begin{center} \label{modification} \begin{footnotesize} \begin{tabular}{lllll} \hline\hline Major division & Minor = divisions&\verb+\count0+&\verb+\count1+&\verb+\count2+\\ \hline\hline Front matter & table-of-contents,& page-number&{\tt 1} & {\tt -1} = \\ & list-of-figures, & &{\tt 2} \\ & acknowledgements, & &{\tt 3} \\ & preface, etc. & &{\tt 4, ...}\\ \hline \dots \\ \hline\hline \end{tabular} \end{footnotesize} \end{center} My impression is that, in practice, the scheme shown on page \pageref{a-scheme} would be adequate since there is generally less \lq\lq front matter'' than \lq\lq back matter''. End-users would probably prefer to issue a command such as \begin{verbatim} dvitops -f 4.-1 root \end{verbatim} (as implied by the scheme shown on page \pageref{a-scheme}) to select the 4th page of their \lq\lq front matter'' rather than \begin{verbatim} dvitops -f 4.*.-1 root \end{verbatim} (as implied by the modified scheme shown on page = \pageref{modification}). \item If desired, the scheme shown on page \pageref{a-scheme} could be = modified to remove the need for \verb+\count2+ to be non-zero after the = appendices. For example, the convention might be: \begin{center}\begin{footnotesize}\begin{tabular}{lllll} \hline\hline Major division & Minor = divisions&\verb+\count0+&\verb+\count1+&\verb+\count2+\\ \hline\hline \dots \\ \hline Back matter: & glossary & page-number&{\tt -2} & {\tt 0} = \\ other units & bibliography & & \\ & index, etc. & & \\ \hline\hline \end{tabular}\end{footnotesize}\end{center} Although this modified scheme would not eliminate ambiguity when people are selecting pages from documents that are numbered like = DEC's VAX/VMS manuals (in which each \lq\lq other unit'' of \lq\lq back matter'' has page-numbers starting from 1), but it might be argued = that such manuals are fairly rare. \end{enumerate} \section{Some e-mail comments} \begin{footnotesize}\begin{verbatim} From: bbeeton Date: Thu, 27 Jun 91 11:13:09 CET re making page numbers distinct, at the american math society, we faced this problem long ago (though not in latex). the circumstance was multi-column pages where each column had to be output separately on account of memory limitations (this was tex80), and "pasted up" by the output driver. the convention we devised (and still use with some publications) is \count0 =3D \pageno (for compatibility with plain) \count1 =3D column within page (for consistency, if 1-column pages were mixed with 2-column pages -- an everyday occurrence -- two "logical" pages were put in the dvi file for each "physical" page) \count2 =3D sequential counter, 1, ..., col x number of pages although it doesn't necessarily bear any clear relation to the printed page number, the sequential counter does guarantee a unique value that can be homed in on by a device driver (although not all device drivers may give you access to all ten counters, a difficulty that should be decreasing), and is very nicely reported by tex in the transcript file. if used in conjunction with some more descriptive scheme, it gives a useful value that can help one identify pages properly even to a driver that gives no access at all to the tex counters but always considers the first page of a dvi file to be page "1" (another driver lapse that should mercifully soon be a thing of the past). \end{verbatim}\end{footnotesize} \begin{center} --- \end{center} \begin{footnotesize}\begin{verbatim} From: eijkhout@EDU.UIUC.CSRD Date: Thu, 27 Jun 91 08:45:10 -0500 David Rhead's problem is a legitimate one. Here's how I have solved it (for the moment) in my own format: - use count0 for counting succesful shipouts by the output routine; - use count1 for keeping track of the number at the top/bottom of the = page. That way the user can let the page number jump any way s/he likes, and still no dvice driver will ever complain about pages not found, which could still happen if count0 is merely the page number. I guess this could be augmented by a facility to print both counters at the page bottom, but I found it easy enough to read the = correspondence >from the log file (the joys of X windows: there is always some corner = left on the screen to display some piece of information). Victor Eijkhout \end{verbatim}\end{footnotesize} ------_=_NextPart_001_01C19443.462823FC Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable counts.tex

\chapter{Support for accurate page-selection from {\tt = dvi} files}
\label{counts}

\section{Objectives}

Although I assume that it is open to anyone writing = style-files to do
whatever they like with the 10 \verb+\count+ = registers \cite[p.\
119]{knuth-90}, I think that it would be worth trying = to set a good
precedent in the \LaTeX\ 3.0 \lq\lq standard = styles''.  I therefore suggest
that there should be a scheme for using the = \verb+\count+ registers in such
a way that pages can always be specified = unambiguously in those {\tt
report}-like and {\tt book}-like documents that = have:
\begin{itemize}
\item roman-numbered \lq\lq front matter'' followed = by arabic-numbered
      body text, = and/or
\item pages numbered \lq\lq within chapters''.
\end{itemize}

In practice, I have the impression that documents = which have pages numbered
\lq\lq within chapters'' are in a minority.  It = may therefore be worth
having a scheme that can be used selectively, i.e, = such that, if a style-file
writer knows that it will be important to distinguish = between certain
units of a document but not between others, the = \verb+\count+s for the former
can have the non-zero values given by the scheme, = while those for the
latter can be zero.  This would make for = consistency (i.e., if a
\verb+\count+ is non-zero, then it would be used in = the same way in one
standard style-file as in another) without = unnecessary clutter (e.g., if
all \verb+\count+ registers but \verb+\count0+ can be = set zero without
ambiguity, the user would get monitoring of the form = {\tt [1] [2] [3] [4]
..\ } rather than of the form {\tt [1.1.1] [2.1.1] = [3.1.1] [4.1.1] ...\ }).

\section{A scheme}
\label{a-scheme}

The following scheme would probably achieve the = objectives suggested above.

\begin{center}
\begin{footnotesize}
\begin{tabular}{lllll}
\hline\hline
Major division & Minor = divisions&\verb+\count0+&\verb+\count1+&\verb+\count2+\\
\hline\hline
Front matter   &  = ---           & = page-number  & {\tt -1}    &  {\tt = 0}  \\
\hline
Main text      = &   chapters     & = page-number  & chapter-number  & {\tt 0} \\
          &nbs= p;    = &           &n= bsp;    = &           &n= bsp;  & {\tt 1, 2, ... = }&         \\
\hline
Back = matter:           = & appendices    &page-number&appendix = number& {\tt 1}\\
appendices         =      = &           &n= bsp;   = &           & = {\tt 1, 2, ... }& \\
\hline
Back = matter:           =   & glossary,     = &page-number&other-unit &  {\tt 2}\\
other = units           &n= bsp;  & bibliography, = &           = &number          &n= bsp;    \\
          &nbs= p;            = ;  & index, etc.   = &           & = {\tt 1, 2, ... }    \\
\hline\hline
\end{tabular}
\end{footnotesize}
\end{center}

\subsection*{Examples}


\begin{enumerate}
\item A pamphlet that is numbered in arabic = throughout would
      only use = \verb+\count0+.
\item A traditional book could have \verb+\count1+ = set to
      {\tt -1} in the front = matter and set to {\tt 0} thereafter.
\item A manual that is to be numbered in the style of = DEC's VAX/VMS manuals
     would use the full scheme, = i.e.
     \begin{itemize}
     \item \verb+\count2+ set to = {\tt 1} within the appendices and
           = set to {\tt 2} after the appendices
     \item \verb+\count1+ set to = {\tt -1} in the front matter, set to
           = \lq\lq chapter number'' within the body text, set to
           = \lq\lq appendix number'' or \lq\lq other-unit number''
           in = the \lq\lq back matter''.
     \item \verb+\count0+ reset = at the start of each chapter and
           = each unit of \lq\lq back matter''.
     \end{itemize}
\item It would be open to someone producing a = style-file for a
      \lq\lq traditional = book'' to increment \verb+\count1+ and
      \verb+\count2+ in the = way suggested for \lq\lq a manual'' above,
      even though = \verb+\count0+ would {\em not} be reset at the
      start of each chapter. = Although (after the \lq\lq front matter'') neither
      \verb+\count1+ nor = \verb+\count2+ would affect the printed
      page-numbers, their = settings would, for example,  enable someone
      \begin{itemize}
      \item using DVItoVDU = \cite{trevorrow-86} to give a
          &nbs= p; command that means \lq\lq go to the start of chapter 2''
      \item using {\tt = dviselect} \cite{torek} to specify
           = \lq\lq pick out all the pages in chapter 2''.
      \end{itemize}
\end{enumerate}

Thus there would be consistency across most common = classes of document
regarding the use of non-zero settings for the = \verb+\count+ registers, but
the number of registers used in a particular = style-file could, if desired,
be limited to those needed to avoid ambiguous = page-specifications at the
{\tt dvi}-file processing stage.

\subsection*{Notes}


\noindent
\begin{enumerate}
\item Although the \verb+\count+ registers give 10 = possible \lq\lq
     dimensions'' of = page-identification, Knuth defines yet another \lq\lq
     dimension'' with the \lq\lq = roman-numbered pages have a negative
     \verb+\count0+'' convention = in the \lq\lq plain'' macros \cite[p.\
     252,362]{knuth-90}.  I = guess that the \lq\lq plain'' macros are
     intended for typesetting a = certain class of document (draft papers?),
     and that the convention is = adequate for this class.  However, \LaTeX\
     is intended to be used for a = wide variety of classes of documents, so
     I think it is better to = \lq\lq start from first principles'' and find
     a scheme that can cope well = with the classes of documents for which
     \LaTeX\ is likely to be = used.  The scheme suggested in the above table
     does not aim for = compatibility with \lq\lq plain'' since:
      \begin{itemize}
      \item in terms of = \lq\lq logical structure'' there doesn't seem
          &nbs= p; any reason to treat \verb+\count0+ differently in the
          &nbs= p; \lq\lq front matter'' rather than (for example) in \lq\lq = chapter
          &nbs= p; 2'' or in the \lq\lq back matter''.
      \item if the end-user = learns that \lq\lq \verb+\count1+ and
          &nbs= p; \verb+\count2+ specify the division you are in'',
          &nbs= p; this will be the only concept they need.  They can select
          &nbs= p; the 4th page in the \lq\lq front matter'' and page 4 of
          &nbs= p; chapter 5 in a consistent way, e.g., if {\tt dvitops}
          &nbs= p; \cite{clark} is used,
          &nbs= p; \begin{verbatim}
          &nbs= p;    dvitops -f 4.-1 root
          &nbs= p; \end{verbatim}
          &nbs= p; and
          &nbs= p; \begin{verbatim}
          &nbs= p;    dvitops -f 4.5 root
          &nbs= p; \end{verbatim}
          &nbs= p; respectively.  If \LaTeX\ 3.0 had the additional concept
          &nbs= p; that \lq\lq roman-numbered pages have \verb+\count0+ = negative'',
          &nbs= p; this would be an unnecessary, redundant, concept
          &nbs= p; for the end-user to learn.
      \end{itemize}
\item In terms of \lq\lq logical structure'', there = is a case for treating
     the \lq\lq front matter'' in = precisely the same way as the \lq\lq back
     matter''.  This would = imply the modifications shown below:
\begin{center}
\label{modification}
\begin{footnotesize}
\begin{tabular}{lllll}
\hline\hline
Major division & Minor = divisions&\verb+\count0+&\verb+\count1+&\verb+\count2+\\
\hline\hline
Front matter   & = table-of-contents,& page-number&{\tt 1}    = &  {\tt -1} \\
          &nbs= p;    & list-of-figures,  = &            = &{\tt 2}     \\
          &nbs= p;    & acknowledgements, = &            = &{\tt 3}     \\
          &nbs= p;    & preface, etc.     = &            = &{\tt 4, ...}\\
\hline
\dots \\
\hline\hline
\end{tabular}
\end{footnotesize}
\end{center}
     My impression is that, in = practice, the scheme shown on page
     \pageref{a-scheme} would be = adequate since there is generally
     less \lq\lq front matter'' = than \lq\lq back matter''.
     End-users would probably = prefer to issue a command such as
          &nbs= p; \begin{verbatim}
      dvitops -f 4.-1 = root
          &nbs= p; \end{verbatim}
     (as implied by the scheme = shown on page \pageref{a-scheme})
     to select the 4th page of = their \lq\lq front matter'' rather than
          &nbs= p; \begin{verbatim}
      dvitops -f 4.*.-1 = root
          &nbs= p; \end{verbatim}
     (as implied by the modified = scheme shown on page \pageref{modification}).
\item If desired, the scheme shown on page = \pageref{a-scheme} could be modified
      to remove the need for = \verb+\count2+ to be non-zero after the appendices.
      For example, the = convention might be:
\begin{center}\begin{footnotesize}\begin{tabular}{lllll}
\hline\hline
Major division & Minor = divisions&\verb+\count0+&\verb+\count1+&\verb+\count2+\\
\hline\hline
\dots  \\
\hline
Back matter:   & = glossary          & = page-number&{\tt -2}   &  {\tt 0}  \\
other units    & = bibliography      = &            = &            = \\
          &nbs= p;    & index, = etc.       = &            = &            = \\
\hline\hline
\end{tabular}\end{footnotesize}\end{center}
      Although this modified = scheme would not eliminate ambiguity when
      people are selecting = pages from documents that are numbered like DEC's
      VAX/VMS manuals (in = which each \lq\lq other unit'' of \lq\lq back
      matter'' has = page-numbers starting from 1), but it might be argued that
      such manuals are = fairly rare.

\end{enumerate}

\section{Some e-mail comments}

\begin{footnotesize}\begin{verbatim}
From:     bbeeton = <BNB@COM.AMS.MATH>
Date:     Thu, 27 Jun 91 11:13:09 = CET

re making page numbers distinct, at the american math = society, we
faced this problem long ago (though not in = latex).  the circumstance
was multi-column pages where each column had to be = output separately
on account of memory limitations (this was tex80), = and "pasted up"
by the output driver.  the convention we devised = (and still use with
some publications) is
  \count0 =3D \pageno (for compatibility with = plain)
  \count1 =3D column within page (for = consistency, if 1-column pages
          &nbs= p; were mixed with 2-column pages -- an everyday occurrence --
          &nbs= p; two "logical" pages were put in the dvi file for = each
          &nbs= p; "physical" page)
  \count2 =3D sequential counter, 1, ..., col x = number of pages
although it doesn't necessarily bear any clear = relation to the printed
page number, the sequential counter does guarantee a = unique value that
can be homed in on by a device driver (although not = all device drivers
may give you access to all ten counters, a difficulty = that should be
decreasing), and is very nicely reported by tex in = the transcript file.
if used in conjunction with some more descriptive = scheme, it gives a
useful value that can help one identify pages = properly even to a driver
that gives no access at all to the tex counters but = always considers
the first page of a dvi file to be page "1" = (another driver lapse that
should mercifully soon be a thing of the = past).
\end{verbatim}\end{footnotesize}

\begin{center} --- \end{center}

\begin{footnotesize}\begin{verbatim}
From:     = eijkhout@EDU.UIUC.CSRD
Date:     Thu, 27 Jun 91 08:45:10 = -0500

David Rhead's problem is a legitimate one. Here's how = I have solved
it (for the moment) in my own format:
- use count0 for counting succesful shipouts by the = output routine;
- use count1 for keeping track of the number at the = top/bottom of the page.
That way the user can let the page number jump any = way s/he likes, and
still no dvice driver will ever complain about pages = not found,
which could still happen if count0 is merely the page = number.

I guess this could be augmented by a facility to print = both counters
at the page bottom, but I found it easy enough to = read the correspondence
>from the log file (the joys of X windows: there = is always some corner left
on the screen to display some piece of = information).

Victor Eijkhout
\end{verbatim}\end{footnotesize}


------_=_NextPart_001_01C19443.462823FC--