From 10d58b650d57a8ef1a125721339aaf4613fa5ea8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 31 May 2021 20:23:44 +0000 Subject: changes (31may21) git-svn-id: svn://tug.org/texlive/trunk@59408 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/changes/changes.drv | 2 +- Master/texmf-dist/source/latex/changes/changes.dtx | 48 +++++++++++++++++----- Master/texmf-dist/source/latex/changes/changes.ins | 5 ++- .../texmf-dist/source/latex/changes/examples.dtx | 24 ++++++++--- 4 files changed, 61 insertions(+), 18 deletions(-) (limited to 'Master/texmf-dist/source/latex/changes') diff --git a/Master/texmf-dist/source/latex/changes/changes.drv b/Master/texmf-dist/source/latex/changes/changes.drv index e8e7868fb14..4f8e28e5adf 100644 --- a/Master/texmf-dist/source/latex/changes/changes.drv +++ b/Master/texmf-dist/source/latex/changes/changes.drv @@ -1,6 +1,6 @@ %%% % driver file of changes package -\newcommand{\docversion}{4.0.4} +\newcommand{\docversion}{4.1.0} \documentclass[titlepage, parskip=half, toc=flat, cleardoublepage=empty, captions=nooneline, origlongtable, english]{scrartcl} diff --git a/Master/texmf-dist/source/latex/changes/changes.dtx b/Master/texmf-dist/source/latex/changes/changes.dtx index cdb43d7d46f..fa99005baec 100644 --- a/Master/texmf-dist/source/latex/changes/changes.dtx +++ b/Master/texmf-dist/source/latex/changes/changes.dtx @@ -1,4 +1,4 @@ -% \CheckSum{1263} +% \CheckSum{1275} % % \iffalse meta-comment % @@ -67,6 +67,7 @@ % \changes{v4.0.2}{2021/04/05}{bugfix: documentation with ifthenelse references} % \changes{v4.0.3}{2021/05/09}{bugfix: compile error with cite command in change markup with final option} % \changes{v4.0.4}{2021/05/13}{bugfix: added missing regression.dtx to ctan archive; no code change} +% \changes{v4.1.0}{2021/05/30}{clickable list of changes} % \GetFileInfo{changes.dtx} % \RecordChanges % @@ -106,8 +107,8 @@ % Type some information to the console. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{changes}[2021/05/13 v4.0.4 changes package] -\typeout{*** changes package 2021/05/13 v4.0.4 ***} +\ProvidesPackage{changes}[2021/05/30 v4.1.0 changes package] +\typeout{*** changes package 2021/05/30 v4.1.0 ***} % \end{macrocode} % % Package \docpackage{xkeyval} provides options with key-value-pairs. @@ -1332,7 +1333,7 @@ \IfIsEmpty{#2}% {\def\Changes@locid{}}% {\def\Changes@locid{~(#2)}}% - \addtocontents{\Changes@locextension}{\protect\ChangesListline{#1}{#6\Changes@locid}{#7}{\thepage}}% + \phantomsection\addcontentsline{\Changes@locextension}{#1}{#6\Changes@locid: \truncate{\Changestruncatewidth}{#7}}% }% % \end{macrocode} % @@ -1504,14 +1505,14 @@ % % \begin{macro}{\ChangesListline} % -% Output of a list line. +% Output of a list line, calls \doccommand{contentsline} for output which uses \doccommand{l@change}. % % This command has the following arguments: % \begin{enumerate} % \item change type (added, ...) % \item change description with author -% \item text % \item page +% \item page reference for hyperref % \end{enumerate} % % \begin{macrocode} @@ -1520,31 +1521,43 @@ \@ifundefined{@dotsep}% {\def\@dotsep{4.5}}% {}% - \@dottedtocline{1}{0pt}{2em}{#2: \truncate{\Changes@truncate@width}{#3}}{#4}% + \origcontentsline{change}{#2}{#3}{#4} }{}% } % \end{macrocode} % \end{macro} % +% \begin{macro}{\l@change} +% +% Output of a loc entry. +% +% \begin{macrocode} +\newcommand*\l@change{\@dottedtocline{1}{0pt}{2em}} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\settruncatewidth} % % Set the width of the truncation. % Argument: new width. % \begin{macrocode} \newcommand{\settruncatewidth}[1]{ - \setlength{\Changes@truncate@width}{#1} + \setlength{\Changestruncatewidth}{#1} } % \end{macrocode} % \end{macro} % -% \begin{macro}{\Changes@truncate@width} +% \begin{macro}{\Changestruncatewidth} % % Length for the width of the truncation. % % Default: two third of the text width % +% Normally, the name would be separated by @, as all internal macros are, but this leads +% to compile errors when processing the list of changes, therefore the @ were omitted. +% % \begin{macrocode} -\newlength{\Changes@truncate@width} +\newlength{\Changestruncatewidth} \settruncatewidth{.6\textwidth} % \end{macrocode} % \end{macro} @@ -1583,6 +1596,14 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\phantomsection} +% +% Provide command in case \docpackage{hyperref} is not loaded. +% \begin{macrocode} +\providecommand\phantomsection{} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\listofchanges} % % This command outputs the list of changes. @@ -1661,11 +1682,16 @@ % Print list. % % The \doccommand{ifeof} command is neccessary in the loop too, otherwise there are problems with the last (empty) line of the file. +% +% The output is done with \doccommand{contentsline}, in order to filter the output I have to redefine the command. +% I did not find a better solution than the \doccommand{let} command. % \begin{macrocode} \IfIsInList{\Changes@loc@style}{list}% {% \IfFileExists{\jobname.\Changes@locextension}% {% + \let\origcontentsline\contentsline% + \let\contentsline\ChangesListline% \newread\Changes@InFile% \openin\Changes@InFile=\jobname.\Changes@locextension% \loop\unless\ifeof\Changes@InFile% @@ -1675,12 +1701,14 @@ \fi \repeat \closein\Changes@InFile% + \let\contentsline\origcontentsline% }{% \emph{\changesnoloc}% \PackageWarning{changes}{LaTeX rerun needed for list of changes}% }% }{}% % \end{macrocode} +% % Print summary or compact summary. % % The \doccommand{ifeof} command is neccessary in the loop too, otherwise there are problems with the last (empty) line of the file. diff --git a/Master/texmf-dist/source/latex/changes/changes.ins b/Master/texmf-dist/source/latex/changes/changes.ins index 537ecf5d1ed..72e217bcfc0 100644 --- a/Master/texmf-dist/source/latex/changes/changes.ins +++ b/Master/texmf-dist/source/latex/changes/changes.ins @@ -1,6 +1,6 @@ %% This file creates the needed files from changes.dtx %% -\def\filedate{2021/05/13} +\def\filedate{2021/05/20} \def\batchfile{changes.ins} \input docstrip @@ -136,6 +136,7 @@ Copyright 2007-2021 Ekkart Kleinod \file{examples/changes.example.setsummarywidth.tex}{\from{examples.dtx}{example:setsummarywidth}} \file{examples/changes.example.setsummarytowidth.tex}{\from{examples.dtx}{example:setsummarytowidth}} % + \file{examples/changes.example.setlocextension.tex}{\from{examples.dtx}{example:setlocextension}} \file{examples/changes.example.setsocextension.tex}{\from{examples.dtx}{example:setsocextension}} % \file{examples/changes.example.listofchanges.list.tex}{\from{examples.dtx}{example:listofchanges:list}} @@ -152,6 +153,8 @@ Copyright 2007-2021 Ekkart Kleinod \file{examples/changes.example.packageoptions.xcolor.tex}{\from{examples.dtx}{example:packageoptions.xcolor}} % \file{examples/changes.example.screenshot.tex}{\from{example-screenshot.dtx}{example:screenshot}} +% + \file{examples/changes.example.package.hyperref.tex}{\from{examples.dtx}{example:package.hyperref}} % \file{regression/changes.regression.draft.tex}{\from{regression.dtx}{regression:draft}} \file{regression/changes.regression.final.tex}{\from{regression.dtx}{regression:final}} diff --git a/Master/texmf-dist/source/latex/changes/examples.dtx b/Master/texmf-dist/source/latex/changes/examples.dtx index 9dc8932bfaa..0f6f1cdea31 100644 --- a/Master/texmf-dist/source/latex/changes/examples.dtx +++ b/Master/texmf-dist/source/latex/changes/examples.dtx @@ -43,12 +43,16 @@ \usepackage{babel} % \end{macrocode} % +%<*example:package.hyperref> +\usepackage{hyperref} +% +% % Different package options. % % \begin{macrocode} -%<*example:simple|example:setsocextension|example:setaddedmarkup|example:setdeletedmarkup|example:setcommentmarkup|example:sethighlightmarkup|example:setauthormarkup|example:setauthormarkupposition|example:setauthormarkuptext|example:listofchanges:list|example:listofchanges:show|example:listofchanges:summary|example:listofchanges:compactsummary|example:listofchanges:all|example:listofchanges:title|example:listofchanges:wrong|example:settruncatewidth|example:setsummarywidth|example:setsummarytowidth> +%<*example:simple|example:setsocextension|example:setlocextension|example:setaddedmarkup|example:setdeletedmarkup|example:setcommentmarkup|example:sethighlightmarkup|example:setauthormarkup|example:setauthormarkupposition|example:setauthormarkuptext|example:listofchanges:list|example:listofchanges:show|example:listofchanges:summary|example:listofchanges:compactsummary|example:listofchanges:all|example:listofchanges:title|example:listofchanges:wrong|example:settruncatewidth|example:setsummarywidth|example:setsummarytowidth|example:package.hyperref> \usepackage{changes} -% +% % %<*example:draft> \usepackage[draft]{changes} @@ -274,6 +278,11 @@ \setsummarytowidth{The longest text you can imagine for the summary.} % % +%<*example:setlocextension> +\setlocextension{changes} +% +% \end{macrocode} +% %<*example:setsocextension> \setsocextension{changes} % @@ -303,24 +312,27 @@ %\verb|\setauthormarkupposition{left}| %\verb|\setauthormarkuptext{name}| %\verb|\settruncatewidth{.3\textwidth}| +%\verb|\setlocextension{changes}| +%\verb|\setsocextension{changes}| %\verb|\setsummarywidth{3cm}| %\verb|\setsummarytowidth{The longest text you can imagine for the summary.}| +%\verb|\usepackage{hyperref}| for linked list of changes -%<*example:listofchanges:list|example:settruncatewidth> +%<*example:listofchanges:list|example:settruncatewidth|example:package.hyperref> \listofchanges -% +% %<*example:listofchanges:summary|example:setsummarywidth|example:setsummarytowidth> \listofchanges[style=summary] % %<*example:listofchanges:compactsummary> \listofchanges[style=compactsummary] % -%<*example:listofchanges:all> +%<*example:listofchanges:all|example:setlocextension|example:setsocextension> \listofchanges \listofchanges[style=summary] \listofchanges[style=compactsummary] -% +% %<*example:listofchanges:title> \listofchanges[title={New title for loc}] \listofchanges[style=summary, title={New title for summary}] -- cgit v1.2.3