diff options
author | Karl Berry <karl@freefriends.org> | 2024-09-17 19:55:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-09-17 19:55:44 +0000 |
commit | fef3d53c2d2fa56633d916127d7771543c01e128 (patch) | |
tree | 886a096b1d610c07cd1195ae5a2aec0d70c4e4a5 | |
parent | bba76026c254437e056638f0675fb9f3ec586050 (diff) |
tableof (17sep24)
git-svn-id: svn://tug.org/texlive/trunk@72313 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/tableof/README.md | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tableof/tableof.pdf | bin | 58824 -> 62790 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tableof/tableoftest.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/tableof/tableof.dtx | 165 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tableof/tableof.sty | 27 |
5 files changed, 145 insertions, 59 deletions
diff --git a/Master/texmf-dist/doc/latex/tableof/README.md b/Master/texmf-dist/doc/latex/tableof/README.md index fa5ea8d72ba..2f0b93dd0a9 100644 --- a/Master/texmf-dist/doc/latex/tableof/README.md +++ b/Master/texmf-dist/doc/latex/tableof/README.md @@ -2,9 +2,9 @@ tableof ======= - Package: tableof (Tables of tagged contents) -- Version: 1.4c (2021/07/05) +- Version: 1.4d (2024/09/17) - License: LPPL 1.3c -- Copyright (C) 2012, 2013, 2015, 2018, 2021 Jean-Francois Burnol <jfbu at free dot fr> +- Copyright (C) 2012, 2013, 2015, 2018, 2021, 2024 Jean-Francois Burnol <jfbu at free dot fr> Provides `\toftagstart{}`, `\toftagstop{}`, `\toftagthis{}`, `\tofuntagthis{}` to tag chapters, sections or any other sectioning units destined to end up in @@ -31,6 +31,10 @@ usable only once, contrarily to the `\tableof{}` et al. package macros. Change History ============== +* v1.4d (2024/09/17) reestablishes compatibility with `hyperref`, + which got broken at the latter `v7.01c` release. The package now + requires LaTeX 2020-10-01. Thanks to Ekkart Kleinod for report. + * v1.4c (2021/07/05) additional efforts for `biblatex` compatibility. Allow style file extraction via `etex`, reword the abstract. Use utf8 source encoding. diff --git a/Master/texmf-dist/doc/latex/tableof/tableof.pdf b/Master/texmf-dist/doc/latex/tableof/tableof.pdf Binary files differindex f04fc964a07..1c2d6ae655a 100644 --- a/Master/texmf-dist/doc/latex/tableof/tableof.pdf +++ b/Master/texmf-dist/doc/latex/tableof/tableof.pdf diff --git a/Master/texmf-dist/doc/latex/tableof/tableoftest.tex b/Master/texmf-dist/doc/latex/tableof/tableoftest.tex index f8ddc8a2420..127cb2d1ab4 100644 --- a/Master/texmf-dist/doc/latex/tableof/tableoftest.tex +++ b/Master/texmf-dist/doc/latex/tableof/tableoftest.tex @@ -22,9 +22,9 @@ %% in the same archive or directory.) %% %% Package: tableof -%% Version: 1.4c (2021/07/05) +%% Version: 1.4d (2024/09/17) %% License: LPPL 1.3c -%% Copyright (C) 2012, 2013, 2015, 2018, 2021 Jean-Francois Burnol <jfbu at free dot fr> +%% Copyright (C) 2012, 2013, 2015, 2018, 2021, 2024 Jean-Francois Burnol <jfbu at free dot fr> %% %% This file `tableoftest.tex' serves to demontrate the use of the %% commands from the package `tableof'. diff --git a/Master/texmf-dist/source/latex/tableof/tableof.dtx b/Master/texmf-dist/source/latex/tableof/tableof.dtx index bd7a435cefb..bd952ec2a37 100644 --- a/Master/texmf-dist/source/latex/tableof/tableof.dtx +++ b/Master/texmf-dist/source/latex/tableof/tableof.dtx @@ -1,14 +1,14 @@ % -*- coding: utf-8; -*- %<*none> -{\def\doctimestamp {Time-stamp: <05-07-2021 14:42:11 CEST>}% +{\def\doctimestamp {Time-stamp: <17-09-2024 10:15:25 CEST>}% \def\getdtxtimestamp #1 <#2 #3 #4>{#2 at #3 #4}% \xdef\tofdtxtimestamp {\expandafter\getdtxtimestamp\doctimestamp }}% %</none> %% %% Package: tableof -%% Version: 1.4c (2021/07/05) +%% Version: 1.4d (2024/09/17) %% License: LPPL 1.3c -%% Copyright (C) 2012, 2013, 2015, 2018, 2021 Jean-Francois Burnol <jfbu at free dot fr> +%% Copyright (C) 2012, 2013, 2015, 2018, 2021, 2024 Jean-Francois Burnol <jfbu at free dot fr> %% % See README.md for installation instructions % @@ -22,8 +22,8 @@ % The Author of this Work is: Jean-Francois Burnol <jfbu at free dot fr> %<*none> \def\pkgname {tableof} -\def\pkgdate {2021/07/05} -\def\pkgversion {v1.4c} +\def\pkgdate {2024/09/17} +\def\pkgversion {v1.4d} \def\pkgdescription {Tables of tagged contents (JFB)} \begingroup \input docstrip.tex @@ -237,11 +237,85 @@ A,B,C % \PassOptionsToPackage{dvipdfmx-outline-open}{bookmark} % \makeatother -\documentclass[a4paper,fontsize=11pt,abstract]{scrdoc} +\documentclass[a4paper,fontsize=11pt,abstract]{scrartcl} +\makeatletter +%%% START OF CUSTOM doc.sty LOADING (May 21, 2022 in xint.dtx) +%%% (August 26, 2022 in etoc.dtx, comments trimmed) +%%% (September 17, 2024 here, some unneeded stuff removed, +%%% I do not have time to do the syntax coloring as in etoc.pdf, +%%% and in particular there is here no reason to use doc=v2) + + +% At 1.4d I wanted to use doc v3, but hypdoc is causing too much trouble. +% - a warning in the log about hyperref already loaded, +% - an overwrite of my hidelinks option, +% - an impact on placement of codeline numbers in implementation part. +\usepackage{doc}[=v2] +% As explained above I was formerly using scrdoc hence ltxdoc indirectly. +% Let's emulate here the little I appear to need from ltxdoc.cls and +% srcdoc.cls. +% +\AtBeginDocument{\MakeShortVerb{\|}} +\DeclareFontShape{OT1}{cmtt}{bx}{n}{<-> ssub * cmtt/m/n}{} +\DeclareFontFamily{OMS}{cmtt}{\skewchar\font 48} % '60 +\DeclareFontShape{OMS}{cmtt}{m}{n}{<-> ssub * cmsy/m/n}{} +\DeclareFontShape{OMS}{cmtt}{bx}{n}{<-> ssub * cmsy/b/n}{} +\DeclareFontShape{OT1}{cmss}{m}{it}{<->ssub*cmss/m/sl}{} +\CodelineNumbered +% \EnableCrossrefs % but this will be hacked +% \setcounter{StandardModuleDepth}{1} % we don't use this mechanism currently +\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}} +\def\cmd@to@cs#1#2{\char\number`#2\relax} +% Here I am loading doc=v2 but formerly I was using ltxdoc via scrdoc +% which I dropped at release 1.4l (2022-05-29) and without much +% thinking I had kept this. +\DeclareRobustCommand\cs[1]{\texttt{\bslash#1}} +% As I may have the * active, or macro names with _ or ^, I should +% add \detokenize. But see below for a redefinition anyhow. +% +% More urgent is that I am also using hyperref and this definition gives wrong +% bookmarks if \cs is used in section titles. As I had very very few usags of +% \cs in the whole of xint.dtx, it took me a while to realize the problem +% here. Turns out that doc=v3 by default loads hypdoc which includes this +% configuration for hyperref compatibility: +\AtBeginDocument{% +\pdfstringdefDisableCommands{\def\cs#1{\textbackslash\detokenize{#1}}}% +}% +% As I have not loaded hyperref yet I must delay it to AtBeginDocument. +\providecommand\marg[1]{% + {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} +\providecommand\oarg[1]{% + {\ttfamily[}\meta{#1}{\ttfamily]}} +\providecommand\parg[1]{% + {\ttfamily(}\meta{#1}{\ttfamily)}} +% \@addtoreset{CodelineNo}{part}% No need for this here +% \def\partname{File}% \partname is "fixed" somewhere further down anyhow +% No need for this, anyhow I don't build the indices +% \gdef\codeline@wrindex#1{\if@filesw +% \begingroup +% \let\protect\noexpand +% \immediate\write\@indexfile +% {\string\indexentry{#1}% +% {\filesep\number\c@CodelineNo}}% +% \endgroup\fi} +% \let\filesep\@empty + +% There is very little we seem to need from the scrdoc extras: page geometry +% is set by geometry package and a4paper option from xint.tex file. So it +% seems I only need the hologo loading: +\usepackage{hologo} +%\DeclareRobustCommand*{\eTeX}{\hologo{eTeX}}% +%\DeclareRobustCommand*{\LuaTeX}{\hologo{LuaTeX}}% +% +\makeatother +%%% end of ltxdoc+srcdoc emulation from June 2022 xint.dtx, +%%% copied over almost verbatim to etoc.dtx on 2022/08/26, +%%% and copied and trimmed for tableof.dtx 2024/09/17. + \pagestyle{headings} \usepackage[T1]{fontenc} \usepackage[hscale=0.66,vscale=0.76]{geometry} - +\usepackage{centeredline} \usepackage{txfonts} \DeclareFontFamily{T1}{txtt}{} \DeclareFontShape{T1}{txtt}{m}{n}{ %medium @@ -314,6 +388,15 @@ pdfkeywords={LaTeX, table of contents},% pdfstartview=FitH,% pdfpagemode=UseOutlines} + +% Finally 1.4d uses doc=v2 +% % Attention que hypdoc fait +% % Package hyperref Info: Option `colorlinks' set `true' on input line 75. +% % Package hyperref Info: Option `plainpages' set `false' on input line 75. +% % Package hyperref Info: Option `bookmarksopen' set `true' on input line 75. +% % Package hyperref Info: Option `bookmarksnumbered' set `true' on input line 75. +% \AtBeginDocument{\hypersetup{hidelinks}}% fix de l'effet de hypdoc + \usepackage{bookmark} \DeclareRobustCommand\csa[1]{{\ttfamily\char`\\#1}} @@ -356,7 +439,7 @@ pdfpagemode=UseOutlines} Package version: \pkgversion\ (\pkgdate)\\ Documentation generated from tableof.dtx with timestamp \tofdtxtimestamp\\ - \textcopyright 2012, 2013, 2015, 2018, 2021 Jean-François Burnol + \textcopyright 2012, 2013, 2015, 2018, 2021, 2024 Jean-François Burnol <jfbu (at) free (dot) fr> \end{center} @@ -554,10 +637,6 @@ Please consider: this command should \emph{not} be used when the \section{Compatibility with other packages} -\tableof checks if |hyperref| is loaded as |hyperref| modifies the format of the -lines in the |.toc| file (and this must be taken into account). This check is -done at the \csa{begin}|{document}| so the order of loading is not important. - \tableof requires the document |.toc| file to use the |\contentsline| macro (possibly patched by other packages). It is thus incompatible with the |beamer| class. However, if |beamer| is used in an article mode, i.e., with @@ -585,6 +664,10 @@ tables of contents, apart from \hangafter1 } \makeatother +|2024/09/17 v1.4d: |reestablish compatibility with |hyperref|, +which got broken at the latter |v7.01c| release. The package now +requires \LaTeX{} |2020-10-01|. Thanks to Ekkart Kleinod for report. + |2021/07/05 v1.4c: |ensure the added scope-limiting group for |\tableof{}| and alike macros encompasses all contents of the |.toc| file even in presence of packages hacking into these contents (in particular |biblatex|). @@ -696,7 +779,7 @@ document uses standard |\tableofcontents| or like commands. %</none> %<*package> % \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} +\NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{atveryend} \DeclareOption*{\PackageWarning{tableof}{Option `\CurrentOption' is unknown.}} \ProcessOptions\relax @@ -738,7 +821,8 @@ document uses standard |\tableofcontents| or like commands. % macro is used to typeset the TOC, it is now the one bearing the % responsability for creating the scope-limiting group. % \begin{macrocode} -\AtBeginDocument{\IfFileExists{\jobname.toc} +\AtBeginDocument{% + \IfFileExists{\jobname.toc} {{\endlinechar\m@ne \makeatletter \newread\tof@tf @@ -746,7 +830,9 @@ document uses standard |\tableofcontents| or like commands. \tof@toctoks{\tof@begingroup}% \tof@readtoc \global\tof@toctoks=\expandafter{\the\tof@toctoks\tof@endgroup}% - \closein\tof@tf}}{}} + \closein\tof@tf}} + {}% +} % \end{macrocode} % The trick is that |\@ifundefined| chooses the undefined branch if the % meaning is |\relax|. Thus it is possible for \tableof to define and use @@ -771,26 +857,39 @@ document uses standard |\tableofcontents| or like commands. % |1.4c| replaces |{}| (last argument of |\@ifundefined|) by |\relax|. No % strong reason. We and \etoc use |\endlinechar-1| anyhow. % \begin{macrocode} -\AtBeginDocument{ +\AtBeginDocument{% \addtocontents{toc}{\string\@ifundefined{tof@begin}% {\global\let\string\tof@begin\relax \global\let\string\tof@finish\string\@empty \global\let\string\tof@starttags\string\@gobble \global\let\string\tof@stoptags\string\@gobble \global\let\string\tof@tagthis\string\@gobble - \global\let\string\tof@untagthis\string\@gobble}\relax} - \addtocontents{toc}{\string\tof@begin} + \global\let\string\tof@untagthis\string\@gobble}\relax}% + \addtocontents{toc}{\string\tof@begin}% +} % \end{macrocode} -% \LaTeX\ of 2020 or 2021 always has |\contentsline| with four arguments. +% \textbf{Now obsolete hyperref-related remark (see next paragraph)}: +% {\itshape\LaTeX\ of 2020 or 2021 always has |\contentsline| with four arguments. % So an update should be done here to always gobble four, else in absence % of |hyperref| some |{}| are left. Does not seem to matter a lot except % if all is executed in math mode... thanks to \etoc for example. -% No urgency here, only mentioning for the record. +% No urgency here, only mentioning for the record.} +% +% |hyperref| stopped defining its |\hyper@last| at its |7.01c| release in fall +% of 2023, but \tableof tested for it, if |hyperref| was found to be present, +% in case a document previously not using |hyperref| started using it on +% second compilation, hence with a wrong |.toc| file format (in earlier +% years). As \tableof was doing +% \centeredline{|\ifx\hyper@last\@undefined\tof@toctoks{}\fi|} it now +% unconditionally emptied |\tof@toctoks| in presence of |hyperref|. This is +% the same problem which impacted \etoc and got fixed at its |1.2c| release +% but unfortunately \tableof was not updated then. Belatedly fixed at |1.4d| +% of |2024/09/17|. +% +% Formerly this was a short macro, but it doesn't look like a problem +% to simply alias it to the long |\@gobblefour|. % \begin{macrocode} - \@ifpackageloaded{hyperref} - {\def\tof@gobblethree@orfour#1#2#3#4{}% - \ifx\hyper@last\@undefined\tof@toctoks{}\fi} - {\def\tof@gobblethree@orfour#1#2#3{}}} +\let\tof@gobblethree@orfour\@gobblefour % \end{macrocode} % |1.4b| (belatedly) fixes issue with |\tof@finish| getting lost due % to a final |\clearpage| before |\end{document}|. Indeed, formerly @@ -999,24 +1098,6 @@ document uses standard |\tableofcontents| or like commands. \endinput % \end{macrocode} % \MakePercentComment -\CharacterTable - {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z - Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z - Digits \0\1\2\3\4\5\6\7\8\9 - Exclamation \! Double quote \" Hash (number) \# - Dollar \$ Percent \% Ampersand \& - Acute accent \' Left paren \( Right paren \) - Asterisk \* Plus \+ Comma \, - Minus \- Point \. Solidus \/ - Colon \: Semicolon \; Less than \< - Equals \= Greater than \> Question mark \? - Commercial at \@ Left bracket \[ Backslash \\ - Right bracket \] Circumflex \^ Underscore \_ - Grave accent \` Left brace \{ Vertical bar \| - Right brace \} Tilde \~} - -\CheckSum{559} - \Finale %% %% End of file `tableof.dtx'. diff --git a/Master/texmf-dist/tex/latex/tableof/tableof.sty b/Master/texmf-dist/tex/latex/tableof/tableof.sty index 0af308c5eca..b2cc137c4ba 100644 --- a/Master/texmf-dist/tex/latex/tableof/tableof.sty +++ b/Master/texmf-dist/tex/latex/tableof/tableof.sty @@ -22,14 +22,14 @@ %% in the same archive or directory.) %% \ProvidesPackage{tableof} - [2021/07/05 v1.4c Tables of tagged contents (JFB)] + [2024/09/17 v1.4d Tables of tagged contents (JFB)] %% %% Package: tableof -%% Version: 1.4c (2021/07/05) +%% Version: 1.4d (2024/09/17) %% License: LPPL 1.3c -%% Copyright (C) 2012, 2013, 2015, 2018, 2021 Jean-Francois Burnol <jfbu at free dot fr> +%% Copyright (C) 2012, 2013, 2015, 2018, 2021, 2024 Jean-Francois Burnol <jfbu at free dot fr> %% -\NeedsTeXFormat{LaTeX2e} +\NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{atveryend} \DeclareOption*{\PackageWarning{tableof}{Option `\CurrentOption' is unknown.}} \ProcessOptions\relax @@ -42,7 +42,8 @@ {\expandafter\the\expandafter\tof@toctoks\tof@buffer}% \expandafter\tof@readtoc \fi } -\AtBeginDocument{\IfFileExists{\jobname.toc} +\AtBeginDocument{% + \IfFileExists{\jobname.toc} {{\endlinechar\m@ne \makeatletter \newread\tof@tf @@ -50,20 +51,20 @@ \tof@toctoks{\tof@begingroup}% \tof@readtoc \global\tof@toctoks=\expandafter{\the\tof@toctoks\tof@endgroup}% - \closein\tof@tf}}{}} -\AtBeginDocument{ + \closein\tof@tf}} + {}% +} +\AtBeginDocument{% \addtocontents{toc}{\string\@ifundefined{tof@begin}% {\global\let\string\tof@begin\relax \global\let\string\tof@finish\string\@empty \global\let\string\tof@starttags\string\@gobble \global\let\string\tof@stoptags\string\@gobble \global\let\string\tof@tagthis\string\@gobble - \global\let\string\tof@untagthis\string\@gobble}\relax} - \addtocontents{toc}{\string\tof@begin} - \@ifpackageloaded{hyperref} - {\def\tof@gobblethree@orfour#1#2#3#4{}% - \ifx\hyper@last\@undefined\tof@toctoks{}\fi} - {\def\tof@gobblethree@orfour#1#2#3{}}} + \global\let\string\tof@untagthis\string\@gobble}\relax}% + \addtocontents{toc}{\string\tof@begin}% +} +\let\tof@gobblethree@orfour\@gobblefour \AfterLastShipout {\immediate\write\@auxout{\string\@writefile{toc}{\string\tof@finish}}} \let\tof@global \@empty |