diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/tools')
33 files changed, 659 insertions, 292 deletions
diff --git a/Master/texmf-dist/source/latex/tools/afterpage.dtx b/Master/texmf-dist/source/latex/tools/afterpage.dtx index 01817368c0f..3fa341aa531 100644 --- a/Master/texmf-dist/source/latex/tools/afterpage.dtx +++ b/Master/texmf-dist/source/latex/tools/afterpage.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/afterpage.ins b/Master/texmf-dist/source/latex/tools/afterpage.ins index 2f704e10d73..9764bdac6d8 100644 --- a/Master/texmf-dist/source/latex/tools/afterpage.ins +++ b/Master/texmf-dist/source/latex/tools/afterpage.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1993-2017 +%% Copyright (C) 1993-2019 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright 1993-2017 +Copyright (C) 1993-2019 The LaTeX3 Project and any individual authors listed elsewhere in this file. diff --git a/Master/texmf-dist/source/latex/tools/array.dtx b/Master/texmf-dist/source/latex/tools/array.dtx index ba929289418..5590b0a1369 100644 --- a/Master/texmf-dist/source/latex/tools/array.dtx +++ b/Master/texmf-dist/source/latex/tools/array.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2018 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. @@ -29,10 +29,10 @@ %<+package>\providecommand\DeclareCurrentRelease[2]{} %<+package> %<+package>\DeclareRelease{}{2016-10-06}{array-2016-10-06.sty} -%<+package>\DeclareCurrentRelease{}{2018-04-30} +%<+package>\DeclareCurrentRelease{}{2019-10-01} %<+package> %<+package>\ProvidesPackage{array} -%<+package> [2018/12/30 v2.4k Tabular extension package (FMi)] +%<+package> [2019/08/31 v2.4l Tabular extension package (FMi)] % % \fi % @@ -2513,7 +2513,15 @@ % the list "\NC@list". % \begin{macrocode} \@ifundefined{NC@find@\NC@char}% - {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC@char + {\@tfor\next:=<>clrmbp@!|\do + {% +% \end{macrocode} +% We use \cs{noexpand} on the tokens from the list in case one or +% the other (typically \texttt{@}, \texttt{!} or \texttt{|}) has +% been made active. +% \changes{v2.4l}{2019/08/31}{Add a necessary \cs{expandafter} (github/148)} +% \begin{macrocode} + \if\expandafter\noexpand\next\NC@char \PackageWarning{array}% {Redefining primitive column \NC@char}\fi}% \NC@list\expandafter{\the\NC@list\NC@do#1}}% diff --git a/Master/texmf-dist/source/latex/tools/bm.dtx b/Master/texmf-dist/source/latex/tools/bm.dtx index b8be6530eb7..2216dcea077 100644 --- a/Master/texmf-dist/source/latex/tools/bm.dtx +++ b/Master/texmf-dist/source/latex/tools/bm.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2017 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. @@ -22,7 +22,7 @@ % \fi % % \iffalse -%% Copyright 1996 1997 1998 1999 2002 2003 2004 2016 2017 +%% Copyright 1996 1997 1998 1999 2002 2003 2004 2016 2017 2019 %% David Carlisle Frank Mittelbach %% %% Development of this package was commissioned by Y&Y Inc. @@ -36,7 +36,7 @@ %<driver>\ProvidesFile{bm.drv} % \fi % \ProvidesFile{bm.dtx} - [2017/01/16 v1.2c Bold Symbol Support (DPC/FMi)] + [2019/07/24 v1.2d Bold Symbol Support (DPC/FMi)] % % \iffalse %<*driver> @@ -699,6 +699,8 @@ % \changes{v1.0d}{1997/11/15} % {extra code to support prime lookahead and breqn} % \changes{v1.0h}{2002/11/22}{Pass math version as third (new) argument} +% \changes{v1.2d}{2019/07/24} +% {guard against active underscore} % % |\bm| is pretty much |\bmdefine\bm@command| followed by executing % |\bm@command|. It would in principle be possible to execute the @@ -713,6 +715,7 @@ % \begin{macrocode} \begingroup \catcode`\'=\active +\catcode`\_=\active \@firstofone{\endgroup \def\bm@general#1#2#3#4#5{% \begingroup @@ -764,8 +767,13 @@ % |'| is locally active for this definition. % \changes{v1.0d}{1997/11/15} % {prime code added} +% \changes{v1.0d}{1997/11/15} +% {prime code added} +% \changes{v1.2d}{2019/07/24} +% {guard against active underscore} % \begin{macrocode} \let\bm@prime\copy + \let_\relax \def'{\bm@prime\prime\relax}% % \end{macrocode} % For optional argument commands. This expandable version of diff --git a/Master/texmf-dist/source/latex/tools/bm.ins b/Master/texmf-dist/source/latex/tools/bm.ins index 8e6b2b10750..a148cb93efa 100644 --- a/Master/texmf-dist/source/latex/tools/bm.ins +++ b/Master/texmf-dist/source/latex/tools/bm.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1993-2017 +%% Copyright (C) 1993-2019 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright 1993-2017 +Copyright (C) 1993-2019 The LaTeX3 Project and any individual authors listed elsewhere in this file. diff --git a/Master/texmf-dist/source/latex/tools/calc.dtx b/Master/texmf-dist/source/latex/tools/calc.dtx index ce6aeae034b..0bc90f736ba 100644 --- a/Master/texmf-dist/source/latex/tools/calc.dtx +++ b/Master/texmf-dist/source/latex/tools/calc.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2017 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/dcolumn.dtx b/Master/texmf-dist/source/latex/tools/dcolumn.dtx index ea3dddc3430..38a4ab0da2c 100644 --- a/Master/texmf-dist/source/latex/tools/dcolumn.dtx +++ b/Master/texmf-dist/source/latex/tools/dcolumn.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/delarray.dtx b/Master/texmf-dist/source/latex/tools/delarray.dtx index 79d69e1b0c2..8814fc2a586 100644 --- a/Master/texmf-dist/source/latex/tools/delarray.dtx +++ b/Master/texmf-dist/source/latex/tools/delarray.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/enumerate.dtx b/Master/texmf-dist/source/latex/tools/enumerate.dtx index 43976903e72..984d36d4157 100644 --- a/Master/texmf-dist/source/latex/tools/enumerate.dtx +++ b/Master/texmf-dist/source/latex/tools/enumerate.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2016 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/fileerr.dtx b/Master/texmf-dist/source/latex/tools/fileerr.dtx index 089149df972..3b5895a5f61 100644 --- a/Master/texmf-dist/source/latex/tools/fileerr.dtx +++ b/Master/texmf-dist/source/latex/tools/fileerr.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -% 2006 2008 2009 +% Copyright (C) 1993-2019 +% % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/source/latex/tools/fontsmpl.dtx b/Master/texmf-dist/source/latex/tools/fontsmpl.dtx index 5c8af97e7e7..961bdda71fc 100644 --- a/Master/texmf-dist/source/latex/tools/fontsmpl.dtx +++ b/Master/texmf-dist/source/latex/tools/fontsmpl.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -% 2006 2008 2009 +% Copyright (C) 1993-2019 +% % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/source/latex/tools/ftnright.dtx b/Master/texmf-dist/source/latex/tools/ftnright.dtx index 31b30335220..5739172f85d 100644 --- a/Master/texmf-dist/source/latex/tools/ftnright.dtx +++ b/Master/texmf-dist/source/latex/tools/ftnright.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2016 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/hhline.dtx b/Master/texmf-dist/source/latex/tools/hhline.dtx index 6d08658ef99..1da01d757b4 100644 --- a/Master/texmf-dist/source/latex/tools/hhline.dtx +++ b/Master/texmf-dist/source/latex/tools/hhline.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/indentfirst.dtx b/Master/texmf-dist/source/latex/tools/indentfirst.dtx index 6d9a564e58d..16b99653cd7 100644 --- a/Master/texmf-dist/source/latex/tools/indentfirst.dtx +++ b/Master/texmf-dist/source/latex/tools/indentfirst.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -% 2006 2008 2009 +% Copyright (C) 1993-2019 +% % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/source/latex/tools/layout.dtx b/Master/texmf-dist/source/latex/tools/layout.dtx index 40f790aed99..848eb54fb25 100644 --- a/Master/texmf-dist/source/latex/tools/layout.dtx +++ b/Master/texmf-dist/source/latex/tools/layout.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/longtable.dtx b/Master/texmf-dist/source/latex/tools/longtable.dtx index 07823b9574e..9a3b5c03b87 100644 --- a/Master/texmf-dist/source/latex/tools/longtable.dtx +++ b/Master/texmf-dist/source/latex/tools/longtable.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. @@ -21,7 +21,7 @@ % % \fi % \iffalse -%% File: longtable.dtx Copyright (C) 1990-2001 David Carlisle +%% File: longtable.dtx Copyright (C) 1990-2019 David Carlisle % %<*dtx> \ProvidesFile{longtable.dtx} @@ -31,7 +31,7 @@ %<driver> \ProvidesFile{longtable.drv} % \fi % \ProvidesFile{longtable.dtx} - [2014/10/28 v4.11 Multi-page Table package (DPC)+ FMi change] + [2019/02/06 v4.12 Multi-page Table package (DPC)] % % \iffalse %<*driver> @@ -2100,8 +2100,10 @@ % \begin{macrocode} \def\LT@startpbox#1{% \bgroup -%FMi - \color@begingroup +% \end{macrocode} +% \changes{v4.12}{2019/02/06}{Color group to match array package} +% \begin{macrocode} + \color@begingroup \let\@footnotetext\LT@p@ftntext \setlength\hsize{#1}% \@arrayparboxrestore @@ -2122,7 +2124,9 @@ % \begin{macrocode} \def\LT@endpbox{% \@finalstrut\@arstrutbox -%FMi +% \end{macrocode} +% \changes{v4.12}{2019/02/06}{Color group to match array package} +% \begin{macrocode} \color@endgroup \egroup \the\LT@p@ftn diff --git a/Master/texmf-dist/source/latex/tools/longtable.ins b/Master/texmf-dist/source/latex/tools/longtable.ins index 381c415b62b..1fc3c12dfaa 100644 --- a/Master/texmf-dist/source/latex/tools/longtable.ins +++ b/Master/texmf-dist/source/latex/tools/longtable.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1993-2017 +%% Copyright (C) 1993-2019 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright 1993-2017 +Copyright (C) 1993-2019 The LaTeX3 Project and any individual authors listed elsewhere in this file. diff --git a/Master/texmf-dist/source/latex/tools/multicol.dtx b/Master/texmf-dist/source/latex/tools/multicol.dtx index fd77d6247dc..d68f471fcd4 100644 --- a/Master/texmf-dist/source/latex/tools/multicol.dtx +++ b/Master/texmf-dist/source/latex/tools/multicol.dtx @@ -20,7 +20,7 @@ % \iffalse This is a METACOMMENT % %% Package `multicol' to use with LaTeX2e -%% Copyright 1989-2018 Frank Mittelbach +%% Copyright 1989-2019 Frank Mittelbach %% %% In addition to the terms of LPPL any distributed version %% (unchanged or modified) of multicol has to keep the statement @@ -98,7 +98,7 @@ %<driver> \ProvidesFile{multicol.drv} % \fi % \ProvidesFile{multicol.dtx} - [2018/12/27 v1.8v multicolumn formatting (FMi)] + [2019/03/01 v1.8w multicolumn formatting (FMi)] % % %% @@ -145,7 +145,7 @@ % \DoNotIndex{\z@} % % \MakeShortVerb{\|} -% \newcommand{\mc}{{\sf multicols}} +% \newcommand{\mc}{\textsf{multicols}} % \newcommand{\TUB}{{\sl TUGboat\/}} % \newcommand{\TB}{{\sl\TeX book\/}} % @@ -191,13 +191,15 @@ % Also added was support for |\enlargethispage|. This means it is % now possible to request a page to be artificially enlarged or % shortened. Note that if you enlarge pages by more than one line -% you may have to increase the {\sf collectmore} counter value to +% you may have to increase the \textsf{collectmore} counter value to % ensure that enough material is being picked up. % % This command was used on the second page of this manual to shorten % it by one line, in order to get rid of a number of widow lines on % the following pages. % +% There are also some small enhancements to the balancing algorithm +% including a ways to require a minimum number of rows in the result. % % Finally, version 1.8 adds the command |\docolaction| to help with % more complicated actions that depend on the current column. This @@ -278,8 +280,8 @@ % \LaTeX{}, but every use of |\twocolumn| or |\onecolumn| % starts a new page. Moreover, the last page of two-column output % isn't balanced and this often results in an empty, or nearly -% empty, right column. When I started to write macros for {\sf -% doc.sty} (see ``The {\tt doc}--Option'', \TUB\ +% empty, right column. When I started to write macros for +% \textsf{doc.sty} (see ``The \texttt{doc}--Option'', \TUB\ % volume 10~\#2, pp.~245--273) I thought that it would be nice to % place the index % on the same page as the bibliography. And balancing the last page @@ -319,7 +321,7 @@ % \enlargethispage{-1\baselineskip} % % \DescribeMacro\premulticols -% As its first action, the {\sf multicols} environment measures the +% As its first action, the \textsf{multicols} environment measures the % current page to determine whether there is enough room for some % portion of multicolumn output. This is controlled by the % \meta{dimen} variable |\premulticols| which can be changed by @@ -372,7 +374,7 @@ % \DescribeMacro\columnseprule % Separation of columns with vertical rules is achieved by setting the % parameter |\columnseprule| to some positive value. In this -% article a value of {\sf.4pt} was used. +% article a value of \textsf{.4pt} was used. % % \DescribeMacro\columnseprulecolor % The color of the rules separating the columns can be specified through @@ -410,7 +412,7 @@ % is 9999 which is less than infinity but `bad' enough for most % paragraphs in a multicolumn environment. Changing its value should % be done outside the \mc{} environment. Since |\tolerance| is set -% to |\multicoltolerance| at the beginning of every {\sf multicols} +% to |\multicoltolerance| at the beginning of every \textsf{multicols} % environment one can locally overwrite this default by assigning % \verb*+\tolerance = +\meta{desired value}. There also exists a % |\multicolpretolerance| parameter holding the value for @@ -445,7 +447,7 @@ % actually going wrong are very slim, but if this happens you can help % \TeX{} by using a |\pagebreak| command in the final document. % Another way to influence the behavior of \TeX{} in this respect is -% given by the counter variable `{\sf collectmore}'. If you use the +% given by the counter variable `\textsf{collectmore}'. If you use the % |\setcounter| declaration to set this counter to \meta{number}, % \TeX{} will consider \meta{number} more (or less) lines before % making its final decision. So a value of $-1$ may solve all your @@ -459,16 +461,27 @@ % make both % the top and bottom baselines of all columns align. % -% Additionally you can set another counter, the `{\sf unbalance}' +% If there is only a small amount of material available for balancing +% then you may end up with very few lines per column. In an extreme +% case there may be only one line which looks distinctly odd. In that +% case it might be better to have more material distributed to the +% earlier columns even if that means that later columns are empty or +% partially empty. This is controlled through the counter +% `\textsf{minrows}' (default 1). If set to a higher value then the +% balancing will have at least that many rows in the first column (and +% also all further columns until it runs outs of material). +% +% Additionally you can set another counter, the `\textsf{unbalance}' % counter, to some positive \meta{number}. This will make all but the % right-most column \meta{number} of lines longer than they would % normally have been. `Lines' in this context refer to normal text % lines (i.e.\ one |\baselineskip| apart); thus, if your columns % contain displays, % for example, you may need a higher \meta{number} -% to shift something from one column into another. +% to shift something from one column into another. A negative value can make sense if +% you have set \textsf{minrows} and want to locally adjust that. % -% Unlike `{\sf collectmore},' the `{\sf unbalance}' counter is reset +% Unlike `\textsf{collectmore},' the `\textsf{unbalance}' counter is reset % to zero at the end of the environment so it only applies to one % \mc{} environment. % @@ -485,7 +498,7 @@ % % The new release now measures every generated column and ignores % solutions where at least one column has a badness being larger than -% the value of the counter {\sf columnbadness}. The default value for +% the value of the counter \textsf{columnbadness}. The default value for % this counter is 10000, thus \TeX{} will accept all solutions except % those being overfull. % By setting the counter to a smaller value you can force the algorithm @@ -505,7 +518,7 @@ % % In the new release this stretching is only done if the badness of % the final column is not larger than the value of the counter -% {\sf finalcolumnbadness}. The default setting is 9999, thus preventing +% \textsf{finalcolumnbadness}. The default setting is 9999, thus preventing % the stretching for all columns that \TeX{} would consider infinitely % bad. In that case the final column is allowed to run short which gives % a much better result. @@ -555,13 +568,13 @@ % % Within the \mc{} environment the usual star float commands are % available but their function is somewhat different as in the -% two-column mode of standard \LaTeX. Stared floats, e.g., {\tt -% figure*}, denote page wide floats that are handled in a similar +% two-column mode of standard \LaTeX. Stared floats, e.g., +% \texttt{figure*}, denote page wide floats that are handled in a similar % fashion as normal floats outside the \mc{} environment. However, % they will never show up on the page where they are encountered. In % other words, one can influence their placement by specifying a -% combination of {\tt t}, {\tt b}, and/or {\tt p} in their optional -% argument, but {\tt h} doesn't work because the first possible place +% combination of \texttt{t}, \texttt{b}, and/or \texttt{p} in their optional +% argument, but \texttt{h} doesn't work because the first possible place % is the top of the next page. One should also note, that this means % that their placement behavior is determined by the values of % |\topfraction|, etc.\ rather than by |\dbl...|. @@ -615,7 +628,7 @@ % inside `multicols' environment!} % % This message appears if you try to use the |\marginpar| command or -% an unstarred version of the {\sf figure} or {\sf table} environment. +% an unstarred version of the \textsf{figure} or \textsf{table} environment. % Such floats will disappear! % % \item[] {\hspace*{-\labelsep}\tt Very deep columns! @@ -649,7 +662,7 @@ % In this case you also get information from the balancing routine: % the heights tried for the left and right-most columns, % information about shrinking if the |\raggedcolumns| -% declaration is in force and the value of the `{\sf unbalance}' +% declaration is in force and the value of the `\textsf{unbalance}' % counter if positive. % \item[$\meta{number}= 3$.] Setting \meta{number}\pagebreak[2] to % this value will additionally trace the mark handling @@ -670,12 +683,12 @@ % \begin{multicols}{3}[\section{Prefaces to older versions} % \subsection{Preface to version 1.4}] % \hbadness=10000 -% Beside fixing some bugs as mentioned in the {\sf multicol.bug} file +% Beside fixing some bugs as mentioned in the \textsf{multicol.bug} file % this new release enhances the \mc{} environment by allowing for % balancing in arbitrary contexts. It is now, for example, possible -% to balance text within a \mc{} or a {\sf minipage} as shown in -% \ref{tab:newcmds} where a {\sf multicols} environment within a -% {\sf quote} environment was used. It is now even possible to nest +% to balance text within a \mc{} or a \textsf{minipage} as shown in +% \ref{tab:newcmds} where a \textsf{multicols} environment within a +% \textsf{quote} environment was used. It is now even possible to nest % \mc{} environments. % % The only restriction to such inner \mc{} environments (nested, or @@ -699,7 +712,7 @@ % |\badness| function of \TeX3, define a faster algorithm for finding % the right column height, etc. If somebody thinks he/she has an % enhancement I would be pleased to learn about it. But please obey -% the copyright notice and don't change {\sf multicol.dtx} directly! +% the copyright notice and don't change \textsf{multicol.dtx} directly! % \begin{table*} % \begin{quote} % \begin{multicols}{2} @@ -772,7 +785,7 @@ % forbidden floats was their ultimate removal from \LaTeX{}s % |\@freelist| so that after a few |\marginpar|s inside the \mc{} % environment floats where disabled forever. (Thanks to Chris -% Rowley for pointing this out.) I removed this misbehaviour and at +% Rowley for pointing this out.) I removed this misbehavior and at % the same time decided to allow at least floats spanning all % columns, e.g., generated by the |figure*| environment. You can % see the new functionality in table~\ref{tab:newcmds} which was @@ -787,7 +800,7 @@ % |\emergencystretch| \meta{dimen} register provided in the % new \TeX{} 3.0. The first argument is the number of columns and % the second one is the current |\hsize|. At the moment the -% default definition is $4\mbox{\tt pt} \times |#1|$, i.e.\ the +% default definition is $4\texttt{pt} \times |#1|$, i.e.\ the % |\hsize| isn't used at all. But maybe there are better % formulae. % @@ -799,7 +812,7 @@ % \end{quote} % \vspace*{-1ex} % \vspace*{-0ex} -% \caption[]{The new commands of {\sf multicol.sty} version 1.2. +% \caption[]{The new commands of \textsf{multicol.sty} version 1.2. % Both commands might be removed if good solutions to these % open problems are found. I hope that these commands will % prevent that nearly identical style files derived from @@ -845,8 +858,7 @@ % % The next bit of code contains the documentation driver file for % \TeX{}, i.e., the file that will produce the documentation you are -% currently reading. It will be extracted from this file by the {\tt -% docstrip} program. +% currently reading. It will be extracted from this file by the \texttt{docstrip} program. % Since this is the first code in this file one can produce the % documentation % simply by running \LaTeX{} on the \texttt{.dtx} file. @@ -1149,7 +1161,7 @@ % \end{macrocode} % Now we output the first argument and produce vertical space % above the columns. (Note that this argument corresponds to the -% first optional argument of the {\sf multicols} environment.) +% first optional argument of the \textsf{multicols} environment.) % For many releases this argument was typeset in a group to get % a similar effect as |\twocolumn[..]| where the argument is % also implicitly surrounded by braces. However, this conflicts @@ -1465,7 +1477,7 @@ % Finally we handle the footnote insertions. We have to multiply % the magnification factor and the extra skip by the number of % columns since each footnote reduces the space for every column -% (remember that we have pagewide footnotes). If, on the other +% (remember that we have page-wide footnotes). If, on the other % hand, footnotes are typeset at the very end of the document, our % scheme still works since |\count\footins| is zero then, so it % will not change. @@ -1475,7 +1487,7 @@ % \begin{macrocode} \init@mult@footins % \end{macrocode} -% For the same reason (pagewide footnotes), the \meta{dimen} +% For the same reason (page-wide footnotes), the \meta{dimen} % register controlling the maximum space used for footnotes isn't % changed. Having done this, we must reinsert all the footnotes % which are already present (i.e.\ those encountered when the @@ -1489,7 +1501,7 @@ % Inside \mc{} a |\clearpage| is fairly useless as we aren't supporting % floats. In fact, it can cause harm as it doesn't know about the % |\partial@page| and may therefore result in making columns too long. -% So we change that to bahve like |\newpage| but also check if there +% So we change that to behave like |\newpage| but also check if there % are any deferred floats. If so, perhaps the user tried to place them through % that |\clearpage| (but that needs to be done before starting the \mc{} % environment. @@ -1582,8 +1594,8 @@ % |\columnwidth| was left unchanged. This is inconsistent, % but |\columnwidth| is used only by floats (which % aren't allowed in their current implementation) and by the -% |\footnote| macro. Since we want pagewide -% footnotes\footnote{I'm not sure that I really want pagewide +% |\footnote| macro. Since we want page-wide +% footnotes\footnote{I'm not sure that I really want page-wide % footnotes. But balancing of the last page can % only be achieved with this approach or with a % multi-path algorithm which is complicated and @@ -1836,7 +1848,7 @@ \@checkend{multicols}% \endgroup % \end{macrocode} -% We also set the `{\sf unbalance}' counter to its default. This is +% We also set the `\textsf{unbalance}' counter to its default. This is % done globally since \LaTeX{} counters are always changed this % way.\footnote{Actually, we are still in a group started by the % \cs{begin} macro, so \cs{global} must be used @@ -2113,7 +2125,7 @@ % that this value is likely to be wrong. We therefore normalize the % situation by pretending that the depth is zero. However, if |\page@sofar| % is being called inside the OR then setting |\prevdepth| here has -% no longlasting effect, we therefore have to repeat this once we +% no long-lasting effect, we therefore have to repeat this once we % return to the main vertical list. Here we set it only for those % cases where the command is used within a list and then followed by % something else. @@ -2176,7 +2188,7 @@ % % \begin{macro}{\vfilmaxdepth} % This curious definition is used as the space at the bottom of a -% column if we implement |\raggedcolumns|. Normlly one only appends +% column if we implement |\raggedcolumns|. Normally one only appends % |\vfill| in that case but this is actually wrong for columns that % are more or less full: by adding a glue at the bottom such a % column doesn't have any depth any more but without it the material @@ -2269,8 +2281,8 @@ % That local change will be reverted at the end of the output % routine So for the next page the original state will be -% reestablished. However, in theorey there is a possibility to sneak -% in a whoe multicols environment into the running header +% reestablished. However, in theory there is a possibility to sneak +% in a whole multicols environment into the running header % definition. If that happens then it will also be affected by this % change---too bad I think. % \changes{v1.8a}{2011/12/20}{Support for \cs{enlargethispage}} @@ -2306,7 +2318,7 @@ % But we need to unbox anyway to ensure that at the end of the box % we do not have unwanted space. This can sneak in in certain % situations, for example, if two lists follow each other and we -% break between them. While sich space is usually zero it still has +% break between them. While such space is usually zero it still has % an effect because it hides depth of the last line in the column % and that will result in incorrect placement. % \changes{v1.3c}{1990/03/03}{\cs{unbox}ing avoided.} @@ -2365,7 +2377,7 @@ \thepage\space might be wrong}% \fi % \end{macrocode} -% If the `{\sf tracingmulticols}' counter is 4 or higher we also +% If the `\textsf{tracingmulticols}' counter is 4 or higher we also % add a rule. % \begin{macrocode} \ifnum \c@tracingmulticols>\thr@@ @@ -2390,7 +2402,7 @@ \let\botmark\kept@botmark \fi % \end{macrocode} -% We also initalize |\topmark| with |\kept@topmark|. This will make +% We also initialize |\topmark| with |\kept@topmark|. This will make % this mark okay for all middle pages of the \mc{} environment. % \changes{v1.5d}{1993/09/15}{reinit \cs{topmark}} % \begin{macrocode} @@ -2465,7 +2477,7 @@ % Now we reset |\@colroom| to |\@colht| which is \LaTeX's % saved value of |\textheight|. % We also have to reset the recorded position of the last -% |\marginpar| as well as the recorded size of intext floats +% |\marginpar| as well as the recorded size of in-text floats % as we are now on a new page. % \changes{v1.8d}{2014/04/23}{Reset \cs{@mparbottom} after page finishes} % \changes{v1.8n}{2015/08/19}{Reset \cs{@textfloatsheight} after page finishes} @@ -2580,7 +2592,7 @@ % |\colbreak@box| and then back up by this depth. This will position % the bottom of the box at its natural baseline which is useful for % balancing later on. -% \changes{v1.8k}{2015/03/21}{Remove discarable items just before a +% \changes{v1.8k}{2015/03/21}{Remove discardable items just before a % forced break} % \begin{macrocode} \boxmaxdepth\maxdepth @@ -2595,7 +2607,7 @@ \else % \end{macrocode} % Another special case is reaching the end of the \mc{} -% environment which is signalled by |-\@Mvi|. +% environment which is signaled by |-\@Mvi|. % \changes{v1.8r}{2018/01/28}{Handling end of env through special penalty} % \begin{macrocode} \ifnum\outputpenalty = -\@Mvi @@ -2694,8 +2706,8 @@ % \begin{macrocode} \newif\ifshr@nking % \end{macrocode} -% The actual definitions are simple: we just switch to {\sf true} -% or {\sf false} depending on the desired action. To avoid extra +% The actual definitions are simple: we just switch to \textsf{true} +% or \textsf{false} depending on the desired action. To avoid extra % spaces in the output we enclose these changes in % |\@bsphack|\ldots{}\allowbreak|\@esphack|. % \begin{macrocode} @@ -2723,7 +2735,7 @@ % support} For the next block of code see also comments in % section~\ref{sec:colbreak}. All forced breaks except the last are % inside |\colbreak@box| so all we have to do is to concatenate this -% box with box |\@cclv| and put a penalty inbetween. Here we test if +% box with box |\@cclv| and put a penalty in between. Here we test if % |\colbreak@box| is void so that the message is only generated if % we really add forced breaks and the penalty. % \changes{v1.8k}{2015/03/21}{Use \cs{@Mv} and not \cs{break} in case @@ -2891,7 +2903,7 @@ % unpredictable point depending on the height of the largest % character in this line. But of course we want all columns to % align properly at the baselines of their first lines. For this -% reason we have opened |\mult@box| with a |\penalty| {\sf -10000}. +% reason we have opened |\mult@box| with a |\penalty| \textsf{-10000}. % This will now allow us to split off from |\mult@box| a tiny bit % (in fact nothing since the first possible break-point is the % first item in the box). The result is that |\splittopskip| is @@ -2936,6 +2948,21 @@ \advance\dimen@-\baselineskip \fi % \end{macrocode} +% As a further restriction we want to see a minimum number of +% rows in the balanced result based on the setting of the counter +% |minrows|. If the starting value is lower we adjust. +% \changes{v1.8w}{2019/03/01}{Provide minrows counter for balancing} +% \begin{macrocode} + \@tempdima\dimexpr + \topskip +\c@minrows\baselineskip-\baselineskip\relax + \ifnum\dimen@<\@tempdima + \mult@info\@ne + {Start value + \the\dimen@ \space -> + \the\@tempdima \space (corrected for minrows)}% + \dimen@\@tempdima + \fi +% \end{macrocode} % At the user's request we start with a higher value (or lower, but % this usually only increases the number of tries). % \begin{macrocode} @@ -3608,7 +3635,7 @@ ht \the\ht#1, dp \the\dp#1}% %</debug> % \end{macrocode} -% Now we open a new group an locally copy the box to itself. As a +% Now we open a new group and locally copy the box to itself. As a % result any operation, i.e.\ |\vsplit|, will only have a local % effect. Without this trick the box content would get lost up to % the level where the last assignment to the box register was done. @@ -3719,7 +3746,7 @@ % \begin{macro}{\remove@discardable@items} % There are situations when we may have some space at the end of a % column and this macro here will attempt to get rid of it. The -% typical \LaTeX{} sequence is a series of selfcanceling glues so +% typical \LaTeX{} sequence is a series of self-canceling glues so % if we remove them recursively we are usually fine. % % Special care is needed with handling |\vspace*| as that @@ -3760,7 +3787,7 @@ \else % \end{macrocode} % Otherwise we remove this ``real'' skip. Then we look if it was -% preceeded by a penalty of 10000 (i.e., a |\nobreak|) +% preceded by a penalty of 10000 (i.e., a |\nobreak|) % \begin{macrocode} \unskip %\typeout{p=\lastpenalty}% @@ -3797,6 +3824,14 @@ \newif\ifforcedbreak@leftover % \end{macrocode} % +% \begin{macro}{\c@minrows} +% \changes{v1.8w}{2019/03/01}{Provide minrows counter for balancing} +% \begin{macrocode} +\newcount\c@minrows +\c@minrows=1 +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\c@columnbadness} % \begin{macro}{\c@finalcolumnbadness} % \begin{macrocode} @@ -4002,7 +4037,7 @@ % % \begin{macro}{\columnbreak} % \changes{v1.5u}{1999/05/25}{Macro added} -% |\columnbreak| is modelled after |\pagebreak| except that we +% |\columnbreak| is modeled after |\pagebreak| except that we % generate a penalty -10005. % \begin{macrocode} \mathchardef\@Mv=10005 diff --git a/Master/texmf-dist/source/latex/tools/multicol.ins b/Master/texmf-dist/source/latex/tools/multicol.ins index ee295fed174..9fd6cbe6e9f 100644 --- a/Master/texmf-dist/source/latex/tools/multicol.ins +++ b/Master/texmf-dist/source/latex/tools/multicol.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1993-2018 +%% Copyright (C) 1993-2019 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright 1993-2017 +Copyright (C) 1993-2019 The LaTeX3 Project and any individual authors listed elsewhere in this file. diff --git a/Master/texmf-dist/source/latex/tools/rawfonts.dtx b/Master/texmf-dist/source/latex/tools/rawfonts.dtx index 51502c631ee..0fd7dd5006e 100644 --- a/Master/texmf-dist/source/latex/tools/rawfonts.dtx +++ b/Master/texmf-dist/source/latex/tools/rawfonts.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -% 2006 2008 2009 +% Copyright (C) 1993-2019 +% % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/source/latex/tools/shellesc.dtx b/Master/texmf-dist/source/latex/tools/shellesc.dtx index ebc436ad96e..061ea4457ca 100644 --- a/Master/texmf-dist/source/latex/tools/shellesc.dtx +++ b/Master/texmf-dist/source/latex/tools/shellesc.dtx @@ -1,6 +1,9 @@ % \iffalse %% Source File: shellesc.dtx -%% Copyright 2015-2016 LaTeX3 project +%% Copyright (C) 2015-2019 +%% +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. %% %% This file may be distributed under the terms of the LPPL. %% See README for details. @@ -17,7 +20,7 @@ %<driver> \ProvidesFile{shellesc.drv} % \fi % \ProvidesFile{shellesc.dtx} - [2016/06/07 v0.02a unified shell escape interface for LaTeX] + [2016/06/07 v0.02b unified shell escape interface for LaTeX] % % \iffalse %<*driver> @@ -84,7 +87,7 @@ % to \verb|\immediate\write18|. In the rare situations that you need % non-immediate \verb|\write18| in a document being ported to current % Lua\TeX, you will need to change to use the -% \verb|DelayedShellescape| command. +% \verb|\DelayedShellEscape| command. % % \section{Implementation} % diff --git a/Master/texmf-dist/source/latex/tools/showkeys.dtx b/Master/texmf-dist/source/latex/tools/showkeys.dtx index 14ac876627f..6e2516856d5 100644 --- a/Master/texmf-dist/source/latex/tools/showkeys.dtx +++ b/Master/texmf-dist/source/latex/tools/showkeys.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. @@ -22,7 +22,7 @@ % \fi % \iffalse %% File: showkeys.dtx Copyright (C) 1992-1997 David Carlisle -%% File: showkeys.dtx Copyright (C) 2006-2014 David Carlisle, LaTeX3 Project +%% File: showkeys.dtx Copyright (C) 2006-2019 David Carlisle, LaTeX3 Project % %<*dtx> \ProvidesFile{showkeys.dtx} diff --git a/Master/texmf-dist/source/latex/tools/somedefs.dtx b/Master/texmf-dist/source/latex/tools/somedefs.dtx index bad29b00439..f73a45b7871 100644 --- a/Master/texmf-dist/source/latex/tools/somedefs.dtx +++ b/Master/texmf-dist/source/latex/tools/somedefs.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -% 2006 2008 2009 +% Copyright (C) 1993-2019 +% % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/source/latex/tools/tabularx.dtx b/Master/texmf-dist/source/latex/tools/tabularx.dtx index 5eaabbe3102..ff8f3cec9a5 100644 --- a/Master/texmf-dist/source/latex/tools/tabularx.dtx +++ b/Master/texmf-dist/source/latex/tools/tabularx.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2016 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/tabularx.ins b/Master/texmf-dist/source/latex/tools/tabularx.ins index 0953bdea542..06308d77359 100644 --- a/Master/texmf-dist/source/latex/tools/tabularx.ins +++ b/Master/texmf-dist/source/latex/tools/tabularx.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1993-2017 +%% Copyright (C) 1993-2019 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright 1993-2017 +Copyright (C) 1993-2019 The LaTeX3 Project and any individual authors listed elsewhere in this file. diff --git a/Master/texmf-dist/source/latex/tools/theorem.dtx b/Master/texmf-dist/source/latex/tools/theorem.dtx index 5a76fdb2006..6f745d016ef 100644 --- a/Master/texmf-dist/source/latex/tools/theorem.dtx +++ b/Master/texmf-dist/source/latex/tools/theorem.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2016 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/tools.ins b/Master/texmf-dist/source/latex/tools/tools.ins index 817e149bcae..12625e81662 100644 --- a/Master/texmf-dist/source/latex/tools/tools.ins +++ b/Master/texmf-dist/source/latex/tools/tools.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1993-2017 +%% Copyright (C) 1993-2019 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright 1993-2017 +Copyright (C) 1993-2019 The LaTeX3 Project and any individual authors listed elsewhere in this file. diff --git a/Master/texmf-dist/source/latex/tools/trace.dtx b/Master/texmf-dist/source/latex/tools/trace.dtx index dabec8aa006..e808fdd4317 100644 --- a/Master/texmf-dist/source/latex/tools/trace.dtx +++ b/Master/texmf-dist/source/latex/tools/trace.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2018 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. @@ -22,7 +22,7 @@ % \fi % \iffalse %% -%% (C) Copyright 1999-2018 Frank Mittelbach +%% (C) Copyright (C) 1999-2019 Frank Mittelbach %% All rights reserved. %% %<*dtx> diff --git a/Master/texmf-dist/source/latex/tools/varioref.dtx b/Master/texmf-dist/source/latex/tools/varioref.dtx index 2417e9b1203..049bd0d55ea 100644 --- a/Master/texmf-dist/source/latex/tools/varioref.dtx +++ b/Master/texmf-dist/source/latex/tools/varioref.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2016 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. @@ -14,7 +14,7 @@ % The latest version of this license is in % https://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions of LaTeX -% version 2005/12/01 or later. +% version 2008 or later. % % The list of all files belonging to the LaTeX `Tools Bundle' is % given in the file `manifest.txt'. @@ -22,19 +22,25 @@ % \fi % \iffalse %% Package varioref to use with LaTeX2e -%% Copyright (C) 1992-2016 Frank Mittelbach, all rights reserved. +%% Copyright (C) 1992-2019 Frank Mittelbach, all rights reserved. %% %% For additions or updates to the language options please contact %% the author at %% %% frank.mittelbach@latex-project.org %% -%% In case of bugs, please use "latexbug.tex" (category tools) to report them. +%% or open an issue at https://github.com/latex3/latex2e. %% % %<package>\NeedsTeXFormat{LaTeX2e}[1995/05/16] +%<package>\providecommand\DeclareRelease[3]{} +%<package>\providecommand\DeclareCurrentRelease[2]{} +%<package> +%<package>\DeclareRelease{}{2016-02-16}{varioref-2016-02-16.sty} +%<package>\DeclareCurrentRelease{}{2019-10-01} +%<package> %<package>\ProvidesPackage{varioref} -%<package> [2016/02/16 v1.5c package for extended references (FMi)] +%<package> [2019/09/08 v1.6b package for extended references (FMi)] % \fi % %% @@ -44,11 +50,32 @@ % \changes{v1.0g}{1994/05/27}{Use \cmd\DeclareRobustCommand} % \changes{v1.5c}{2016/02/09}{Revamped some of the documentation to better % explain how varioref could be used in a multi-lingual context} - +% \changes{v1.6a}{2019/08/25}{\cs{labelformat} and \cs{Ref} now available in the kernel +% so removed from this package but only in new kernel} +% +% +% \newcommand\NewIn[1]{\marginpar{\fbox{\fbox{\sffamily\tabular{l}New +% in\\#1\endtabular}}}} +% \newcommand\ChangedIn[1]{\marginpar{\fbox{\fbox{\sffamily\tabular{l}Changed +% in\\#1\endtabular}}}} +% +% \providecommand\pkg[1]{\texttt{#1}} +% \providecommand\option[1]{\texttt{#1}} +% \providecommand\meta[1]{$\langle§\textit{#1}$\rangle$} % -% \newcommand\NewIn[1]{\marginpar{\fbox{\fbox{\sffamily\tabular{l}New in\\#1\endtabular}}}} % -% \title{The \texttt{varioref} package\thanks{This file +% \makeatletter +% \def\allowtofu{^^A +%\def\UTFviii@undefined@err##1{^^A +% \PackageWarning{inputenc}{Unicode character \expandafter +% \UTFviii@splitcsname\string##1\relax +% \MessageBreak +% not set up for use with LaTeX}^^A +% \raisebox{.8pt}{\fboxsep1pt\kern.1pt\fbox{$\cdot$}\kern.1pt}^^A +% }} +% \makeatother +% +% \title{The \pkg{varioref} package\thanks{This file % has version number \fileversion, last % revised \filedate.}} % \author{Frank Mittelbach} @@ -95,6 +122,23 @@ % % % +% \section{Loading the package} +% +% +% The suggested way of loading the package these days is by +% \emph{always} using +% the package option \option{nospace}, +% \NewIn{2019} +% i.e., +% \begin{verbatim} +% \usepackage[nospace]{varioref} +%\end{verbatim} +% See below for an explanation of why this is needed. There are some +% other options that you may want to use additionally; they are +% explained \vpageref{options}. +% +% +% % \section{The user interface} % %\DescribeMacro\vref The implementation of |\vref| below produces only @@ -112,9 +156,11 @@ % number and again such a reference should normally be suppressed if % we are referring to the current page. For this purpose the package % defines the |\vpageref| command. It will produce the same strings as -% |\vref| except that it doesn't start with the |\ref| and except that +% |\vref| except that it doesn't start with the |\ref|. A further +% difference is that % it will produce the string that is saved in |\reftextcurrent| if -% label and reference fall onto the same page. By defining +% label and reference fall onto the same page (and no optional +% argument is used). By defining % |\reftextcurrent| to produce ``on this page'' or something similar, % we can avoid that % \begin{verbatim} @@ -123,7 +169,7 @@ % comes out as ``\ldots~see the example which shows~\ldots'', which % could be misleading. % -% You can put a space in front of |\vpageref| it will be ignored if +% A space in front of |\vpageref| it will be ignored if % the command doesn't produce any text at all. % % But in fact |\vpageref| allows even more control. If has two @@ -162,7 +208,6 @@ % % % \DescribeMacro\vrefrange -% \NewIn{1998} % This command is similar to |\vref| but it % takes two mandatory arguments denoting a range to refer to (e.g., a % sequences of figures or a sequence of equations, etc.). So if @@ -203,12 +248,11 @@ % So if you have two (or more) labels you could retrieve their page % numbers, compare them and then decide what to print. For example, % the following not very serious definition (also using the -% \texttt{ifthen} package) +% \pkg{ifthen} package) %\begin{verbatim} -% \newcommand\amusingversion[2]{% +% \newcommand\amusingversion[2]{the definition% % \vrefpagenum\firstnum{#1}% % \vrefpagenum\secondnum{#2}% -% the definition% % \ifthenelse{\equal\firstnum\secondnum}% % {s of \ref{#1} and \ref{#2} \vpageref{#1}}% % { of \ref{#1} \vpageref{#1} and of \ref{#2} \vpageref{#2}}% @@ -224,44 +268,82 @@ % \begin{quote} % \ldots the definition of 3 on the next page and of 4 on page~13 % \end{quote} -% in case the are on different pages. +% in case they are on different pages. +% +% \DescribeMacro\vpagerefcompare +% \NewIn{2019} +% For this kind of application the package also provides +% |\vpagerefcompare| as a command that takes four argument: two labels for +% comparison and a \meta{true} and \meta{false} argument. One of them +% is executed depending on whether the two labels are on the same page +% or on different pages. With its help the above definition could be +% shortened to +%\begin{verbatim} +% \newcommand\amusingversion[2]{the definition% +% \vpagerefcompare{#1}{#2}% +% {s of \ref{#1} and \ref{#2} \vpageref{#1}}% +% { of \ref{#1} \vpageref{#1} and of \ref{#2} \vpageref{#2}}% +% } +%\end{verbatim} +% and you don't have to load the \pkg{ifthen} package any longer to +% make it work. +% +% \DescribeMacro\vpagerefnearby +% \NewIn{2019} +% Another command for conditional processing is |\vpagerefnearby|. It +% takes three arguments: a label and a \meta{true} and \meta{false} +% argument. It compares the page reference to the label with the +% current page number and if both are arabic number and only differ by +% $\pm1$ the \meta{true} argument is executed otherwise the +% \meta{false} argument. In other words it tells you if a |\vpageref| +% to the label would result in a textual reference to the previous, +% current or next page.\footnote{There is also a +% \cs{vpagerefcomparenearby} but this is only meant for package +% writers, so it is only documented in the implementation section.} + % % -% The user commands |\vref|, |\vpageref|, and |\vpagerefrange| all -% \NewIn{2001} -% work by first removing any space on their left and then inserting -% some space of their own (|\vref|, for example, a nonbreakable -% space). That seemed like a good idea back then, but it has the -% disadvantage that you can't use these macros in situations where you -% definitely do not want any space before the generated text. E.g., in -% situations like |(\vref{foo} ...)| you end up with a space after the -% open parenthesis. +% If you don't use the \texttt{nospace} option the user commands +% |\vref|, |\vpageref|, and |\vpagerefrange| all work by first +% removing any space on their left and then inserting some space of +% their own (|\vref|, for example, a nonbreakable space). That seemed +% like a good idea back then, but it has the disadvantage that you +% can't use these macros in situations where you definitely do not +% want any space before the generated text. E.g., in situations like +% |(\vref{foo} ...)| you end up with a space after the open +% parenthesis. % % \DescribeMacro{\vref*} % \DescribeMacro{\vpageref*} % \DescribeMacro{\vpagerefrange*} -% Since it is too late to change the default behaviour I've added star +% Since it was too late to change the default in 2001 I added star % versions of the macros which do not add any space before the % generated text (they do nevertheless remove space at the left). % +% However, that too has problems (one is that \pkg{hyperref} +% \ChangedIn{2019} +% introduced the star forms as a means to generating references +% without hyperlinks (which is clearly the more important +% application). +% So these days I recommend to always call the package with the option +% \option{nospace} which prevents \pkg{varioref} from messing with the +% space in front. Of course you are then responsible to always add it +% when necessary, but that does make the source more readable so it is +% a good thing. This also has the advantage that the star forms are +% now unnecessary again and can be used in the way implemeented by +% \pkg{hyperref} if both packages are used together. +% +% In fact it would be much nicer to make that the +% default but the package has been used by many people for so many +% years that changing the default would break way to many older documents. % % % \DescribeMacro\labelformat -% \NewIn{2002} % A reference via |\ref| produces by default the data associated with % the corresponding |\label| command (typically a number); any -% additional formatting has to be provided by the user. If, for -% example, references to equations are always to be typeset as -% ``equation (\textit{number})'', one has to code -% ``\verb=equation (\ref{=\textit{key}\verb=})=''. With |\labelformat| -% the \texttt{varioref} package offers a possibility to generate such -% frills automatically. The command takes two arguments: the first is -% the name of a counter and the second is its representation when -% referenced. This means that for a successful usage, one has to know -% the counter name being used for generating the label, though in -% practice this should not pose a problem. The current counter number -% is picked up as an argument. -% Here are two examples: +% additional formatting has to be provided by the user. With +% |\labelformat| it is possible to declare scuch formatting for each +% ``reference'' counter, e.g., %\begin{verbatim} % \labelformat{section}{section~#1} % \labelformat{equation}{equation~(#1)}} @@ -273,25 +355,31 @@ % A side effect of using |\labelformat| is that, depending on the % defined formatting, it becomes impossible to use |\ref| at the % beginning of a sentence (if its replacement text starts with a -% lowercase letter). To overcome this problem \texttt{varioref} -% introduces the commands |\Ref| and |\Vref| that behave like -% |\ref| and |\{vref| except that they uppercase the first token -% of the generated string. -% -% To make |\Ref| or |\Vref| work properly the very first token in -% the second argument of |\labelformat| has to be a simple \textsc{ascii} -% letter, otherwise the capitalization will fail or worse, you will end -% up with some error messages. If you actually need something more -% complicated in this place (e.g., an accented letter) -% you have to explicitly surround it with braces, to -% identify the part that needs to be capitalized. For example, for -% figure references in the Hungarian language you might want to write -% |\labelformat{figure}{{\'a}bra~\thefigure}|. -% -% \DescribeMacro\vpagerefnum +% lowercase letter). +% \ChangedIn{2019} +% For that reason \pkg{varioref} provided the commands |\Ref| and +% |\Vref|. They behave like |\ref| and |\vref| except that they +% uppercase the first token of the generated string. These days +% |\labelformat| and |\Ref| are already provided by the \LaTeX{} +% kernel; only |\Vref| is still defined within the \pkg{varioref} +% package. +% +% To make |\Ref| or |\Vref| work properly the very first token in the +% second argument of |\labelformat| has to be a simple \textsc{ascii} +% or UTF-8 letter, otherwise the capitalization will fail or worse, +% you will end up with some error messages. If you actually need +% something more complicated in this place (e.g., an accented letter +% not written as a UTF-8 character) you have to explicitly surround it +% with braces, to identify the part that needs to be capitalized. For +% example, for figure references in the Hungarian language you might +% want to write |\labelformat{figure}{{\'a}bra~\thefigure}| or use +% |\labelformat{figure}{ábra~\thefigure}| which avoids the brace +% problem. +% +% \DescribeMacro\thevpagerefnum % If you like to have |\vref| suppress the page number on pages where % label and reference fall onto the same page, but prefer reference to -% page numbers otherwise then |\vpagerefnum| can be used. This macro +% page numbers otherwise then |\thevpagerefnum| can be used. This macro % hold the current page ``number'' when |\vpageref| and friends are % executed. Thus, by defining, for example %\begin{verbatim} @@ -321,10 +409,10 @@ %\end{verbatim} % to achieve the same effect. % -% If more than one language is specified with \texttt{varioref} then +% If more than one language is specified with \pkg{varioref} then % it will start using the last language selected. Switching of % languages is managed through Babel; nevertheless all languages of -% interest need to be specified when \texttt{varioref} is loaded so +% interest need to be specified when \pkg{varioref} is loaded so % that it can integrate their strings into the Babel system. % % @@ -404,7 +492,7 @@ % % % -% \section{Options} +% \section{Options} \label{options} % % As mentioned above the package supports all standard options offered % by the Babel system to customize the strings produced, it may also @@ -414,6 +502,19 @@ % development. The default \texttt{final} produces error message when % a generated string falls onto a page boundary (see next section). % +% Newly introduced in 2019 are the options \option{space} (default) +% and \option{nospace}. While the former is the default to allow +% \NewIn{2019} +% documents written in the last twenty years to continue to work +% correctly, I nowadays, suggest that you always use the package with +% the option \option{nospace}. This will stop \pkg{varioref} from +% meddling with the spaces preceding commands and thus make the star +% forms |\vref*| and |\vpageref*| unnecessary. +% +% This means that the star forms can then be used as defined by +% \pkg{hyperref} for suppressing a hyperlink when both packages are +% used together (which is a rather typical scenario these days). +% % % \section{A few warnings} % @@ -425,7 +526,7 @@ % another (i.e., inserting one string, finding that this is wrong, % inserting another string on the next run which makes the first % string correct again, inserting \ldots). The current implementation -% of \texttt{varioref} therefore issues an error message whenever the +% of \pkg{varioref} therefore issues an error message whenever the % generated text is broken across page boundaries, e.g., % \begin{quote} % table 5 on the current \meta{page break} page @@ -447,8 +548,10 @@ % At the end final a warning: every use of |\vref| will internally % generate two macro names to keep track of the string positions % within the document. As a result you may run out of name space or -% main memory if you make heavy use of this macro on a small \TeX{} -% installation. +% main memory\footnote{Not really that likely these days, but one +% never knows \ldots. In any case \TeX{} will process your document a +% tiny bit faster.} if you make heavy use of this macro on a small +% \TeX{} installation. %\DescribeMacro\fullref For this reason the primitive command % |\fullref| is also provided. This command can be used whenever you % know for sure that label and reference can't fall onto nearby pages. @@ -461,7 +564,7 @@ % The next bit of code contains the documentation driver file for % \TeX{}, i.e., the file that will produce the documentation you are % currently reading. It will be extracted from this file by the -% \texttt{docstrip} program. +% \pkg{docstrip} program. % \begin{macrocode} %<*driver> \documentclass{ltxdoc} @@ -622,6 +725,27 @@ \def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}% }} % \end{macrocode} +% Arabic option text was contributed by Ihab Samir Mattar +% (\texttt{dr\_kremlin@hotmail.com}). As our standard documentation +% workflow uses pdf\TeX{} the Arabic letters can't be displayed +% easily, so you will see missing glyphs below. To see the real +% letters you have to look at the source or package file. +% \changes{v1.6b}{2019/09/8}{Option arabic added} +% \begin{allowtofu} +% \begin{macrocode} +\DeclareOption{arabic} + {\vref@addto\extrasarabic{% + \def\reftextfaceafter {بالصفحة \reftextvario{المقابلة}{اللاحقة}}% + \def\reftextfacebefore{بالصفحة \reftextvario{المقابلة}{المُنْصَرِمَةٌ}}% + \def\reftextafter {بالصفحة \reftextvario{اللاحقة}{التالية}}% + \def\reftextbefore {بالصفحة \reftextvario{السابقة}{المُنْصَرِمَةٌ}}% + \def\reftextcurrent {ب\reftextvario{الصفحة الحالية}{هذه الصفحة}}% + \def\reftextfaraway#1{بالصفحة رقم~\pageref{#1}}% + \def\reftextpagerange#1#2{بالصفحات~\pageref{#1}--\pageref{#2}}% + \def\reftextlabelrange#1#2{\ref{#1} حتى~\ref{#2}}% + }} +% \end{macrocode} +% \end{allowtofu} % \changes{v1.2a}{1998/11/27}{Added austrian defaults (identical to german)} % The austrian defaults are the same as the german ones. % \begin{macrocode} @@ -1437,14 +1561,30 @@ \DeclareOption{final}{\AtEndOfPackage\vrefshowerrors} % the default % \end{macrocode} % +% +% Whether or not \pkg{varioref} uses its own white space and +% removes the one in the source document is handeled by the +% following two options. For historical reasons the default is to +% handle the space, but the recommendation these days is to use +% \texttt{nospace}. +% \changes{v1.6a}{2019/08/25}{Provide options \texttt{space} and \texttt{nospace}} +% \begin{macrocode} +\newif\if@vrefhandlespace +\DeclareOption{space} {\@vrefhandlespacetrue} +\DeclareOption{nospace}{\@vrefhandlespacefalse} +% \end{macrocode} +% +% +% +% % After all options are declared we execute the default option % \texttt{english} to set up the defaults and then call % |\ProcessOptions*| to handle any option passed to the package. % The star form is used since we want to execute the options in the % order they are given (in case this isn't used together with the -% \texttt{babel} package). +% \pkg{babel} package). % \begin{macrocode} -\ExecuteOptions{english,final} +\ExecuteOptions{english,final,space} \ProcessOptions* % \end{macrocode} % @@ -1470,12 +1610,23 @@ % internal and the user label. This command should be robust since % the user might put it anywhere. % -% We now start by scanning for a star which means: do not add a -% space in front of the generated text---ever. +% We now start by scanning for a star and then call either +% |\vp@gerefstar| or |\vp@geref|. +% The space handling logic is a bit twisted these days: if the +% option \texttt{space} is +% in force then preceding spaces in the document are removed and +% the star means that the command should not add its own +% space. However, with option \texttt{nospace} any space already in the +% source will be left alone and the command doesn't add its own +% space either. Thus in this case the star form doesn't +% have any effect and below |\vp@gerefstar| is let to +% |\vp@geref|. This allows a package like \pkg{hyperef} to redefine +% it and useit for its own tasks (like denoting that no link should +% be produced). % \begin{macrocode} \DeclareRobustCommand\vpageref{\@ifstar - {\let\vref@space\relax\vp@geref}% - {\let\vref@space\space\vp@geref}} + {\let\vref@maybe@space\@empty\vp@gerefstar}% + {\let\vref@maybe@space\space \vp@geref}} % \end{macrocode} % % \begin{macrocode} @@ -1493,7 +1644,7 @@ % \begin{macro}{\vref@space} % \changes{v1.4a}{2002/03/06}{Default added} % A default for |\vref@space|. This isn't really needed except in -% the case that somebody has hooked into the \texttt{varioref} +% the case that somebody has hooked into the \pkg{varioref} % interfaces at a lower level (which isn't really supported, % but\ldots). So giving a default will prevent an error message in % that case (and should hopefully produce the same behavior as before). @@ -1507,13 +1658,12 @@ % \begin{macrocode} \def\@vpageref[#1]{\@ifnextchar[% % \end{macrocode} -% The default for the second optional argument is a space which is -% prefixed by |\unskip| to get rid of any leading space inserted -% already. +% By default the second optional argument is empty. % \changes{v1.0h}{1994/06/11}{Pass first argument in both cases} % \changes{v1.0i}{1994/06/20}{Do it correctly} +% \changes{v1.6a}{2019/08/25}{Default for optional argumet changed} % \begin{macrocode} - {\@@vpageref{#1}}{\@@vpageref{#1}[\unskip\vref@space]}} + {\@@vpageref{#1}}{\@@vpageref{#1}[]}} % \end{macrocode} % \end{macro} % @@ -1525,10 +1675,14 @@ % \begin{macrocode} \def\@@vpageref#1[#2]#3{% % \end{macrocode} -% First it switches to horizontal mode if necessary and also -% removes any leading space. +% First it switches to horizontal mode if necessary. If there was a +% preceding space we remember its size in |\@tempskipa| and then remove it for +% reinsertion later. +% \changes{v1.6a}{2019/08/25}{Don't drop a preceding space completely +% but reinsert it later after setting a label} % \begin{macrocode} - \leavevmode\unskip + \leavevmode + \@tempskipa\lastskip \unskip % \end{macrocode} % Then it advances the counter |\c@vrcnt| by one which is used to % generate internal label names. @@ -1561,15 +1715,37 @@ % special combination of packages. % % These days we actually use |\vref@label| instead of |\label| as -% this avoids problems with Babel or \texttt{amsmath} redefining +% this avoids problems with Babel or \pkg{amsmath} redefining % the latter command. % \changes{v1.4e}{2003/01/08}{Use \cs{vref@label} instead of % \cs{label} (pr/3489)} % \begin{macrocode} \vref@label{\the\c@vrcnt @xvr}% % \end{macrocode} +% Since we have removed +% any leading space above we now insert a space here after the +% label. It is done here so that it is still visible from following +% code---the space before the label would be hidden. +% What kind of space depends on the options to the +% package. If \texttt{space} was specified, we insert our own +% space, namely |\vref@maybe@space|. This will typeset a space +% unless the star form of the current command was used. +% \begin{macrocode} + \if@vrefhandlespace + \vref@maybe@space + \else +% \end{macrocode} +% But if \texttt{nospace} is in force we simply use the same space +% value that was used in the source document (unless that was zero +% or non-existent. +% \begin{macrocode} + \ifdim\@tempskipa=\z@ \else + \hskip\@tempskipa + \fi + \fi +% \end{macrocode} % \changes{v1.1g}{1998/05/10}{Test if inside AMS display (pr2175)} -% Inside displays of the \texttt{amsmath} package the |\label| command +% Inside displays of the \pkg{amsmath} package the |\label| command % is redefined which makes the test for loops incorrect if a |\vref| % is used in, say, |\intertext|. So we test this condition first and % only do the test if |\label| doesn't have a special meaning. @@ -1612,19 +1788,17 @@ %\end{verbatim} % But this is not possible because it would result in getting % `Labels may have changed\ldots' warnings for every run. Now we -% are ready to produce the textual strings. Since we have removed -% any leading space we now insert a space (unless this was the star -% form of the command) and then compare the two -% page references. +% are ready to produce the textual strings. % \begin{macrocode} - \vref@space \ifx\@tempa\thevpagerefnum % \end{macrocode} % If they are the same we insert the first argument into the input % stream. Otherwise we insert the second argument. Recall that % those are the two optional arguments of |...|. However, if the % user explicitly requested an empty text string using the optional -% argument we cancel any preceding space. +% argument we cancel any preceding space since in this case we are +% otherwise likely to end up with spaces one before and one after +% |\vpageref|. % \changes{v1.2f}{2000/07/07}{Don't output space if optional argument % empty (pr/3230)} % \begin{macrocode} @@ -1635,7 +1809,14 @@ #1% \fi \else - #2% +% \end{macrocode} +% If |#2| is empty we do nothing otherwise we insert it followed by +% a space. +% \begin{macrocode} + \def\@tempc{#2}% + \ifx\@tempc\@empty \else + #2\vref@space + \fi % \end{macrocode} % Now we check if the page number of the referenced object (stored % in |\thevpagerefnum| is a single positive number. @@ -1761,7 +1942,7 @@ % \changes{v1.0l}{1994/07/07}{Explicitly expand \cs{label} argument for babel} % % These days we actually use |\vref@label| instead of |\label| as -% this avoids problems with Babel or \texttt{amsmath} redefining +% this avoids problems with Babel or \pkg{amsmath} redefining % the latter command. % \changes{v1.4e}{2003/01/08}{Use \cs{vref@label} instead of % \cs{label} (pr/3489)} @@ -1778,12 +1959,38 @@ % \end{macro} % % +% \begin{macro}{\vp@gerefstar} +% The default code for the star form is identical to the previous +% macro |\vp@geref|. It only produces a different result because +% before calling it we set |\vref@maybe@space| to do nothing. +% +% The \pkg{hyperref} package can then change the meaning of this +% command to suppress a hyperlink. +% +% It is is also a good way to check if we are running with a new +% \pkg{varioref} by testing +%\begin{verbatim} +% \ifdefined\vp@gerefstar +% ... code fore noew varioref +% \else +% ... code for old varioref +% \fi +%\end{verbatim} +% +% \changes{v1.6a}{2019/08/25}{Command added to support hyperref better} +% \begin{macrocode} +\let\vp@gerefstar\vp@geref +% \end{macrocode} +% \end{macro} +% +% + % \begin{macro}{\vref@label} % \changes{v1.4e}{2003/01/08}{Macro added (pr/3489)} % This macro is like |\label| in the kernel but without passing on % |\@currentlabel|, ie useful if all we are interested in is the % page number. It also has the effect that it is unaffected by -% \texttt{amsmath} or Babel redefining the |\label| command. +% \pkg{amsmath} or Babel redefining the |\label| command. % \begin{macrocode} \def\vref@label#1{\@bsphack \protected@write\@auxout{}% @@ -1830,19 +2037,48 @@ % % % \begin{macro}{\vref} +% We start by scanning for a star form and then continue in a +% different macro depending on the result. % \changes{v1.3a}{2001/04/12}{Scan for star form} -% We start by scanning for a star form in which case we do not put -% any space before the generated text (only remove some). -% \begin{macro}{\vr@f} +% \changes{v1.6a}{2019/08/25}{Adjusted for new spacing regime} % \begin{macrocode} \DeclareRobustCommand\vref{\@ifstar - {\let\vref@space\relax\vr@f}% - {\let\vref@space\nobreakspace\vr@f}} + {\vref@star}{\vr@f}} % \end{macrocode} -% And now we do the real work\ldots +% \end{macro} + + + +% \begin{macro}{\vref@star} +% +% The star form is easy (and just a convenient shortcut), just call +% |\ref| followed by |\vpageref| and pass the optional argument to +% the latter. We don't support the second optional argument of +% |\vpageref|, it that is needed one has to call both commands +% explicitly +% \changes{v1.6a}{2019/08/25}{Command added to support hyperref better} +% \begin{macrocode} +\newcommand\vref@star[2][]{% + \ref{#2} + \vpageref[#1]{#2}} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\vr@f} +% The normal case is a little bit more elaborated \ldots % \changes{v1.3c}{2001/09/04}{Correct typo in name} +% \changes{v1.6a}{2019/08/25}{Adjusted for new spacing regime} % \begin{macrocode} -\def\vr@f#1{% +\def\vr@f{% + \leavevmode +% \end{macrocode} +% If option \texttt{space} is used then we remove a preceding space +% and add our own unbreakable space instead. Otherwise we don't do +% any space-handling. +% \begin{macrocode} + \if@vrefhandlespace + \unskip \nobreakspace + \fi % \end{macrocode} % The use of|\nobreakspace| or |~| after the |\unskip| means that % this command will always produce a normal space while @@ -1856,24 +2092,15 @@ % \changes{v1.2a}{1998/11/27}{Use \cs{nobreakspace} (pr/2909)} % \changes{v1.2a}{1998/11/27}{Add \cs{leavevmode}} % -% Above comments all refer to the earlier versions where there was -% no possibility to suppress the space at all. By now we have -% |\vref*| and |\vpageref*| to suppress the in internally generated -% space by redefining |\vref@space| appropriately. -% \begin{macrocode} - \leavevmode\unskip\vref@space - \ref{#1}% -% \end{macrocode} -% That means we have have to use |\vpageref| and not the internal -% |\@vpageref| --- otherwise we would pick up the -% ``current'' definition for |\vref@space| instead of setting it -% back to |\space|. -% \changes{v1.4c}{2002/06/18}{Use \cs{vpageref} not \cs{@vpageref} (pr/3403)} +% After having handled (or not handled) the spacing we call +% |\vref@star| to scan the optional arguments and do the rest. +% If that command has been altered by \pkg{hyperref} then the +% current one needs altering too and does the argument scanning explicitly. % \begin{macrocode} - \vpageref[\unskip]{#1}} + \vref@star % in hyperref this needs to be explicit +} % \end{macrocode} % \end{macro} -% \end{macro} % % % \begin{macro}{\is@pos@number} @@ -2061,81 +2288,154 @@ % \end{macro} % % -% \subsection{An extension of counter referencing} -% -% \begin{macro}{\refstepcounter} -% \changes{v1.4a}{2002/02/24}{Macro redefined} -% -% At the moment a reference to a counter |foo| will generate the -% equivalent of |\p@foo\thefoo| although not quite in this form. For -% some applications it would be nice of one could have |\thefoo| being -% an argument to |\p@foo| to be able to put material before and after -% the number generated by |\thefoo|. This can be easily achieved with -% a small change to one of the kernel commands as follows: -% \begin{macrocode} -\def\refstepcounter#1{\stepcounter{#1}% - \protected@edef\@currentlabel - {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}% -} -% \end{macrocode} -% The trick is to ensure that |\csname the#1\endcsname| is turned into -% a single token before |\p@...| is expanded further. This way, if the -% |\p@...| command is a macro with one argument it will receive -% |\the...|. With the kernel code (i.e., without the |\expandafter|) -% it will instead pick up |\csname| which would be disastrous. -% -% Using |\expandafter| instead of braces delimiting the argument is -% better because, assuming that the |\p@...| command is not defined as -% a macro with one argument, the braces will stay and prohibit kerning -% that might otherwise happen between the glyphs generated by -% |\the...| and surrounding glyphs. -% \end{macro} % -% \begin{macro}{\labelformat} +% \begin{macro}{\Vref} % \changes{v1.4a}{2002/02/24}{Macro added} -% A shortcut to set the |\p@...| macro for a counter. It will pick -% up the counter representation as an argument so that it can be -% specially formatted. +% |\Vref| is the counterpart to |\vref| with |\ref| replaced by +% |\Ref| in its definition. +% \changes{v1.6a}{2019/08/25}{Adjusted for new spacing regime} % \begin{macrocode} -\def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1} +\DeclareRobustCommand\Vref{\@ifstar + {\Vref@star}% + {\Vr@f}} % \end{macrocode} % \end{macro} -% -% \begin{macro}{\Ref} -% \changes{v1.4a}{2002/02/24}{Macro added} -% This macro expands the result of |\ref| and then uppercases the -% first token. Only useful if the label was generated via -% |\labelformat| and contains some lower case letter at its start. If -% the label starts with a complicated construct (e.g., an accented -% letter) one has to surround everything that needs uppercasing in -% a brace group in the definition of |\labelformat|.\footnote{There -% is one problem with this approach: the braces are kept in a -% normal \texttt{\textbackslash ref} which might spoil kerning. -% Perhaps one day this needs redoing.} -% \begin{macrocode} -\DeclareRobustCommand\Ref[1]{\protected@edef\@tempa{\ref{#1}}% - \expandafter\MakeUppercase\@tempa} +% +% \begin{macro}{\Vref@star} +% \changes{v1.6a}{2019/08/25}{Command added to support hyperref better} +% \begin{macrocode} +\newcommand\Vref@star[2][]{% + \Ref{#2} + \vpageref[#1]{#2}} % \end{macrocode} % \end{macro} -% -% \begin{macro}{\Vref} -% \changes{v1.4a}{2002/02/24}{Macro added} +% % \begin{macro}{\Vr@f} % \changes{v1.4a}{2002/02/24}{Macro added} % \changes{v1.4x}{2010/08/04}{Correct spacing -- same mistake as in \cs{vref} % (pr/4123)} -% |\Vref| is the counterpart to |\vref| with |\ref| replaced by -% |\Ref| in its definition. +% \changes{v1.6a}{2019/08/25}{Adjusted for new spacing regime} % \begin{macrocode} -\DeclareRobustCommand\Vref{\@ifstar - {\let\vref@space\relax\Vr@f}% - {\let\vref@space\nobreakspace\Vr@f}} -\def\Vr@f#1{% - \leavevmode\unskip\vref@space - \Ref{#1}% - \vpageref[\unskip]{#1}} +\def\Vr@f{% + \if@vrefhandlespace + \unskip \vref@space + \fi + \Vref@star % in hyperref this needs to be explicit +} % \end{macrocode} % \end{macro} + + +% \begin{macro}{\vpagerefcompare} +% +% \changes{v1.6a}{2019/08/25}{Macro added} +% \begin{macrocode} +\DeclareRobustCommand\vpagerefcompare[2]{% label1, label2, TRUE, FALSE + \vrefpagenum\@tempa{#1}% + \vrefpagenum\@tempb{#2}% + \ifx\@tempa\@tempb + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\vpagerefnearby} +% \changes{v1.6a}{2019/08/25}{Macro added} +% Test if |\vpageref| is going to be at most $\pm1$ off from +% current page. +% \begin{macrocode} +\DeclareRobustCommand\vpagerefnearby[1]{% label, TRUE, FALSE + \leavevmode + \@tempskipa\lastskip \unskip + \global\advance\c@vrcnt\tw@ % keep oddness to not disturb \vrefvario + \vref@label{\the\c@vrcnt @vn}% + \ifdim\@tempskipa=\z@ \else + \hskip\@tempskipa + \fi + \vref@pagenum\@tempa{\the\c@vrcnt @vn}% + \is@pos@number\@tempa + {% + \vrefpagenum\@tempb{#1}% + \is@pos@number\@tempb + {% + \ifcase\numexpr \@tempa -\@tempb+1\relax + \or \or \else \expandafter \@thirdofthree \fi + \@firstoftwo + }% + {\@secondoftwo}% + }% + {\@secondoftwo}% +} +% \end{macrocode} +% \end{macro} +% + +% \begin{macro}{\vpagerefcomparenearby} +% \changes{v1.6a}{2019/08/25}{Macro added} +% True if the two pages have arabic page numbers are at most off by +% one so that |\vpageref| would produce a special string. +% +% This is n some sense a general version of |\vpagerefnearby| for +% use in more complex situations. I.e., if you try to determine if +% a larger set of references would be close to the current page and +% you use each time |\vpagerefnearby| then you generate a lot of +% internal labels for the current point. Thus by setting the label +% yourself you can save processing time and space. On the other +% hand you have to be careful to place the label into the right +% place which can be a bit complicated if you look at the +% definition of |\vpagerefnearby| that does all this automatically +% for you. This is why the current macro is not discussed in the +% user interface section as it is really just for package +% developers. +% \begin{macrocode} +\DeclareRobustCommand\vpagerefcomparenearby[2]{% label1, label2, TRUE, FALSE + \vrefpagenum\@tempa{#1}% + \is@pos@number\@tempa + {% + \vrefpagenum\@tempb{#2}% + \is@pos@number\@tempb + {% + \ifcase\numexpr \@tempa -\@tempb+1\relax + \or \or \else \expandafter \@thirdofthree \fi + \@firstoftwo + }% + {\@secondoftwo}% + }% + {\@secondoftwo}% +} +% \end{macrocode} +% \end{macro} + +% +% +% \subsubsection{Compatibility with older \LaTeX{} formats} +% +% +% \begin{macro}{\labelformat} +% \begin{macro}{\Ref} +% \begin{macro}{\refstepcounter} +% We don't need to define \cs{labelformat} and \cs{Ref} or change the +% definition of \cs{refstepcounter} any longer because this is now +% done in the \LaTeX{} kernel. However, if this package is used +% together with an older kernel, this is not true, so for this +% special case we keep the definitions. +% \begin{macrocode} +\ifx\labelformat\@undefined % assume we are in an older kernel + \def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1} + \DeclareRobustCommand\Ref[1]{\protected@edef\@tempa{\ref{#1}}% + \expandafter\MakeUppercase\@tempa} + \def\refstepcounter#1{\stepcounter{#1}% + \protected@edef\@currentlabel + {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} % \end{macro} % % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/tools/varioref.ins b/Master/texmf-dist/source/latex/tools/varioref.ins index 6c0482ddd08..e436202e4d0 100644 --- a/Master/texmf-dist/source/latex/tools/varioref.ins +++ b/Master/texmf-dist/source/latex/tools/varioref.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1993-2017 +%% Copyright (C) 1993-2019 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% @@ -16,7 +16,7 @@ %% The latest version of this license is in %% https://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. +%% version 2008 or later. %% %% As this file contains legal notices, it is NOT PERMITTED to modify %% this file in any way that the legal information placed into @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright 1993-2017 +Copyright (C) 1993-2019 The LaTeX3 Project and any individual authors listed elsewhere in this file. diff --git a/Master/texmf-dist/source/latex/tools/verbatim.dtx b/Master/texmf-dist/source/latex/tools/verbatim.dtx index 4b85f1a3ad9..1dc8682f798 100644 --- a/Master/texmf-dist/source/latex/tools/verbatim.dtx +++ b/Master/texmf-dist/source/latex/tools/verbatim.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. diff --git a/Master/texmf-dist/source/latex/tools/xr.dtx b/Master/texmf-dist/source/latex/tools/xr.dtx index 7889f713e91..417a98c1c1e 100644 --- a/Master/texmf-dist/source/latex/tools/xr.dtx +++ b/Master/texmf-dist/source/latex/tools/xr.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -% 2006 2008 2009 2018 2019 +% Copyright (C) 1993-2019 +% % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % @@ -21,11 +21,11 @@ % % \fi % \iffalse -%% File: xr.dtx Copyright (C) 1994-1994 2018 2019 David Carlisle +%% File: xr.dtx Copyright (C) 1993-2019 David Carlisle % %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{xr} -%<package> [2019/01/05 v5.04 eXternal References (DPC)] +%<package> [2019/07/22 v5.05 eXternal References (DPC)] % %<*driver> \documentclass{ltxdoc} @@ -56,7 +56,8 @@ % aux files of \cmd\include'ed files. (Reported by J-PD)} % % \changes{v5.02}{1994/05/28}{Update for LaTeX2e} -% \changes{v5.02}{1994/05/28}{Fix for conditionals in aux file} +% \changes{v5.03}{2018/10/01}{Fix for conditionals in aux file} +% \changes{v5.05}{2019/07/20}{include xcite} % % % This package implements a system for eXternal References. @@ -83,6 +84,11 @@ % characters can not usually be used in |\label|, and similarly may not % be used in the optional argument to |\externaldocument|. % +% As first suggested in Enrico Gregorio's |xcite| package, the current version +% also allows |\cite| to reference |\bibitem| in the external document. +% For fcompatibility with |xcite|, |\externalcitedocument| is made available +% as an alias for |\externaldocument| +% % \StopEventually{} % % \section{The macros} @@ -94,6 +100,7 @@ % Check for the optional argument. % \begin{macrocode} \def\externaldocument{\@ifnextchar[\XR@{\XR@[]}} +\let\externalcitedocument\externaldocument % \end{macrocode} % % Save the optional prefix. Start processing the first |aux| file. @@ -159,11 +166,13 @@ \long\def\XR@test#1#2#3#4\XR@{% \let\XR@tempa\@gobbletwo \ifx#1\newlabel - \let\XR@tempa\@firstoftwo% + \let\XR@tempa\@firstoftwo + \else\ifx#1\bibcite + \let\XR@tempa\@firstoftwo \else\ifx#1\@input \let\XR@tempa\@secondoftwo - \fi\fi - \XR@tempa{\newlabel{\XR@prefix#2}{#3}}{\edef\XR@list{\XR@list#2\relax}}% + \fi\fi\fi + \XR@tempa{#1{\XR@prefix#2}{#3}}{\edef\XR@list{\XR@list#2\relax}}% \ifeof\@inputcheck\expandafter\XR@aux \else\expandafter\XR@read\fi} % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/tools/xspace.dtx b/Master/texmf-dist/source/latex/tools/xspace.dtx index 4fd2de18e70..0745caf5071 100644 --- a/Master/texmf-dist/source/latex/tools/xspace.dtx +++ b/Master/texmf-dist/source/latex/tools/xspace.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright (C) 1993-2019 % % The LaTeX3 Project and any individual authors listed elsewhere % in this file. |