texlive[50403] Master/texmf-dist: tocdata (15mar19)
commits+karl at tug.org
commits+karl at tug.org
Fri Mar 15 22:16:31 CET 2019
Revision: 50403
http://tug.org/svn/texlive?view=revision&revision=50403
Author: karl
Date: 2019-03-15 22:16:31 +0100 (Fri, 15 Mar 2019)
Log Message:
-----------
tocdata (15mar19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/tocdata/README.txt
trunk/Master/texmf-dist/doc/latex/tocdata/tocdata.pdf
trunk/Master/texmf-dist/source/latex/tocdata/tocdata.dtx
trunk/Master/texmf-dist/tex/latex/tocdata/tocdata.sty
Modified: trunk/Master/texmf-dist/doc/latex/tocdata/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/README.txt 2019-03-15 21:16:18 UTC (rev 50402)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/README.txt 2019-03-15 21:16:31 UTC (rev 50403)
@@ -1,7 +1,7 @@
The tocdata package.
Adds names to table of contents / list of figures entries.
-v1.00 — 2019/01/12
+v2.00 — 2019/03/15
Copyright 2016–2019 Brian Dunn — www.BDTechConcepts.com
LaTeX Project Public License, version 1.3
@@ -8,11 +8,11 @@
Summary:
-The tocdata package may be used to add a small amount of data to an
-entry in the table of contents or list of figures, between the
-section name and the page number. The typical use would be to add
-the name of an author or artist of a chapter or section, such as in
-an anthology or a collection of papers.
+The tocdata package may be used to add a small amount of data to an entry
+in the table of contents or list of figures, between the section or caption
+name and the page number. The typical use would be to add the name of an
+author or artist of a chapter or section, such as in an anthology or a
+collection of papers.
Additionally, user-level macros are provided which add the author's
name to a chapter or section, along with an optional prefix and/or
@@ -23,8 +23,8 @@
Requirements:
-Tocdata requires the use of either the titletoc package or
-the tocloft package.
+Tocdata may be used with, but does not require, either the titletoc package
+or the tocloft package.
Alternatives:
Modified: trunk/Master/texmf-dist/doc/latex/tocdata/tocdata.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/tocdata/tocdata.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tocdata/tocdata.dtx 2019-03-15 21:16:18 UTC (rev 50402)
+++ trunk/Master/texmf-dist/source/latex/tocdata/tocdata.dtx 2019-03-15 21:16:31 UTC (rev 50403)
@@ -15,7 +15,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{tocdata}
-%<package> [2019/01/12 v1.00 Adds author/artist to TOC entries.]
+%<package> [2019/03/15 v2.00 Adds author/artist to TOC entries.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -85,7 +85,7 @@
\definecolor{codecolor}{rgb}{0,.4,.2}
\definecolor{overviewcolor}{rgb}{0,.2,.4}
-\usepackage{dtxdescribe}
+\usepackage{dtxdescribe}[2019/01/11]
\usepackage{graphicx}
\graphicspath{{images/}}
@@ -96,20 +96,37 @@
\usepackage{longtable}
\usepackage{booktabs}
+\usepackage[all,defaultlines=2]{nowidow}
+
\usepackage[normalem]{ulem}
-% \usepackage{verbatim}
\usepackage{fancyvrb}
-\usepackage{comment}
-\excludecomment{testing}
-% \usepackage{morefloats}
-% \usepackage{marginfix}
+\usepackage{newfloat}
+\DeclareFloatingEnvironment[
+ fileext=loi,
+ listname={List of Illustrations},
+ name=Illustration,
+ placement=tbp,
+]{illustration}
+\DeclareFloatingEnvironment[
+ fileext=loq,
+ listname={List of Quotations},
+ name=Quotation,
+ placement=tbp,
+]{aquote}
+\setlength{\floatsep}{5ex}
+\setlength{\textfloatsep}{5ex}
+
+\usepackage{\mypackagename}
+
+
+
\usepackage{titletoc}
% \usepackage{tocloft}
@@ -127,7 +144,6 @@
-
\usepackage[pdftex,bookmarks=true,hidelinks,%
colorlinks,linkcolor=mylinkcolor,urlcolor=myurlcolor,%
pageanchor=true,hyperindex=false,
@@ -151,14 +167,13 @@
-\setlength{\parindent}{0em}
-\setlength{\parskip}{2ex}
+\setlength{\parindent}{2em}
+\setlength{\parskip}{0ex}
+
\setlength{\IndexMin}{40ex}
-\usepackage{\mypackagename}
-
\setcounter{IndexColumns}{2}
\setcounter{GlossaryColumns}{1}
@@ -171,7 +186,7 @@
%</driver>
% \fi
%
-% \CheckSum{0}
+% \CheckSum{363}
%
% \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
@@ -193,8 +208,12 @@
% \changes{v0.11}{2016/07/11}{\ 2016/07/11}
% \changes{v0.11}{2016/07/11}{Minor docs improvements in spelling, grammar, formatting.}
% \changes{v0.12}{2016/12/02}{\ 2016/12/02}
+% \changes{v1.00}{2019/01/08}{Improved source formatting.}
% \changes{v1.00}{2019/01/12}{\ 2019/01/12}
-% \changes{v1.00}{2019/01/08}{Improved source formatting.}
+% \changes{v2.00}{2019/03/15}{Added part and subsection macros.}
+% \changes{v2.00}{2019/03/15}{Added caption authors.}
+% \changes{v2.00}{2019/03/15}{Added support for new float types.}
+% \changes{v2.00}{2019/03/15}{\ 2019/03/15}
@@ -230,11 +249,12 @@
% \begin{abstract}
% \noindent
% The \pkg{tocdata} package adds information such as an author or artist to
-% an entry in the table of contents or list of figures,
-% on a single line along with the caption and page number.
-% This is commonly done in collections of literature, poetry, or art work.
+% an entry in the table of contents or list of figures or new float type.
+% This new information is placed on a single line along with the caption and page number,
+% as is commonly done in collections of literature, poetry, or art work.
%
-% Either the \pkg{titletoc} or \pkg{tocloft} package must be loaded before \pkg{tocdata}.
+% \pkg{tocdata} works with the \TOC\ \Slash \LOF\ formatting of the default \LaTeX\ classes,
+% or with the \pkg{titletoc} or \pkg{tocloft} packages.
% \end{abstract}
%
% \vspace*{\fill}
@@ -242,10 +262,14 @@
% \vspace*{\fill}
% \end{center}
%
+% \clearpage
+%
% \tableofcontents
-% \clearpage
+% ^^A \clearpage
% \listoffigures
% ^^A \listoftables
+% \listofillustrations
+% \listofaquotes
%
%
% \thispagestyle{pageheadfoot}
@@ -258,12 +282,21 @@
% \setlength{\fboxsep}{0pt}
% \centering
% \fbox{\includegraphics[width=2in]{go_problem.png}}
-% \captionartist{The Opening Challenge}
+% \captionartist{A Challenge}
% [Problem 1-2, from \textit{Gokyo Shumyo}]
% {Hayashi}{Genbi}
% \end{figure}
-
%
+% \begin{aquote}
+% \itshape
+% ``Go uses the most elemental materials and concepts --- line and circle,
+% wood and stone, black and white --- combining them with simple rules
+% to generate subtle strategies and complex tactics that stagger the imagination.''
+% \captionauthor{\textit{Go uses the most elemental materials and concepts \dots}}%
+% {Iwamoto}{Kaoru}%
+% [\textnormal{ --- former \textit{Honinbo} title holder}]
+% \end{aquote}
+%
% Anthologies may be printed with the author alongside each title in the
% table of contents.
%
@@ -273,22 +306,29 @@
%
% The \pkg{tocdata} package provides some basic infrastructure to help
% add some information to a line in the table of contents, after the title
-% and just before the page number. This function requires the use of either
-% the \pkg{titletoc} or \pkg{tocloft} packages.
+% and just before the page number. This function works with the standard
+% \LaTeX\ classes, or with either of the \pkg{titletoc} or \pkg{tocloft} packages.
%
% Additionally,
% user-level macros are provided which add the author's name to a chapter or section,
-% and add the artist's name and optional additional text to a figure.
+% and add the author's or artist's name and optional additional text to a figure.
% Author and artist names are also added to the index.
%
% As examples of the use of these high-level macros,
% the major section headings of this documentation
-% have the author's name applied, and additional illustrations are supplied as well.
-% The results are demonstrated in the table of contents, list of figures, and the index.
+% have the author's name applied, and additional figures, illustrations, and quotes
+% are supplied as well.
+% The results are demonstrated in the table of contents, list of figures,
+% list of illustrations, list of quotes, and the index.\footnote{%
+% Yes, I \emph{do} recognize the absurdity of placing my own name in the index
+% amongst the likes of Churchill, Genbi, Herschel, Kaoru, Newton\,\dots}
%
%
% \clearpage
%
+% \setlength{\parindent}{0em}
+% \setlength{\parskip}{2ex}
+%
% \sectionauthor[Other methods]{Other methods}{Various}{Authors}
% \label{sec:othermethods}
%
@@ -312,7 +352,7 @@
% {http://tex.stackexchange.com/questions/156862/displaying-author-for-each-chapter-in-book}
% {http://tex.stackexchange.com/questions/ \\ \hspace*{1in} 156862/displaying-author-for-each-chapter-in-book}%
%
-% \begin{figure}
+% \begin{illustration}
% \setlength{\fboxsep}{0pt}
% \centering
% \fbox{\includegraphics[height=3in]{engineer.jpg}}
@@ -319,7 +359,7 @@
% \captionartist
% [The Crazy Engineer]
% {The Crazy Engineer}[Illustration from \textit{The Crazy Engineer} \par \textit{McGuffey's Fifth Eclectic Reader}]{H. F.}{Farny}
-% \end{figure}
+% \end{illustration}
%
% \clearpage
%
@@ -355,18 +395,15 @@
%
% \subsubsection{Preamble}
%
-% \pkg{tocdata} requires the use of either the \pkg{tocloft} or \pkg{titletoc} package.
+% \pkg{tocdata} may be used with either the \pkg{tocloft} or \pkg{titletoc} package,
+% or neither.
%
% In the preamble, use:
% \begin{sourceverb}
-% \usepackage{tocloft}
-% \usepackage{tocdata}
+% \usepackage{tocdata}% optional
+% \usepackage{titletoc}% optional
+% \usepackage{tocloft}
% \end{sourceverb}
-% -\textit{or}-
-% \begin{sourceverb}
-% \usepackage{titletoc}
-% \usepackage{tocdata}
-% \end{sourceverb}
%
% \begin{docsidebar}
% If using \pkg{titletoc}:
@@ -376,8 +413,16 @@
% inserting the \cs{TD at usetocdata} macro as shown below.
% \end{docsidebar}
%
+% \subsection{Mid-level applications}
+%
+% Should the user only wish to add a bit of text into the \acro{TOC}\Slash\acro{LOF},
+% the \cs{tocdata} macro may be used just before the sectioning or caption command,
+% as shown below.
+%
% \subsubsection{Font control in the \acro{TOC}\Slash\acro{LOF}}
%
+% \DescribeMacro{\tocdatafont} \marg{text}
+%
% To control the font used for the author on the table-of-contents line,
% the default is:
% \begin{sourceverb}
@@ -390,13 +435,10 @@
% \end{sourceverb}
%
%
-% \subsection{Mid-level applications}
+% \subsubsection{Adding \acro{TOC} data per section}
%
-% Should the user only wish to add a bit of text into the \acro{TOC}\Slash\acro{LOF},
-% the \cs{tocdata} macro may be used just before the sectioning or caption command,
-% as shown next.
+% \DescribeMacro{\tocdata} \marg{list extension} \marg{text}
%
-% \subsubsection{Adding \acro{TOC} data per section}
% Before each \cs{chapter} or \cs{section} which is to have an author or other data:
%
% \begin{sourceverb}
@@ -422,9 +464,10 @@
% These are user-level sectioning and captioning commands which add the
% names to the \acro{TOC} and \acro{LOF},
% and also add the artist's name and optional additional text
-% to a figure (as in Figure \ref{fig:quail}),
+% to a figure or other float (as in Figure \ref{fig:quail}),
% and also add the names to the index.
-% An optional prefix and suffix may be attached to the names (as in Figure \ref{fig:astronometer}),
+% An optional prefix and suffix may be attached to the names
+% (as in Figure \ref{fig:astronometer}),
% and these will be printed at the section heading or caption, but not
% in the \acro{TOC}\Slash\acro{LOF} or in the index.
%
@@ -432,46 +475,54 @@
%
% \subsubsection{Sectioning commands with authors}
%
+% \DescribeMacro{\partauthor}
% \DescribeMacro{\chapterauthor}
+% \DescribeMacro{\sectionauthor}
+% \DescribeMacro{\subsectionauthor}
% To use these macros, do not use \cs{tocdata} as shown above, but instead use,
-% in the place of \cs{chapter}:
-%
+% in the place of \cs{part}:
% \begin{sourceverb}
-% \chapterauthor[\TOC\ entry]{Title}[Prefix]{First}{Last}[Suffix]
+% \partauthor[list entry]{Title}[Prefix]{First}{Last}[Suffix]
% \end{sourceverb}
+% Likewise for chapters, sections, and subsections.
%
-% \DescribeMacro{\sectionauthor}
-% or, in the place of \cs{section}:
%
-% \begin{sourceverb}
-% \sectionauthor[\TOC\ entry]{Title}[Prefix]{First}{Last}[Suffix]
-% \end{sourceverb}
%
-% \subsubsection{Figure captions with artist names and add'l text}
+% \subsubsection{Figure captions with author \Slash artist names and additional text}
%
% \DescribeMacro{\captionartist}
-% For figures, in the place of \cs{caption}:
+% \DescribeMacro{\captionauthor}
+% For figures, in the place of \cs{caption}, use:
%
% \begin{sourceverb}
-% \captionartist[\LOF\ entry]{Title}[Text][Prefix]{First}{Last}[Suffix]
+% \captionartist[list entry]{Title}[Text][Prefix]{First}{Last}[Suffix]
+% -or-
+% \captionauthor[list entry]{Title}[Text][Prefix]{First}{Last}[Suffix]
% \end{sourceverb}
%
+% By default, \cs{captionartist} prints the artist centered below the figure,
+% and \cs{captionauthor} prints the author below and flush right, without
+% an extra vertical skip.
+%
% If you are using the optional prefix, the optional text must also be given, even if it
% is empty. For example, use:
% \watchout[Optional arguments]
-% \begin{sourceverb}
-% \captionartist{Title}|\textcolor{red}{|[]|}|[Sir]{Isaac}{Newton}
-% \end{sourceverb}
-% If only one optional argument is given before the first name, it will be
-% interpreted as the optional text, not as the optional prefix.
+% \begin{sourcedisplay}
+% \cs{captionartist}\{Title\}\textcolor{red}{[]}[Sir]\{Isaac\}\{Newton\}
+% \end{sourcedisplay}
+% (If only one optional argument is given before the first name, it will be
+% interpreted as the optional text, not as the optional prefix.)
%
% \DescribeMacro{\captionartist*}
+% \DescribeMacro{\captionauthor*}
% If you are using the \pkg{caption} package or another package which
-% supports \cs{caption*}, you may use \cs{captionartist*} with \pkg{tocdata}.
-% The artist and supplemental text will still be printed below the figure,
+% supports \cs{caption*}, you may use \cs{captionartist*} and \cs{captionauthor*}
+% with \pkg{tocdata}.
+% The artist \Slash author and supplemental text will still be printed below the figure,
% and an unnumbered caption will be generated, even though a \acro{LOF} entry will not be made.
%
-% Should you mistakenly use \cs{captionartist*} without the \pkg{caption} package,
+% Should you mistakenly use \cs{captionartist*} or \cs{captionauthor*}
+% without the \pkg{caption} package,
% expect to get a caption with a visible star in it.
% \watchout[\pkg{caption} package]
% To fix the problem:\\
@@ -479,53 +530,79 @@
%
% \subsubsection{Formatting in sections and figures}
%
-% \DescribeMacro{\tocdatachapprint}
-% \DescribeMacro{\tocdatasecprint}
+% \DescribeMacro{\tocdatapartprint}
+% \DescribeMacro{\tocdatachapterprint}
+% \DescribeMacro{\tocdatasectionprint}
+% \DescribeMacro{\tocdatasubsectionprint}
% To change the formatting of the author names printed after
% each chapter or section, or to remove them entirely, use
% these macros, as described in section~\ref{sec:usermacros}
% on page~\pageref{sec:usermacros}.
%
+% \cs{tocdatachapterprint} and \cs{tocdatasectionprint} by default
+% \watchout[redefining]
+% depend on \cs{tocdatapartprint}, so if it is redefined the others will
+% have to be redefined as well.
+%
%
-% \DescribeMacro{\tocdatafigprint}
-% \DescribeMacro{\tocdatafigtextprint}
-% To change the formatting of a figure's artist's name and optional text,
+% \DescribeMacro{\tocdataartistprint}
+% \DescribeMacro{\tocdataartisttextprint}
+% \DescribeMacro{\tocdataauthorprint}
+% \DescribeMacro{\tocdataauthortextprint}
+% To change the formatting of a figure's artist's name or author's name and optional text,
% use these macros, also described in section \ref{sec:usermacros}.
%
%
% \subsubsection{Text justification}
%
-% \DescribeMacro{\tdnamejustify}
-% \DescribeMacro{\tdnamecenter}
-% \DescribeMacro{\tdnameleft}
-% \DescribeMacro{\tdnameright}
-% To change the text jusification of the name below a figure, use one of
-% the |tdname| macros before the figure.
+% \DescribeMacro{\tdartistnamejustify}
+% \DescribeMacro{\tdartistnamecenter}
+% \DescribeMacro{\tdartistnameleft}
+% \DescribeMacro{\tdartistnameright}
+% \DescribeMacro{\tdartisttextjustify}
+% \DescribeMacro{\tdartisttextcenter}
+% \DescribeMacro{\tdartisttextleft}
+% \DescribeMacro{\tdartisttextright}
+% \DescribeMacro{\tdauthornamejustify}
+% \DescribeMacro{\tdauthornamecenter}
+% \DescribeMacro{\tdauthornameleft}
+% \DescribeMacro{\tdauthornameright}
+% \DescribeMacro{\tdauthortextjustify}
+% \DescribeMacro{\tdauthortextcenter}
+% \DescribeMacro{\tdauthortextleft}
+% \DescribeMacro{\tdauthortextright}
+% The text alignment of artists, artists' additional text,
+% authors, and authors' additional text may be set using
+% these macros.
% All following figures use the selected justification
% until it is changed to another.
%
-% \DescribeMacro{\tdtextjustify}
-% \DescribeMacro{\tdtextcenter}
-% \DescribeMacro{\tdtextleft}
-% \DescribeMacro{\tdtextright}
-% To change the text jusification of the additional text below a figure, use one of
-% the |txtext| macros before the figure.
-% All following figures use the selected justification
-% until it is changed to another.
%
-%
% \StopEventually{\PrintChanges
% \PrintIndex
%
-% \begin{figure}[hbp]
+% \clearpage
+%
+% \tdauthortextright
+% \begin{aquote}[tbp]
+% \itshape
+% ``Now this is not the end.
+% It is not even the beginning of the end.
+% But it is, perhaps, the end of the beginning.''
+% \captionauthor{\textit{Now this is not the end \dots}}
+% [(Full name used for demonstration purposes.)][Sir]{Winston Leonard Spencer}{Churchill}
+% \end{aquote}
+%
+% \begin{figure}[tbp]
% \centering
% \setlength{\fboxsep}{2ex}
% {\fontsize{35}{50}\selectfont\textOmega}
-% \captionartist{Omega --- The End}{Greek}{Alphabet}
+% \captionartist{Omega}{Greek}{Alphabet}
% \end{figure}
+%
%}
%
-% \begin{figure}[hbp]
+% \begin{illustration}[hbp]
% \setlength{\fboxsep}{0pt}
% \centering
% \fbox{\includegraphics[width=3in]{quail.jpg}}
@@ -532,7 +609,7 @@
% \captionartist{Quail\label{fig:quail}}
% [Illustration from \textit{About Quail} \par \textit{McGuffey's Fifth Eclectic Reader}]
% {Alexander}{Pope}
-% \end{figure}
+% \end{illustration}
%
%
% \clearpage
@@ -551,7 +628,8 @@
% place the data into the table of contents and list of figures, as well as
% the code to control the font used while doing so.
%
-% Next are sections used to support \pkg{titletoc} and \pkg{tocloft}.
+% Next are sections used to support the default \LaTeX\ classes,
+% as well as \pkg{titletoc} and \pkg{tocloft}.
%
% Finally, the high-level macros are provided. The user may ignore or redefine these
% as desired.
@@ -565,25 +643,52 @@
% \begin{macrocode}
\RequirePackage{xparse}
\RequirePackage{etoolbox}
+\RequirePackage{xpatch}
% \end{macrocode}
-% Test for either \pkg{titletoc} or \pkg{tocloft}.
-% \changes{v1.00}{2019/01/09}{Test for \pkg{titletoc} or \pkg{tocloft}.}
+
+% Require that \pkg{titletoc} and \pkg{tocloft} be loaded
+% after \pkg{tocdata}, so that \pkg{tocdata} can patch
+% the \LaTeX\ core definitions first.
+% \changes{v2.00}{2019/03/12}{Test for early \pkg{titletoc} or \pkg{tocloft}.}
% \begin{macrocode}
\@ifpackageloaded{titletoc}{
+ \PackageError{tocdata}
+ {%
+ Load titletoc after tocdata%
+ }
+ {%
+ Move \protect\usepackage{titletoc} after \protect\usepackage{tocdata}.%
+ }
+}{}
+\@ifpackageloaded{tocloft}{
+ \PackageError{tocdata}
+ {%
+ Load tocloft after tocdata%
+ }
+ {%
+ Move \protect\usepackage{tocloft} after \protect\usepackage{tocdata}.%
+ }
+}{}
+% \end{macrocode}
+
+% Prevent the use of both \pkg{titletoc} and \pkg{tocloft}.
+% \changes{v2.00}{2019/03/12}{Test for both \pkg{titletoc} and \pkg{tocloft}.}
+% \begin{macrocode}
+\AtBeginDocument{
+\@ifpackageloaded{titletoc}{
\@ifpackageloaded{tocloft}{
\PackageError{tocdata}
- {Both titletoc and tocloft are being used. Load only one}
- {The tocdata package requires either one of titletoc or tocloft.}
+ {%
+ Both titletoc and tocloft are being used.\MessageBreak
+ Load only one%
+ }
+ {%
+ The tocdata package may use the default LaTeX formatting,\MessageBreak
+ or either one of titletoc or tocloft.
+ }
}{}
-}{% Not titletoc.
- \@ifpackageloaded{tocloft}{}{
- \PackageError{tocdata}
- {
- The tocdata package requires either the tocloft or titletoc package%
- }
- {Load either, then load tocdata next.}
- }
+}{}
}
% \end{macrocode}
@@ -598,7 +703,7 @@
% \end{macro}
% \begin{macro}{\settocdata}
-% Written to the |.toc| or |.lof| file, assigns \cs{thistocdata}:
+% Written to the |.toc| or |.lof| file, assigns \cs{TD at thistocdata}:
% \begin{macrocode}
\newcommand{\settocdata}[1]{\renewcommand{\TD at thistocdata}{#1}}
% \end{macrocode}
@@ -643,6 +748,58 @@
% \end{macro}
+% \subsection{Standard \LaTeX\ patches}
+%
+% \changes{v2.00}{2019/03/12}{Adds support for default \LaTeX\ \TOC\ formattting,
+% without using \pkg{titletoc} or \pkg{tocloft}.}
+%
+% \begin{macro}{\@dottedtocline} Patched for \pkg{tocdata}.
+% \begin{macrocode}
+\xpatchcmd{\@dottedtocline}
+ {\hfill\nobreak}
+ {\hfill\TD at usetocdata\nobreak}
+ {}%
+ {%
+ \PackageWarningNoLine{tocdata}{%
+ Could not patch LaTeX core \protect\@dottedtocline.\MessageBreak
+ Authors will not appear in TOC, LOF}
+ }%
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at part} Patched for \pkg{tocdata}.
+% \begin{macrocode}
+\xpatchcmd{\l at part}
+ {\hfil}
+ {\hfil\TD at usetocdata}
+ {}%
+ {%
+ \PackageWarningNoLine{tocdata}{%
+ Could not patch LaTeX core \protect\l at part.\MessageBreak
+ Authors will not appear in TOC parts}
+ }%
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at chapter} Patched for \pkg{tocdata}.
+% \begin{macrocode}
+\@ifundefined{chapter}
+{}
+{
+\xpatchcmd{\l at chapter}
+ {\hfil\nobreak}
+ {\hfil\TD at usetocdata\nobreak}
+ {}%
+ {%
+ \PackageWarningNoLine{tocdata}{%
+ Could not patch LaTeX core \protect\l at chapter.\MessageBreak
+ Authors will not appear in TOC chapters}
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+
+
% \subsection{\pkg{titletoc} support}
%
% \begin{figure}
@@ -650,12 +807,14 @@
% \setlength{\fboxsep}{2ex}
%
% {\fontsize{140}{160}\selectfont$\pi$}
-% \captionartist{Pi --- A Work of Art\label{fig:workofart}}{Greek}{Alphabet}
+% \captionartist{Pi\label{fig:workofart}}{Greek}{Alphabet}
% \end{figure}
%
%
% If \pkg{titletoc} is loaded, patch macros for its use:
+% \changes{v2.00}{2019/03/13}{Patches \cs{AtBeginDocument}.}
% \begin{macrocode}
+\AtBeginDocument{
\@ifpackageloaded{titletoc}{
% \end{macrocode}
%
@@ -662,7 +821,8 @@
% \DescribeMacro{\titlecontents}
% A set of \pkg{titletoc} commands which set up the formatting of the
-% \acro{TOC} entries. These are patched to include the tocdata just after
+% \acro{TOC} entries. These are patched \cs{AtBeginDocument},
+% after user customizations in the preamble, to include the tocdata just after
% the leader (|titlerule*|), and just before the page number.
%
% These macros also include spacing commands, and thus may need to be
@@ -672,43 +832,41 @@
% is not patched for use with \pkg{tocdata}. Use \cs{titlecontents} instead,
% \watchout[\cs{dottedcontents}]
% inserting the \cs{TD at usetocdata} macro as shown below.
-% \begin{macrocode}
-\@ifundefined{chapter}
-{}
-{
-\titlecontents{chapter}[0em]{}{\contentslabel{2.5em}}{}{%
-% \dotfill
-\titlerule*[.75pc]{.}%
%
-% \end{macrocode}
-% The new patch goes here:
+% The default macros are patched via the \LaTeX\ core.
+% The following are only necessary if \cs{titlecontents} was used.
+% Since every combination is tried, but will only succeed if \cs{titlecontents}
+% was used, no warnings are printed if the patch fails.
+%
+% \changes{v2.00}{2019/03/13}{Improved patches for \pkg{titletoc}.}
+%
% \begin{macrocode}
-\TD at usetocdata% <-- newly added for the tocdata package
-%
-\contentspage}[\vspace{-.5ex}]%
+\newcommand*{\TD at titletoc@patch}[1]{%
+ \expandafter\xpatchcmd\csname ttl at savel@#1\endcsname
+ {\nobreak\hfil\nobreak}
+ {\nobreak\hfil\TD at usetocdata\nobreak}
+ {}
+ {}
+ \expandafter\xpatchcmd\csname l@#1\endcsname
+ {\contentspage}
+ {\TD at usetocdata\contentspage}
+ {}
+ {}
}
-% \end{macrocode}
-% Likewise for sections:
-% \begin{macrocode}
-\titlecontents{section}[2.5em]{}{\contentslabel{2.5em}}{}{%
-% \dotfill
-\titlerule*[.75pc]{.}%
-\TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]%
-% \end{macrocode}
-% Likewise for figures:
-% \begin{macrocode}
-\titlecontents{figure}[0em]{}{\contentslabel{3em}}{}{%
-% \dotfill
-\titlerule*[1pc]{.}%
-\TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]%
-% \end{macrocode}
-% \begin{macrocode}
+\TD at titletoc@patch{part}
+\@ifundefined{chapter}{}{\TD at titletoc@patch{chapter}}
+\TD at titletoc@patch{section}
+\TD at titletoc@patch{subsection}
+\TD at titletoc@patch{subsubsection}
+\TD at titletoc@patch{paragraph}
+\TD at titletoc@patch{subparagraph}
+\TD at titletoc@patch{figure}
+\TD at titletoc@patch{table}
}% end of titletoc loaded
{% titletoc is not loaded
}% end of \@ifpackageloaded{titletoc}
+}% end of \AtBeginDocument
% \end{macrocode}
@@ -715,36 +873,39 @@
% \subsection{\pkg{tocloft} support}
%
% If \pkg{tocloft} is loaded, the following patches are applied:
+% \changes{v2.00}{2019/03/13}{Patches \cs{AtBeginDocument}.}
% \begin{macrocode}
+\AtBeginDocument{
\@ifpackageloaded{tocloft}
{
% \end{macrocode}
-% If the documentclass includes a chapter level:
+%
+% \DescribeMacro{\cftXleader} A set of commands used by \cs{tocloft} to
+% typeset the leader between the title and the page number.
+% These are patched to print the tocdata just after the leader.
+%
+% \changes{v2.00}{2019/03/13}{Improved patches for \pkg{tocloft}.}
% \begin{macrocode}
+\appto{\cftpartleader}{\TD at usetocdata}
\if at cfthaschapter
+ \appto{\cftchapleader}{\TD at usetocdata}
+\fi
+\appto{\cftsecleader}{\TD at usetocdata}
+\appto{\cftsubsecleader}{\TD at usetocdata}
+\appto{\cftsubsubsecleader}{\TD at usetocdata}
+\appto{\cftparaleader}{\TD at usetocdata}
+\appto{\cftsubparaleader}{\TD at usetocdata}
+\appto{\cftfigleader}{\TD at usetocdata}
+\appto{\cfttableader}{\TD at usetocdata}
+\appto{\cftsubfigleader}{\TD at usetocdata}
+\appto{\cftsubtableader}{\TD at usetocdata}
% \end{macrocode}
-% \DescribeMacro{\cftXleader} A set of commands used by \cs{tocloft} to
-% typeset the leader between the title and the page number.
-% These are patched to print the tocdata just after the leader.
+
% \begin{macrocode}
-\renewcommand{\cftchapleader}{\bfseries\cftdotfill{\cftchapdotsep}\TD at usetocdata}
-\renewcommand{\cftsecleader}{\normalfont\cftdotfill{\cftsecdotsep}\TD at usetocdata}
-\renewcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}\TD at usetocdata}
-\else
-% \end{macrocode}
-% If there is no chapter level:
-% \begin{macrocode}
-\renewcommand{\cftsecleader}{\bfseries\cftdotfill{\cftsecdotsep}\TD at usetocdata}
-\renewcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}\TD at usetocdata}
-\fi
}% end of tocloft patches
{}% tocloft not loaded
+}% \AtBeginDocument
% \end{macrocode}
-
-% It is possible to patch the regular \LaTeX{} code here.
-% Look at |book.cls| and |article.cls|,
-% for the macros \cs{l at chapter} and \cs{l at section}, and look in the \LaTeX{}
-% |source2e.pdf| for \cs{\@dottedtocline}.
%
%
%
@@ -765,7 +926,8 @@
%
% These macros are in addition to the standard sectioning and caption commands,
% adding first and last names for the table of contents and list of figures.
-% For chapters and sections, the author's name with optional prefix and suffix
+% For parts, chapters, sections, and subsections,
+% the author's name with optional prefix and suffix
% are also added below the title.
% For figures, \cs{captionauthor} also prints the figure's artist's
% name with optional prefix and suffix just below the figure.
@@ -792,93 +954,142 @@
% \end{macro}
%
%
-% \begin{macro}{\tocdatachapprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
%
-% User-redefinable macro to print the author's name underneath the chapter title.
%
+% \begin{macro}{\tocdatapartprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
+%
+% User-redefinable macro to print the author's name underneath the part title.
+%
% \changes{v0.12}{2016/11/29}{Improved spacing.}
+% \changes{v2.00}{2019/03/15}{Added.}
%
% \begin{macrocode}
+\newcommand{\tocdatapartprint}[4]
+{%
+ \par\unskip\noindent%
+ {%
+ \normalfont\normalsize%
+ \textit{%
+ \hspace*{4em}--- %
+ \TD at optionalname{#1}\TD at optionalname{#2}#3#4%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\tocdatachapterprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
+%
+% User-redefinable macro to print the author's name underneath the chapter title.
+%
+% \changes{v2.00}{2019/03/15}{Renamed from \cs{tocdatachapprint}.}
+%
+% \begin{macrocode}
\@ifundefined{chapter}
{}% if no chapters
{% only of chapters exists in this documentclass:
-\newcommand{\tocdatachapprint}[4]
-{%
- \newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
- \TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
-}
+ \let\tocdatachapterprint\tocdatapartprint
}% end of chapters-only
% \end{macrocode}
-% To remove the author's name, redefine this as a null function taking four arguments:
-% \begin{sourceverb}
-% \renewcommand{\tocdatachapprint}[4]{}
-% \end{sourceverb}
% \end{macro}
%
-% \begin{macro}{\tocdatasecprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
%
+% \begin{macro}{\tocdatasectionprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
+%
% User-redefinable macro to print the author's name underneath the section title.
%
-% \changes{v0.12}{2016/11/29}{Improved spacing.}
+% \changes{v2.00}{2019/03/15}{Renamed from \cs{tocdatasecprint}.}
%
% \begin{macrocode}
-\newcommand{\tocdatasecprint}[4]
-{%
- \newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
- \TD at optionalname{#1}\TD at optionalname{#2}#3#4}%
-}%
-}
+\let\tocdatasectionprint\tocdatapartprint
% \end{macrocode}
-% To remove the author's name, redefine this as a null function taking four arguments:
-% \begin{sourceverb}
-% \renewcommand{\tocdatasecprint}[4]{}
-% \end{sourceverb}
% \end{macro}
%
%
+% \begin{macro}{\tocdatasubsectionprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
%
-% \begin{macro}{\tocdatafigprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
+% User-redefinable macro to print the author's name underneath the subsection title.
%
-% User-redefinable macro to print the artist's name underneath the figure.
+% \changes{v2.00}{2019/03/15}{Added.}
+% \begin{macrocode}
+\let\tocdatasubsectionprint\tocdatapartprint
+% \end{macrocode}
+% \end{macro}
%
-% \changes{v0.12}{2016/11/29}{Improved spacing.}
-% \changes{v0.12}{2016/11/30}{Added name alignment.}
%
+% \begin{macro}{\TD at artistauthorprint} \marg{1: "artist" or "author"}
+% \marg{2: prefix} \marg{3: first} \marg{4: last} \marg{5: suffix}
+%
+% \changes{v2.00}{2019/03/15}{Improved font control.}
+%
% \begin{macrocode}
-\newcommand{\tocdatafigprint}[4]{%
- \addvspace{2ex}%
+\newcommand{\TD at artistauthorprint}[5]{%
\begin{minipage}{\linewidth}%
- \TD at namealign%
- \footnotesize\textsc{{\TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
+ \csuse{TD@#1align}%
+ \footnotesize\normalfont%
+ \textsc{{\TD at optionalname{#2}\TD at optionalname{#3}#4#5}}%
\end{minipage}%
\par%
\addvspace{2ex}%
}
% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\tocdataartistprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
+%
+% User-redefinable macro to print the artist's name underneath the figure.
+%
+% \changes{v0.12}{2016/11/29}{Improved spacing.}
+% \changes{v0.12}{2016/11/30}{Added name alignment.}
+% \changes{v2.00}{2019/03/14}{Added.}
+%
+% \begin{macrocode}
+\newcommand{\tocdataartistprint}{%
+ \par\addvspace{\medskipamount}%
+ \TD at artistauthorprint{artist}%
+}
+% \end{macrocode}
% To remove the artist's name, redefine this as a null function taking four arguments:
% \begin{sourceverb}
-% \renewcommand{\tocdatafigprint}[4]{}
+% \renewcommand{\tocdataartistprint}[4]{}
% \end{sourceverb}
% \end{macro}
%
%
+% \begin{macro}{\tocdataauthorprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
%
-% \begin{macro}{\tocdatafigtextprint} \marg{first} \marg{last}
+% User-redefinable macro to print the author's name underneath the figure.
%
-% User-redefinable macro to print the artist's name underneath the figure.
+% \changes{v2.00}{2019/03/14}{Added.}
%
+% \begin{macrocode}
+\newcommand{\tocdataauthorprint}{%
+ \par\unskip
+ \TD at artistauthorprint{author}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\TD at artistauthortextprint}
+% \marg{"artist" or "author"} \marg{text}
% \changes{v0.12}{2016/11/29}{Improved spacing.}
% \changes{v0.12}{2016/11/29}{Added text alignment.}
-%
+% \changes{v2.00}{2019/03/15}{Improved font control.}
+% \changes{v2.00}{2019/03/14}{Replaced \cs{tocdatafigtextprint} with
+% \cs{tocdataartisttextprint} and \cs{tocdataauthortextprint}.}
% \begin{macrocode}
-\newcommand{\tocdatafigtextprint}[1]{%
+\newcommand{\TD at artistauthortextprint}[2]{%
\addvspace{2ex}%
\begin{minipage}{\linewidth}%
- \TD at textalign%
- \footnotesize%
+ \csuse{TD@#1textalign}%
+ \footnotesize\normalfont%
\setlength{\parskip}{1.5ex}%
\setlength{\parindent}{0em}%
- #1%
+ #2%
\end{minipage}%
\par%
\addvspace{2ex}%
@@ -887,184 +1098,291 @@
% \end{macro}
%
%
+% \begin{macro}{\tocdataartisttextprint} \marg{text}
%
+% User-redefinable macro to print the optional text below the artist's name.
+%
+%
+% \begin{macrocode}
+\newcommand{\tocdataartisttextprint}{\TD at artistauthortextprint{artist}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tocdataauthortextprint} \marg{text}
+%
+% User-redefinable macro to print the optional text below the author's name.
+%
+% \begin{macrocode}
+\newcommand{\tocdataauthortextprint}{\TD at artistauthortextprint{author}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
% \subsubsection{Chapters and sections}
%
-% \begin{macro}{\chapterauthor} * \oarg{2: \TOC\ entry} \marg{3: title}
-% \oarg{4: prefix} \marg{5: first} \marg{6: last} \oarg{7: suffix}
+% \begin{macro}{\TD at sectionauthor}
+% \marg{1: section type}
+% *
+% \oarg{3: \TOC\ entry} \marg{4: title}
+% \oarg{5: prefix} \marg{6: first} \marg{7: last} \oarg{8: suffix}
%
% \changes{v0.12}{2016/11/28}{Expands first name before index check.}
+% \changes{v2.00}{2019/03/15}{Improved page breaks.}
+% \changes{v2.00}{2019/03/15}{Factored.}
% \begin{macrocode}
-\@ifundefined{chapter}
-{}% if no chapters
-{% only of chapters exists in this documentclass:
-\NewDocumentCommand{\chapterauthor}{s o m O{} m m O{}}{%
+\NewDocumentCommand{\TD at sectionauthor}{m s o m O{} m m O{}}{%
% \end{macrocode}
% The starred version does not create a \acro{TOC} entry,
-% so it is used as-is:
+% so it is simply used as-is:
% \begin{macrocode}
- \IfBooleanTF{#1}%
- {% star:
- \chapter*{#3\tocdatachapprint{#4}{#5}{#6}{#7}}%
- }%
+ \IfBooleanTF{#2}%
+ {% star:
+ \csuse{#1}*{#4\nopagebreak\tocdatasectionprint{#5}{#6}{#7}{#8}}%
+ }%
% \end{macrocode}
% The un-starred version appears in the \acro{TOC}, so add the author's name:
% \begin{macrocode}
- {% no star:
- \tocdata{toc}{#5 #6}%
+ {% no star:
+ \tocdata{toc}{#6 #7}%
% \end{macrocode}
-% Create the chapter depending on the optional name:
+% Create the section depending on the optional name:
% \begin{macrocode}
- \IfValueTF{#2}%
- {\chapter[#2]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
- {\chapter[#3]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
- }%
+ \IfValueTF{#3}%
+ {\csuse{#1}[#3]{#4\nopagebreak\tocdatasectionprint{#5}{#6}{#7}{#8}}}%
+ {\csuse{#1}[#4]{#4\nopagebreak\tocdatasectionprint{#5}{#6}{#7}{#8}}}%
+ }% no star
% \end{macrocode}
% Create an index entry depending on whether there is a first name:
% \begin{macrocode}
- \ifblank{#5}%
- {\index{#6}}%
- {\index{#6, #5}}%
-}% end of \chapterauthor
-}% end of \@ifundefined{chapter}
+ \ifblank{#6}%
+ {\index{#7}}%
+ {\index{#7, #6}}%
+}
% \end{macrocode}
% \end{macro}
-
-
+%
+%
+% \begin{macro}{\partauthor} * \oarg{2: \TOC\ entry} \marg{3: title}
+% \oarg{4: prefix} \marg{5: first} \marg{6: last} \oarg{7: suffix}
+%
+% \changes{v2.00}{2019/03/15}{Added.}
+%
+% \begin{macrocode}
+\newcommand*{\partauthor}{\TD at sectionauthor{part}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\chapterauthor} * \oarg{2: \TOC\ entry} \marg{3: title}
+% \oarg{4: prefix} \marg{5: first} \marg{6: last} \oarg{7: suffix}
+%
+% \begin{macrocode}
+\@ifundefined{chapter}
+{}% if no chapters
+{% only of chapters exists in this documentclass:
+ \newcommand*{\chapterauthor}{\TD at sectionauthor{chapter}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{\sectionauthor} * \oarg{2: \TOC\ entry} \marg{3: title}
% \oarg{4: prefix} \marg{5: first} \marg{6: last} \oarg{7: suffix}
%
-% \changes{v0.12}{2016/11/28}{Expands first name before index check.}
% \begin{macrocode}
-\NewDocumentCommand{\sectionauthor}{s o m O{} m m O{}}{%
+\newcommand*{\sectionauthor}{\TD at sectionauthor{section}}
% \end{macrocode}
-% The starred version does not create a \acro{TOC} entry,
-% so it is simply used as-is:
+% \end{macro}
+%
+%
+% \begin{macro}{\subsectionauthor} * \oarg{2: \TOC\ entry} \marg{3: title}
+% \oarg{4: prefix} \marg{5: first} \marg{6: last} \oarg{7: suffix}
+%
+% \changes{v2.00}{2019/03/15}{Added.}
+%
% \begin{macrocode}
- \IfBooleanTF{#1}%
- {% star:
- \section*{#3\tocdatasecprint{#4}{#5}{#6}{#7}}%
- }%
+\newcommand*{\subsectionauthor}{\TD at sectionauthor{subsection}}
% \end{macrocode}
-% The un-starred version appears in the \acro{TOC}, so add the author's name:
+% \end{macro}
+%
+%
+%
+% \subsubsection{Figure artist name alignment}
+%
+% \changes{v2.00}{2019/03/14}{Replaced \cs{tdnameX} with
+% \cs{tdauthorX} and \cs{tdartistX}.}
+%
+% \begin{macro}{\TD at artistalign} Sets text alignment for the artist's name.
% \begin{macrocode}
- {% no star:
- \tocdata{toc}{#5 #6}%
+\newcommand{\TD at artistalign}{\centering}
% \end{macrocode}
-% Create the section depending on the optional name:
+% \end{macro}
+%
+% \begin{macro}{\tdartistjustify} Sets justified text alignment for the artist's name.
+% \changes{v0.12}{2016/11/30}{etc. Added name alignment.}
% \begin{macrocode}
- \IfValueTF{#2}%
- {\section[#2]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
- {\section[#3]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
- }% no star
+\newcommand{\tdartistjustify}{%
+ \renewcommand{\TD at artistalign}{}%
+}
% \end{macrocode}
-% Create an index entry depending on whether there is a first name:
+% \end{macro}
+%
+% \begin{macro}{\tdartistcenter} Sets centered text alignment for the artist's name.
% \begin{macrocode}
- \ifblank{#5}%
- {\index{#6}}%
- {\index{#6, #5}}%
+\newcommand{\tdartistcenter}{%
+ \renewcommand{\TD at artistalign}{\centering}%
}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tdartistleft} Sets left text alignment for the artist's name.
+% \begin{macrocode}
+\newcommand{\tdartistleft}{%
+ \renewcommand{\TD at artistalign}{\raggedright}%
+}
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\tdartistright} Sets right text alignment for the artist's name.
+% \begin{macrocode}
+\newcommand{\tdartistright}{%
+ \renewcommand{\TD at artistalign}{\raggedleft}%
+}
+% \end{macrocode}
+% \end{macro}
%
-% \subsubsection{Figure name alignment}
%
-% \begin{macro}{\TD at namealign} Sets text alignment in the optional text.
+% \subsubsection{Figure author name alignment}
+%
+% \begin{macro}{\TD at authoralign} Sets text alignment for the author's name.
% \begin{macrocode}
-\newcommand{\TD at namealign}{\centering}
+\newcommand{\TD at authoralign}{\raggedleft}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tdnamejustify} Sets justified text alignment in the optional text.
+% \begin{macro}{\tdauthorjustify} Sets justified text alignment for the author's name.
% \changes{v0.12}{2016/11/30}{etc. Added name alignment.}
% \begin{macrocode}
-\newcommand{\tdnamejustify}{%
- \renewcommand{\TD at namealign}{}%
+\newcommand{\tdauthorjustify}{%
+ \renewcommand{\TD at authoralign}{}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{tdnamecenter} Sets centered text alignment in the optional text.
+% \begin{macro}{\tdauthorcenter} Sets centered text alignment for the author's name.
% \begin{macrocode}
-\newcommand{\tdnamecenter}{%
- \renewcommand{\TD at namealign}{\centering}%
+\newcommand{\tdauthorcenter}{%
+ \renewcommand{\TD at authoralign}{\centering}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{tdnameleft} Sets left text alignment in the optional text.
+% \begin{macro}{\tdauthorleft} Sets left text alignment for the author's name.
% \begin{macrocode}
-\newcommand{\tdnameleft}{%
- \renewcommand{\TD at namealign}{\raggedright}%
+\newcommand{\tdauthorleft}{%
+ \renewcommand{\TD at authoralign}{\raggedright}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{tdnameright} Sets right text alignment in the optional text.
+% \begin{macro}{\tdauthorright} Sets right text alignment for the author's name.
% \begin{macrocode}
-\newcommand{\tdnameright}{%
- \renewcommand{\TD at namealign}{\raggedleft}%
+\newcommand{\tdauthorright}{%
+ \renewcommand{\TD at authoralign}{\raggedleft}%
}
% \end{macrocode}
% \end{macro}
%
%
-% \subsubsection{Figure text alignment}
+% \subsubsection{Figure artist text alignment}
%
-% \begin{macro}{\TD at textalign} Sets text alignment in the optional text.
+% \begin{macro}{\TD at artisttextalign} Sets text alignment in the optional text.
% \begin{macrocode}
-\newcommand{\TD at textalign}{\centering}
+\newcommand{\TD at artisttextalign}{\centering}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tdtextjustify} Sets justified text alignment in the optional text.
+% \begin{macro}{\tdartisttextjustify} Sets justified text alignment in the optional text.
% \changes{v0.12}{2016/11/30}{etc. Added text alignment.}
% \begin{macrocode}
-\newcommand{\tdtextjustify}{%
- \renewcommand{\TD at textalign}{}%
+\newcommand{\tdartisttextjustify}{%
+ \renewcommand{\TD at artisttextalign}{}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{tdtextcenter} Sets centered text alignment in the optional text.
+% \begin{macro}{\tdartisttextcenter} Sets centered text alignment in the optional text.
% \begin{macrocode}
-\newcommand{\tdtextcenter}{%
- \renewcommand{\TD at textalign}{\centering}%
+\newcommand{\tdartisttextcenter}{%
+ \renewcommand{\TD at artisttextalign}{\centering}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{tdtextleft} Sets left text alignment in the optional text.
+% \begin{macro}{\tdartisttextleft} Sets left text alignment in the optional text.
% \begin{macrocode}
-\newcommand{\tdtextleft}{%
- \renewcommand{\TD at textalign}{\raggedright}%
+\newcommand{\tdartisttextleft}{%
+ \renewcommand{\TD at artisttextalign}{\raggedright}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{tdtextright} Sets right text alignment in the optional text.
+% \begin{macro}{\tdartisttextright} Sets right text alignment in the optional text.
% \begin{macrocode}
-\newcommand{\tdtextright}{%
- \renewcommand{\TD at textalign}{\raggedleft}%
+\newcommand{\tdartisttextright}{%
+ \renewcommand{\TD at artisttextalign}{\raggedleft}%
}
% \end{macrocode}
% \end{macro}
%
%
+% \subsubsection{Figure author text alignment}
%
-% \subsubsection{Figures}
+% \begin{macro}{\TD at authortextalign} Sets text alignment in the optional text.
+% \begin{macrocode}
+\newcommand{\TD at authortextalign}{\centering}
+% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}{\captionartist} * \oarg{2: \LOF\ entry} \marg{3: title}
-% \oarg{4: supplemental text}
-% \oarg{5: prefix} \marg{6: first} \\
-% \marg{7: last} \oarg{8: suffix}
+% \begin{macro}{\tdauthortextjustify} Sets justified text alignment in the optional text.
+% \changes{v0.12}{2016/11/30}{etc. Added text alignment.}
+% \begin{macrocode}
+\newcommand{\tdauthortextjustify}{%
+ \renewcommand{\TD at authortextalign}{}%
+}
+% \end{macrocode}
+% \end{macro}
%
-% \changes{v0.12}{2016/11/28}{Allows paragraphs in add'l text.}
-% \changes{v0.12}{2016/11/28}{Expands first name before index check.}
+% \begin{macro}{\tdauthortextcenter} Sets centered text alignment in the optional text.
+% \begin{macrocode}
+\newcommand{\tdauthortextcenter}{%
+ \renewcommand{\TD at authortextalign}{\centering}%
+}
+% \end{macrocode}
+% \end{macro}
%
-% This macro adds optional supplemental text, which will be printed below the
+% \begin{macro}{\tdauthortextleft} Sets left text alignment in the optional text.
+% \begin{macrocode}
+\newcommand{\tdauthortextleft}{%
+ \renewcommand{\TD at authortextalign}{\raggedright}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tdauthortextright} Sets right text alignment in the optional text.
+% \begin{macrocode}
+\newcommand{\tdauthortextright}{%
+ \renewcommand{\TD at authortextalign}{\raggedleft}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsubsection{Figure captions with artists and authors}
+%
+% These macros adds optional supplemental text, which will be printed below the
% artist's name and above the caption, presuming that the caption is generated
% below the figure.
%
@@ -1071,24 +1389,40 @@
% If using the optional prefix, the optional text must also be given, even if it
% \watchout[Optional arguments]
% is empty. For example, use:
-% \begin{sourceverb}
-% \captionartist{Title}|\textcolor{red}{|[]|}|[Sir]{Isaac}{Newton}
-% \end{sourceverb}
+% \begin{sourcedisplay}
+% \cs{captionartist}\{Title\}\textcolor{red}{[]}[Sir]\{Isaac\}\{Newton\}
+% \end{sourcedisplay}
% If only one optional argument is given before the first name, it will be
% interpreted as the optional text, not as the optional prefix.
+%
+%
+% \begin{macro}{\TD at captionartistauthor}
+% \marg{1: "artist" or "author"}
+% *
+% \oarg{3: \LOF\ entry} \marg{4: title}
+% \oarg{5: supplemental text}
+% \oarg{6: prefix} \marg{7: first} \\
+% \marg{8: last} \oarg{9: suffix}
+%
+% Factored from \cs{captionartist} and \cs{captionauthor}, below.
+%
+% \changes{v0.12}{2016/11/28}{Allows paragraphs in add'l text.}
+% \changes{v0.12}{2016/11/28}{Expands first name before index check.}
+% \changes{v2.00}{2019/03/15}{Factored.}
+%
% \begin{macrocode}
-\NewDocumentCommand{\captionartist}{s o m +O{} O{} m m O{}}{%
+\NewDocumentCommand{\TD at captionartistauthor}{m s o m +O{} O{} m m O{}}{%
% \end{macrocode}
+%
% Print the artist's name next to the figure:
% \begin{macrocode}
- \par\addvspace{\medskipamount}%
- \tocdatafigprint{#5}{#6}{#7}{#8}%
+ \csuse{tocdata#1print}{#6}{#7}{#8}{#9}%
% \end{macrocode}
% If supplemental text is provided, print it below the author:
% \begin{macrocode}
- \ifblank{#4}%
+ \ifblank{#5}%
{}%
- {\par\tocdatafigtextprint{#4}}%
+ {\par\csuse{tocdata#1textprint}{#5}}%
% \end{macrocode}
% Remove any existing vertical space and only use \cs{caption}'s built-in spacing:
% \begin{macrocode}
@@ -1097,40 +1431,65 @@
% If starred, there should be no \acro{TOC} entry, so do not add tocdata.
% Use \cs{caption*} from the \pkg{caption} or similar packages.
% \begin{macrocode}
- \IfBooleanTF{#1}%
+ \IfBooleanTF{#2}%
{% starred
- \IfValueTF{#2}{\caption*[#2]{#3}}{\caption*{#3}}%
+ \IfValueTF{#3}{\caption*[#3]{#4}}{\caption*{#4}}%
}% starred
{% not starred
% \end{macrocode}
% No starred, so remember the artist's name for inclusion in the \acro{LOF}:
+% \changes{v2.00}{2019/03/14}{Added support for new float types.}
% \begin{macrocode}
- \tocdata{lof}{#6 #7}%
+ \tocdata{\csuse{ext@\@captype}}{#7 #8}%
% \end{macrocode}
% Create the caption depending on the optional name:
% \begin{macrocode}
- \IfValueTF{#2}{\caption[#2]{#3}}{\caption{#3}}%
+ \IfValueTF{#3}{\caption[#3]{#4}}{\caption{#4}}%
}% not starred
% \end{macrocode}
% Create an index entry depending on whether there is a first name:
% \begin{macrocode}
- \ifblank{#6}%
- {\index{#7}}%
- {\index{#7, #6}}%
+ \ifblank{#7}%
+ {\index{#8}}%
+ {\index{#8, #7}}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{figure}[hbp]
+%
+% \begin{macro}{\captionartist} * \oarg{2: \LOF\ entry} \marg{3: title}
+% \oarg{4: supplemental text}
+% \oarg{5: prefix} \marg{6: first} \\
+% \marg{7: last} \oarg{8: suffix}
+%
+% \begin{macrocode}
+\newcommand*{\captionartist}{\TD at captionartistauthor{artist}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionauthor} * \oarg{2: \LOF\ entry} \marg{3: title}
+% \oarg{4: supplemental text}
+% \oarg{5: prefix} \marg{6: first} \\
+% \marg{7: last} \oarg{8: suffix}
+%
+% \begin{macrocode}
+\newcommand*{\captionauthor}{\TD at captionartistauthor{author}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{illustration}
% \setlength{\fboxsep}{0pt}
% \centering
% \fbox{\includegraphics[width=4in]{lacquer_go_board.jpg}}
% \captionartist{Lacquer Go Board}[From the series \textit{Uma Zukushi}.]{Katsushika}{Hokusai}
-% \end{figure}
+% \end{illustration}
%
%
%
%
+%
+%
% ^^A At end:
%
% \clearpage
Modified: trunk/Master/texmf-dist/tex/latex/tocdata/tocdata.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tocdata/tocdata.sty 2019-03-15 21:16:18 UTC (rev 50402)
+++ trunk/Master/texmf-dist/tex/latex/tocdata/tocdata.sty 2019-03-15 21:16:31 UTC (rev 50403)
@@ -17,27 +17,46 @@
%% version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{tocdata}
- [2019/01/12 v1.00 Adds author/artist to TOC entries.]
+ [2019/03/15 v2.00 Adds author/artist to TOC entries.]
-
\RequirePackage{xparse}
\RequirePackage{etoolbox}
+\RequirePackage{xpatch}
\@ifpackageloaded{titletoc}{
+ \PackageError{tocdata}
+ {%
+ Load titletoc after tocdata%
+ }
+ {%
+ Move \protect\usepackage{titletoc} after \protect\usepackage{tocdata}.%
+ }
+}{}
+\@ifpackageloaded{tocloft}{
+ \PackageError{tocdata}
+ {%
+ Load tocloft after tocdata%
+ }
+ {%
+ Move \protect\usepackage{tocloft} after \protect\usepackage{tocdata}.%
+ }
+}{}
+
+\AtBeginDocument{
+\@ifpackageloaded{titletoc}{
\@ifpackageloaded{tocloft}{
\PackageError{tocdata}
- {Both titletoc and tocloft are being used. Load only one}
- {The tocdata package requires either one of titletoc or tocloft.}
+ {%
+ Both titletoc and tocloft are being used.\MessageBreak
+ Load only one%
+ }
+ {%
+ The tocdata package may use the default LaTeX formatting,\MessageBreak
+ or either one of titletoc or tocloft.
+ }
}{}
-}{% Not titletoc.
- \@ifpackageloaded{tocloft}{}{
- \PackageError{tocdata}
- {
- The tocdata package requires either the tocloft or titletoc package%
- }
- {Load either, then load tocdata next.}
- }
+}{}
}
\newcommand{\TD at thistocdata}{}
@@ -53,42 +72,90 @@
\global\def\TD at thistocdata{}%
}
-\@ifpackageloaded{titletoc}{
+\xpatchcmd{\@dottedtocline}
+ {\hfill\nobreak}
+ {\hfill\TD at usetocdata\nobreak}
+ {}%
+ {%
+ \PackageWarningNoLine{tocdata}{%
+ Could not patch LaTeX core \protect\@dottedtocline.\MessageBreak
+ Authors will not appear in TOC, LOF}
+ }%
+\xpatchcmd{\l at part}
+ {\hfil}
+ {\hfil\TD at usetocdata}
+ {}%
+ {%
+ \PackageWarningNoLine{tocdata}{%
+ Could not patch LaTeX core \protect\l at part.\MessageBreak
+ Authors will not appear in TOC parts}
+ }%
+
\@ifundefined{chapter}
{}
{
-\titlecontents{chapter}[0em]{}{\contentslabel{2.5em}}{}{%
-\titlerule*[.75pc]{.}%
-\TD at usetocdata% <-- newly added for the tocdata package
-\contentspage}[\vspace{-.5ex}]%
+\xpatchcmd{\l at chapter}
+ {\hfil\nobreak}
+ {\hfil\TD at usetocdata\nobreak}
+ {}%
+ {%
+ \PackageWarningNoLine{tocdata}{%
+ Could not patch LaTeX core \protect\l at chapter.\MessageBreak
+ Authors will not appear in TOC chapters}
+ }%
}
-\titlecontents{section}[2.5em]{}{\contentslabel{2.5em}}{}{%
-\titlerule*[.75pc]{.}%
-\TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]%
-\titlecontents{figure}[0em]{}{\contentslabel{3em}}{}{%
-\titlerule*[1pc]{.}%
-\TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]%
+\AtBeginDocument{
+\@ifpackageloaded{titletoc}{
+
+\newcommand*{\TD at titletoc@patch}[1]{%
+ \expandafter\xpatchcmd\csname ttl at savel@#1\endcsname
+ {\nobreak\hfil\nobreak}
+ {\nobreak\hfil\TD at usetocdata\nobreak}
+ {}
+ {}
+ \expandafter\xpatchcmd\csname l@#1\endcsname
+ {\contentspage}
+ {\TD at usetocdata\contentspage}
+ {}
+ {}
+}
+
+\TD at titletoc@patch{part}
+\@ifundefined{chapter}{}{\TD at titletoc@patch{chapter}}
+\TD at titletoc@patch{section}
+\TD at titletoc@patch{subsection}
+\TD at titletoc@patch{subsubsection}
+\TD at titletoc@patch{paragraph}
+\TD at titletoc@patch{subparagraph}
+\TD at titletoc@patch{figure}
+\TD at titletoc@patch{table}
}% end of titletoc loaded
{% titletoc is not loaded
}% end of \@ifpackageloaded{titletoc}
+}% end of \AtBeginDocument
+\AtBeginDocument{
\@ifpackageloaded{tocloft}
{
+\appto{\cftpartleader}{\TD at usetocdata}
\if at cfthaschapter
-\renewcommand{\cftchapleader}{\bfseries\cftdotfill{\cftchapdotsep}\TD at usetocdata}
-\renewcommand{\cftsecleader}{\normalfont\cftdotfill{\cftsecdotsep}\TD at usetocdata}
-\renewcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}\TD at usetocdata}
-\else
-\renewcommand{\cftsecleader}{\bfseries\cftdotfill{\cftsecdotsep}\TD at usetocdata}
-\renewcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}\TD at usetocdata}
+ \appto{\cftchapleader}{\TD at usetocdata}
\fi
+\appto{\cftsecleader}{\TD at usetocdata}
+\appto{\cftsubsecleader}{\TD at usetocdata}
+\appto{\cftsubsubsecleader}{\TD at usetocdata}
+\appto{\cftparaleader}{\TD at usetocdata}
+\appto{\cftsubparaleader}{\TD at usetocdata}
+\appto{\cftfigleader}{\TD at usetocdata}
+\appto{\cfttableader}{\TD at usetocdata}
+\appto{\cftsubfigleader}{\TD at usetocdata}
+\appto{\cftsubtableader}{\TD at usetocdata}
+
}% end of tocloft patches
{}% tocloft not loaded
-
+}% \AtBeginDocument
\newcommand{\TD at optionalname}[1]
{%
\ifblank{#1}%
@@ -95,122 +162,150 @@
{}%
{#1~}%
}
+\newcommand{\tocdatapartprint}[4]
+{%
+ \par\unskip\noindent%
+ {%
+ \normalfont\normalsize%
+ \textit{%
+ \hspace*{4em}--- %
+ \TD at optionalname{#1}\TD at optionalname{#2}#3#4%
+ }%
+ }%
+}
\@ifundefined{chapter}
{}% if no chapters
{% only of chapters exists in this documentclass:
-\newcommand{\tocdatachapprint}[4]
-{%
- \newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
- \TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
-}
+ \let\tocdatachapterprint\tocdatapartprint
}% end of chapters-only
-\newcommand{\tocdatasecprint}[4]
-{%
- \newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
- \TD at optionalname{#1}\TD at optionalname{#2}#3#4}%
-}%
-}
-\newcommand{\tocdatafigprint}[4]{%
- \addvspace{2ex}%
+\let\tocdatasectionprint\tocdatapartprint
+\let\tocdatasubsectionprint\tocdatapartprint
+\newcommand{\TD at artistauthorprint}[5]{%
\begin{minipage}{\linewidth}%
- \TD at namealign%
- \footnotesize\textsc{{\TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
+ \csuse{TD@#1align}%
+ \footnotesize\normalfont%
+ \textsc{{\TD at optionalname{#2}\TD at optionalname{#3}#4#5}}%
\end{minipage}%
\par%
\addvspace{2ex}%
}
-\newcommand{\tocdatafigtextprint}[1]{%
+\newcommand{\tocdataartistprint}{%
+ \par\addvspace{\medskipamount}%
+ \TD at artistauthorprint{artist}%
+}
+\newcommand{\tocdataauthorprint}{%
+ \par\unskip
+ \TD at artistauthorprint{author}%
+}
+\newcommand{\TD at artistauthortextprint}[2]{%
\addvspace{2ex}%
\begin{minipage}{\linewidth}%
- \TD at textalign%
- \footnotesize%
+ \csuse{TD@#1textalign}%
+ \footnotesize\normalfont%
\setlength{\parskip}{1.5ex}%
\setlength{\parindent}{0em}%
- #1%
+ #2%
\end{minipage}%
\par%
\addvspace{2ex}%
}
-\@ifundefined{chapter}
-{}% if no chapters
-{% only of chapters exists in this documentclass:
-\NewDocumentCommand{\chapterauthor}{s o m O{} m m O{}}{%
- \IfBooleanTF{#1}%
- {% star:
- \chapter*{#3\tocdatachapprint{#4}{#5}{#6}{#7}}%
- }%
- {% no star:
- \tocdata{toc}{#5 #6}%
- \IfValueTF{#2}%
- {\chapter[#2]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
- {\chapter[#3]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
- }%
- \ifblank{#5}%
- {\index{#6}}%
- {\index{#6, #5}}%
-}% end of \chapterauthor
-}% end of \@ifundefined{chapter}
-
-\NewDocumentCommand{\sectionauthor}{s o m O{} m m O{}}{%
- \IfBooleanTF{#1}%
+\newcommand{\tocdataartisttextprint}{\TD at artistauthortextprint{artist}}
+\newcommand{\tocdataauthortextprint}{\TD at artistauthortextprint{author}}
+\NewDocumentCommand{\TD at sectionauthor}{m s o m O{} m m O{}}{%
+ \IfBooleanTF{#2}%
{% star:
- \section*{#3\tocdatasecprint{#4}{#5}{#6}{#7}}%
+ \csuse{#1}*{#4\nopagebreak\tocdatasectionprint{#5}{#6}{#7}{#8}}%
}%
{% no star:
- \tocdata{toc}{#5 #6}%
- \IfValueTF{#2}%
- {\section[#2]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
- {\section[#3]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
+ \tocdata{toc}{#6 #7}%
+ \IfValueTF{#3}%
+ {\csuse{#1}[#3]{#4\nopagebreak\tocdatasectionprint{#5}{#6}{#7}{#8}}}%
+ {\csuse{#1}[#4]{#4\nopagebreak\tocdatasectionprint{#5}{#6}{#7}{#8}}}%
}% no star
- \ifblank{#5}%
- {\index{#6}}%
- {\index{#6, #5}}%
+ \ifblank{#6}%
+ {\index{#7}}%
+ {\index{#7, #6}}%
}
-\newcommand{\TD at namealign}{\centering}
-\newcommand{\tdnamejustify}{%
- \renewcommand{\TD at namealign}{}%
+\newcommand*{\partauthor}{\TD at sectionauthor{part}}
+\@ifundefined{chapter}
+{}% if no chapters
+{% only of chapters exists in this documentclass:
+ \newcommand*{\chapterauthor}{\TD at sectionauthor{chapter}}
}
-\newcommand{\tdnamecenter}{%
- \renewcommand{\TD at namealign}{\centering}%
+\newcommand*{\sectionauthor}{\TD at sectionauthor{section}}
+\newcommand*{\subsectionauthor}{\TD at sectionauthor{subsection}}
+\newcommand{\TD at artistalign}{\centering}
+\newcommand{\tdartistjustify}{%
+ \renewcommand{\TD at artistalign}{}%
}
-\newcommand{\tdnameleft}{%
- \renewcommand{\TD at namealign}{\raggedright}%
+\newcommand{\tdartistcenter}{%
+ \renewcommand{\TD at artistalign}{\centering}%
}
-\newcommand{\tdnameright}{%
- \renewcommand{\TD at namealign}{\raggedleft}%
+\newcommand{\tdartistleft}{%
+ \renewcommand{\TD at artistalign}{\raggedright}%
}
-\newcommand{\TD at textalign}{\centering}
-\newcommand{\tdtextjustify}{%
- \renewcommand{\TD at textalign}{}%
+\newcommand{\tdartistright}{%
+ \renewcommand{\TD at artistalign}{\raggedleft}%
}
-\newcommand{\tdtextcenter}{%
- \renewcommand{\TD at textalign}{\centering}%
+\newcommand{\TD at authoralign}{\raggedleft}
+\newcommand{\tdauthorjustify}{%
+ \renewcommand{\TD at authoralign}{}%
}
-\newcommand{\tdtextleft}{%
- \renewcommand{\TD at textalign}{\raggedright}%
+\newcommand{\tdauthorcenter}{%
+ \renewcommand{\TD at authoralign}{\centering}%
}
-\newcommand{\tdtextright}{%
- \renewcommand{\TD at textalign}{\raggedleft}%
+\newcommand{\tdauthorleft}{%
+ \renewcommand{\TD at authoralign}{\raggedright}%
}
-\NewDocumentCommand{\captionartist}{s o m +O{} O{} m m O{}}{%
- \par\addvspace{\medskipamount}%
- \tocdatafigprint{#5}{#6}{#7}{#8}%
- \ifblank{#4}%
+\newcommand{\tdauthorright}{%
+ \renewcommand{\TD at authoralign}{\raggedleft}%
+}
+\newcommand{\TD at artisttextalign}{\centering}
+\newcommand{\tdartisttextjustify}{%
+ \renewcommand{\TD at artisttextalign}{}%
+}
+\newcommand{\tdartisttextcenter}{%
+ \renewcommand{\TD at artisttextalign}{\centering}%
+}
+\newcommand{\tdartisttextleft}{%
+ \renewcommand{\TD at artisttextalign}{\raggedright}%
+}
+\newcommand{\tdartisttextright}{%
+ \renewcommand{\TD at artisttextalign}{\raggedleft}%
+}
+\newcommand{\TD at authortextalign}{\centering}
+\newcommand{\tdauthortextjustify}{%
+ \renewcommand{\TD at authortextalign}{}%
+}
+\newcommand{\tdauthortextcenter}{%
+ \renewcommand{\TD at authortextalign}{\centering}%
+}
+\newcommand{\tdauthortextleft}{%
+ \renewcommand{\TD at authortextalign}{\raggedright}%
+}
+\newcommand{\tdauthortextright}{%
+ \renewcommand{\TD at authortextalign}{\raggedleft}%
+}
+\NewDocumentCommand{\TD at captionartistauthor}{m s o m +O{} O{} m m O{}}{%
+ \csuse{tocdata#1print}{#6}{#7}{#8}{#9}%
+ \ifblank{#5}%
{}%
- {\par\tocdatafigtextprint{#4}}%
+ {\par\csuse{tocdata#1textprint}{#5}}%
\unskip%
- \IfBooleanTF{#1}%
+ \IfBooleanTF{#2}%
{% starred
- \IfValueTF{#2}{\caption*[#2]{#3}}{\caption*{#3}}%
+ \IfValueTF{#3}{\caption*[#3]{#4}}{\caption*{#4}}%
}% starred
{% not starred
- \tocdata{lof}{#6 #7}%
- \IfValueTF{#2}{\caption[#2]{#3}}{\caption{#3}}%
+ \tocdata{\csuse{ext@\@captype}}{#7 #8}%
+ \IfValueTF{#3}{\caption[#3]{#4}}{\caption{#4}}%
}% not starred
- \ifblank{#6}%
- {\index{#7}}%
- {\index{#7, #6}}%
+ \ifblank{#7}%
+ {\index{#8}}%
+ {\index{#8, #7}}%
}
+\newcommand*{\captionartist}{\TD at captionartistauthor{artist}}
+\newcommand*{\captionauthor}{\TD at captionartistauthor{author}}
\endinput
%%
%% End of file `tocdata.sty'.
More information about the tex-live-commits
mailing list