summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/changebar
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-11 20:23:50 +0000
committerKarl Berry <karl@freefriends.org>2018-03-11 20:23:50 +0000
commitea9e4ccd8121bca75c0f89743fc8099617e26d15 (patch)
treebdcb81de75b4eb02c4fca6e6c27120c9ceb717d7 /Master/texmf-dist/source/latex/changebar
parent284238c3c429197758ebc0a5e048e24e66676e70 (diff)
changebar (11mar18)
git-svn-id: svn://tug.org/texlive/trunk@46919 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/changebar')
-rw-r--r--Master/texmf-dist/source/latex/changebar/changebar.dtx112
1 files changed, 42 insertions, 70 deletions
diff --git a/Master/texmf-dist/source/latex/changebar/changebar.dtx b/Master/texmf-dist/source/latex/changebar/changebar.dtx
index b0d01dbdf20..e146293a0c0 100644
--- a/Master/texmf-dist/source/latex/changebar/changebar.dtx
+++ b/Master/texmf-dist/source/latex/changebar/changebar.dtx
@@ -24,7 +24,7 @@
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
-% \CheckSum{2579}
+% \CheckSum{2591}
%
%\iffalse
% This file is built for \LaTeXe, so we make sure an error is
@@ -39,7 +39,7 @@
\ProvidesFile{changebar.dtx}
%</dtx>
%<+package>\ProvidesPackage{changebar}
- [2018/02/04 v3.6b Indicate changes with marginal bars]
+ [2018/03/09 v3.6c Indicate changes with marginal bars]
% \end{macrocode}
%
% \section{A driver for this document}
@@ -158,7 +158,7 @@
% commands supported by `dvi drivers'. Currently six different
% \changes{v3.5a}{2005/05/23}{PDF\TeX{} support added}
% \changes{v3.6a}{2011/04/30}{Xe\TeX{} support added}
-% drivers are supported, plus pdftex\cbstart{} and XeTeX\cbend{}
+% drivers are supported, plus pdftex and Xe\TeX
% support. More can easily be added.
% \end{abstract}
%
@@ -192,7 +192,7 @@
% \changes{v3.5a}{2005/05/23}{Pdftex support added}
% \changes{v3.6a}{2011/05/02}{xetex support added}
% been tested with the \Lopt{dvips}, \Lopt{pdftex},
-% \Lopt{vtex} and\cbstart{}\Lopt{xetex}\cbend{} drivers,
+% \Lopt{vtex} and\Lopt{xetex} drivers,
% but it may also work with other PostScript based drivers. It will
% \emph{not} work for the \texttt{DVItoLN03} and em\TeX\ drivers.
% For colored changebars to work, make sure that you specify the
@@ -222,10 +222,8 @@
% \item V\TeX
% \changes{v3.5a}{2005/05/23}{Pdftex support added}
% \item PDF\TeX
-% \begin{changebar}
% \changes{v3.6a}{2011/04/30}{XeTeX added}
% \item Xe\TeX
-% \end{changebar}
% \end{itemize}
% The drivers are represented in the normal typewriter method of
% typing these names, or by the same entirely in lower case.
@@ -338,7 +336,7 @@
% The changebars will be printed in the `inside' margin of your
% document. This means they appear on the left side of the
% page. When \Lopt{twoside} is in effect the bars will be printed
-% on the right side of even pages. \cbdelete
+% on the right side of even pages.
%
%
% \section{Deficiencies and bugs}
@@ -359,7 +357,7 @@
% desired.
% \changes{v3.5a}{2005/05/23}{Pdftex support added}
% \changes{v3.6a}{2011/04/30}{XeTeX suport added}
-% There is no such limit with PDF\TeX \cbstart or Xe\TeX\cbend.
+% There is no such limit with PDF\TeX or Xe\TeX.
%
% \item Internal macro names are all of the form |\cb@xxxx|. No
% checking for conflicts with other macros is done.
@@ -623,12 +621,11 @@
% \begin{macro}{\cb@pdfxy}
% \changes{v3.5a}{2005/05/23}{Pdftex support added}
% The macro |\cb@pdfxy| populates the pdf x,y coordinates file.
-% In \Lopt{pdftex}\cbstart{} and \Lopt{xetex}\cbend{} mode it
-% writes one line to \file{.cb2} file
-% which is equivalent to one bar point. The default implementation
-% is a noop.
-% If the \Lopt{pdftex}\cbstart{} or \Lopt{xetex}\cbend{} option is
-% given it is redefined.
+% In \Lopt{pdftex} and \Lopt{xetex} mode it writes one line to
+% \file{.cb2} file which is equivalent to one bar point. The
+% default implementation is a noop.
+% If the \Lopt{pdftex} or \Lopt{xetex} option is given it is
+% redefined.
% \begin{macrocode}
\def\cb@pdfxy#1#2#3#4#5{}
% \end{macrocode}
@@ -745,9 +742,7 @@
% \item Textures
% \item V\TeX
% \item PDF\TeX
-% \begin{changebar}
% \item Xe\TeX
-% \end{changebar}
% \end{itemize}
%
% The intent is that the driver names should be case-insensitive,
@@ -808,8 +803,7 @@
{You are using a LaTeX run which does not generate PDF\MessageBreak
or you are using a very old version of PDFTeX}}
% \end{macrocode}
-%\clearpage
-% \begin{changebar}
+%
% \begin{macrocode}
\DeclareOption{XeTeX}{\cb@xetexcheck}
\DeclareOption{xetex}{\cb@xetexcheck}
@@ -847,7 +841,6 @@
{XeTeX option cannot be used}%
{You are not using XeLaTeX}}
% \end{macrocode}
-% \end{changebar}
%
% The new features of \LaTeXe\ make it possible to implement the
% \Lopt{outerbars} option.
@@ -913,7 +906,6 @@
%
% Signal an error if an unknown option was specified.
% \changes{v3.5a}{2005/05/23}{Added 'pdftex' to the option list}
-% \begin{changebar}
% \changes{v3.6a}{2011/04/30}{Added 'xetex' to the option list}
% \begin{macrocode}
\DeclareOption*{\OptionNotUsed\PackageError
@@ -924,7 +916,6 @@
grey, color, xcolor,\MessageBreak
outerbars, innerbars, leftbars and rightbars}}
% \end{macrocode}
-% \end{changebar}
%
% The default is to have grey change bars on the left side of the
% text on odd pages. When V\TeX\ is used the option \Lopt{dvips} is
@@ -938,7 +929,6 @@
% options}
% \changes{v3.4d}{2001/09/04}{Added detection of V\TeX}
% \changes{v3.5a}{2005/05/23}{Added detection of PDF\TeX}
-% \begin{changebar}
% \changes{v3.6a}{2011/04/30}{Added detection of Xe\TeX}
% \begin{macrocode}
\ifx\VTeXversion\@undefined
@@ -959,7 +949,6 @@
\ExecuteOptions{innerbars,traceoff,vtex,grey}
\fi
% \end{macrocode}
-% \end{changebar}
%
% A local configuration file may be used to define a site wide
% default for the driver, by calling |\ExecuteOptions| with the
@@ -1067,9 +1056,7 @@
% \item \TeX tures
% \item V\TeX
% \item PDF\TeX
-% \begin{changebar}
% \item Xe\TeX
-% \end{changebar}
% \end{itemize}
% This command can only be used in the preamble of the document.
%
@@ -1094,12 +1081,11 @@
\def\VTeX{VTEX}%
\def\pdfTeX{PDFTEX}%
% \end{macrocode}
-% \begin{changebar}
% \changes{v3.6a}{2011/04/30}{Added 'XeTeX' option}
% \begin{macrocode}
\def\xeTeX{XETEX}
% \end{macrocode}
-% \end{changebar}
+%
% The choice has to be communicated to the macro
% \verb=\cb@setup@specials= that will be called from within
% \verb=\document=. For this purpose the control sequence
@@ -1115,12 +1101,10 @@
\ifx\tempa\VTeX \global\chardef\cb@driver@setup=5\fi
\ifx\tempa\pdfTeX \cb@pdftexcheck\fi
% \end{macrocode}
-% \begin{changebar}
% \changes{v3.6a}{2011/04/30}{Added 'XeTeX' option}
% \begin{macrocode}
\ifx\tempa\xeTeX \cb@xetexcheck\fi
% \end{macrocode}
-% \end{changebar}
% \begin{macrocode}
\egroup}
% \end{macrocode}
@@ -1204,7 +1188,7 @@
\def\cb@resetpoints{%
\special{ln03:resetpoints \cb@minpoint \space\cb@maxpoint}}
% \end{macrocode}
-% The first extension to the {changebar} option was for the
+% The first extension to the \textsf{changebar} package was for the
% |\special| syntax of the program \texttt{DVItoPS} by James Clark.
% \begin{macrocode}
\or
@@ -1573,11 +1557,19 @@
% \begin{macro}{\cb@checkPdfxy}
% The macro |\cb@checkPdfxy| checks if the coordinates of a point have
% changed during the current run. If so, we need to rerun \LaTeX.
+% \changes{v3.6c}{2018/03/09}{Use \cs{ifdim} instead of \cs{ifnum} as
+% \cs{cb@pdfx} is defined as a dimension}
% \begin{macrocode}
\gdef\cb@checkPdfxy##1##2##3##4##5{%
\cb@@findpdfpoint{##1}{##2}%
- \ifnum##3=\cb@pdfx\relax
- \ifnum##4=\cb@pdfy\relax
+% \end{macrocdode}
+%\begin{changebar}
+% \begin{macrocode
+ \ifdim##3sp=\cb@pdfx\relax
+ \ifdim##4sp=\cb@pdfy\relax
+% \end{macrocdode}
+%\end{changebar}
+% \begin{macrocode
\ifdim##5=\cb@pdfz\relax
\else
\cb@error
@@ -1599,7 +1591,6 @@
\or
% \end{macrocode}
%
-% \begin{changebar}
% \changes{v3.6a}{2011/04/30}{Xe\TeX{} support added}
% The code for Xe\TeX{} is, like for PDF\TeX{}, more elaborate as
% the calculations have to
@@ -1611,9 +1602,7 @@
\immediate\closeout\cb@writexy
\immediate\openin\cb@readxy=\jobname.cb2\relax
% \end{macrocode}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@pdfpoints}
% \begin{macro}{\cb@pdfpagenr}
% The |\cb@pdfpoints| macro contains the list of coordinates of points
@@ -1625,9 +1614,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@findpdfpoint}
% The |\cb@findpdfpoint| macro finds the coordinates of point \#1 on
% pagecount \#2. First we expand the arguments to get the real values.
@@ -1639,18 +1626,14 @@
}
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\pdfliteral}
% For Xe\TeX{} we mimick PDF\TeX's command |\pdfliteral|.
% \begin{macrocode}
\def\pdfliteral##1{\special{pdf:literal ##1}}
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@@findpdfpoint}
% The |\cb@@findpdfpoint| macro finds the coordinates of point \#1 on
% pagecount \#2. If the information is not yet in memory is it read from
@@ -1674,9 +1657,7 @@
}
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@pdffind}
% The |\cb@pdffind| recursively searches through |\cb@pdfpoints| to find
% point \#1 on pagecount \#2. |\cb@pdfpoints| contains entries of the
@@ -1703,9 +1684,7 @@
}%
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@pdfreadxy}
% The |\cb@pdfreadxy| macro reads lines from the \file{.cb2} file in
% |\cb@pdfpoints| until the pagecount is greater than \#1 or the end of
@@ -1735,9 +1714,7 @@
}%
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@pdfparsexy}
% The |\cb@pdfparsexy| macro extracts the pagecount from an entry read in
% from the \file{.cb2} file.
@@ -1746,14 +1723,12 @@
\def\cb@pdfpg{##2}}%
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
-% As PDF is not a programming language it does not have any variables to
-% remember the coordinates of the current point. Therefore we write the
-% information to the \file{.aux} file and read it in in the next run. We
-% write the x,y coordinates of the current point in the text and the x
-% coordinate of the change bar.
+% As \textsc{pdf} is not a programming language it does not have
+% any variables to remember the coordinates of the current
+% point. Therefore we write the information to the \file{.aux} file
+% and read it in in the next run. We write the x,y coordinates of
+% the current point in the text and the x coordinate of the change bar.
% We also need the value of |\cb@pagecount| here, not during the write.
% \begin{macrocode}
\def\cb@defpoint##1##2{%
@@ -1771,9 +1746,7 @@
\cb@trace@defpoint##1##2%
}%
% \end{macrocode}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@cvtpct}
% The macro |\cb@cvtpct| converts a percentage between 0 and 100 to a
% decimal fraction.
@@ -1785,20 +1758,16 @@
0.\the##1\fi\fi\fi}
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@pdf@scale}
% \changes{v3.6a}{2018/02/03}{Added macro for scale factor}
-% In order to get things in the rightspot we need a little scaling
+% In order to get things in the right spot we need a little scaling
% factor. We define it here.
% \begin{macrocode}
\def\cb@pdf@scale{0.996264009963}
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% The |\cb@connect| finds the coordinates of the begin and end points,
% converts them to PDF units and draws the bar with |\pdfliteral|. It
% also sets the color or gray level, if necessary. When any of the
@@ -1858,17 +1827,23 @@
\cb@trace@connect##1##2##3%
}%
% \end{macrocode}
-% \end{changebar}
%
-% \begin{changebar}
% \begin{macro}{\cb@checkPdfxy}
% The macro |\cb@checkPdfxy| checks if the coordinates of a point have
% changed during the current run. If so, we need to rerun \LaTeX.
+% \changes{v3.6c}{2018/03/09}{Use \cs{ifdim} instead of \cs{ifnum} as
+% \cs{cb@pdfx} is defined as a dimension}
% \begin{macrocode}
\gdef\cb@checkPdfxy##1##2##3##4##5{%
\cb@@findpdfpoint{##1}{##2}%
- \ifnum##3=\cb@pdfx\relax
- \ifnum##4=\cb@pdfy\relax
+% \end{macrocdode}
+%\begin{changebar}
+% \begin{macrocode
+ \ifdim##3sp=\cb@pdfx\relax
+ \ifdim##4sp=\cb@pdfy\relax
+% \end{macrocdode}
+%\end{changebar}
+% \begin{macrocode
\ifdim##5=\cb@pdfz\relax
\else
\cb@error
@@ -1882,15 +1857,12 @@
}
% \end{macrocode}
% \end{macro}
-% \end{changebar}
%
-% \begin{changebar}
% For Xe\TeX{} we don't need a limit on the number of bar points.
% \begin{macrocode}
\def\cb@maxpoint{9999999}
\let\cb@resetpoints\relax
% \end{macrocode}
-% \end{changebar}
%
% When code for other drivers should be added it can be inserted
% here. When someone makes a mistake and somehow selects an
@@ -3109,7 +3081,7 @@
\fi}
% \end{macrocode}
% Dummy definition for |\cb@checkPdfxy|. This will be overwritten by
-% the \Lopt{pdftex}\cbstart{} and \Lopt{xetex}\cbend{} options.
+% the \Lopt{pdftex} and \Lopt{xetex} options.
% \begin{macrocode}
\def\cb@checkPdfxy#1#2#3#4#5{}
% \end{macrocode}
@@ -3131,7 +3103,7 @@
% auxiliary file and the history stack is detected a warning is
% issued; further checking is disabled.
% \changes{v3.5a}{2005/05/23}{Added pdftex support}
-% For pdf\TeX\cbstart{} and Xe\TeX\cbend{} we also disable
+% For pdf\TeX and Xe\TeX we also disable
% |\cb@checkPdfxy|.
% \begin{macrocode}
\def\cb@error{%