texlive[42623] Master/texmf-dist: tocdata (2dec16)

commits+karl at tug.org commits+karl at tug.org
Fri Dec 2 23:57:21 CET 2016


Revision: 42623
          http://tug.org/svn/texlive?view=revision&revision=42623
Author:   karl
Date:     2016-12-02 23:57:20 +0100 (Fri, 02 Dec 2016)
Log Message:
-----------
tocdata (2dec16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tocdata/README
    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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/tocdata/images/
    trunk/Master/texmf-dist/doc/latex/tocdata/images/astronometer_herschel.jpg
    trunk/Master/texmf-dist/doc/latex/tocdata/images/diagram_sunbeam.jpg
    trunk/Master/texmf-dist/doc/latex/tocdata/images/engineer.jpg
    trunk/Master/texmf-dist/doc/latex/tocdata/images/go_problem.png
    trunk/Master/texmf-dist/doc/latex/tocdata/images/lacquer_go_board.jpg
    trunk/Master/texmf-dist/doc/latex/tocdata/images/newton_astrolabe.jpg
    trunk/Master/texmf-dist/doc/latex/tocdata/images/quail.jpg
    trunk/Master/texmf-dist/doc/latex/tocdata/images/symbol_warning.pdf

Modified: trunk/Master/texmf-dist/doc/latex/tocdata/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/README	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/README	2016-12-02 22:57:20 UTC (rev 42623)
@@ -1,7 +1,7 @@
 The tocdata package
 Adds names to table of contents / list of figures entries.
 
-v0.11 — 2016/07/11
+v0.12 — 2016/12/02
 Copyright 2016 Brian Dunn — www.BDTechConcepts.com
 LaTeX Project Public License, version 1.3
 

Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/astronometer_herschel.jpg
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/astronometer_herschel.jpg
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/astronometer_herschel.jpg	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/astronometer_herschel.jpg	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/astronometer_herschel.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/diagram_sunbeam.jpg
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/diagram_sunbeam.jpg
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/diagram_sunbeam.jpg	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/diagram_sunbeam.jpg	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/diagram_sunbeam.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/engineer.jpg
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/engineer.jpg
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/engineer.jpg	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/engineer.jpg	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/engineer.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/go_problem.png
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/go_problem.png
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/go_problem.png	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/go_problem.png	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/go_problem.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/lacquer_go_board.jpg
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/lacquer_go_board.jpg
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/lacquer_go_board.jpg	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/lacquer_go_board.jpg	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/lacquer_go_board.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/newton_astrolabe.jpg
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/newton_astrolabe.jpg
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/newton_astrolabe.jpg	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/newton_astrolabe.jpg	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/newton_astrolabe.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/quail.jpg
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/quail.jpg
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/quail.jpg	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/quail.jpg	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/quail.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tocdata/images/symbol_warning.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tocdata/images/symbol_warning.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tocdata/images/symbol_warning.pdf	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/doc/latex/tocdata/images/symbol_warning.pdf	2016-12-02 22:57:20 UTC (rev 42623)

Property changes on: trunk/Master/texmf-dist/doc/latex/tocdata/images/symbol_warning.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
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	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/source/latex/tocdata/tocdata.dtx	2016-12-02 22:57:20 UTC (rev 42623)
@@ -15,7 +15,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{tocdata}
-%<package>    [2016/07/11 v0.11 Adds author/artist to TOC entries.]
+%<package>    [2016/12/02 v0.12 Adds author/artist to TOC entries.]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -60,6 +60,8 @@
 
 \usepackage[log-declarations=false]{xparse}
 
+\usepackage{xifthen}
+
 \usepackage[svgnames]{xcolor}
 \definecolor{myurlcolor}{rgb}{0,0,.7}
 \definecolor{mylinkcolor}{rgb}{.7,0,0}
@@ -126,22 +128,61 @@
 
 \usepackage{cleveref}
 
+
+
 \newcommand{\lmacro}[1]{\textbackslash#1}
 \newcommand{\cmds}[1]{\texttt{#1}}
 \newcommand{\env}[1]{\texttt{#1}}
 \newcommand{\pkg}[1]{\textsf{\textbf{#1}}}
 \newcommand{\acro}[1]{\textsc{\lowercase{#1}}}
-\newcommand{\DescType}[1]{\raggedleft{\scriptsize#1}\quad}
-\newcommand{\DescribeCommand}[1]{\leavevmode\marginpar{\DescType{Cmd}\bfseries\texttt{#1}}\index{#1 (command)}\ignorespaces}
-\newcommand{\DescribeFile}[1]{\leavevmode\marginpar{\DescType{File}\bfseries\texttt{#1}}\index{#1 (file)}\index{files:>#1}\ignorespaces}
-\newcommand{\DescribePackage}[1]{\leavevmode\marginpar{\DescType{Pkg}\bfseries\textsf{#1}}\index{#1 (package)}\index{packages:>#1}\ignorespaces}
-\newcommand{\DescribeBoolean}[1]{\leavevmode\marginpar{\DescType{Bool}\texttt{#1}}\index{#1 (boolean)}\index{booleans:>#1}\ignorespaces}
-\newcommand{\DescribeLength}[1]{\leavevmode\marginpar{\DescType{Len}\cmd{#1}}\index{\cmd{#1} (length)}\index{lengths:>\cmd{#1}}\ignorespaces}
-\newcommand{\DescribeCounter}[1]{\leavevmode\marginpar{\DescType{Ctr}\texttt{#1}}\index{#1 (counter)}\index{counters:>#1}\ignorespaces}
-\newcommand{\DescribeSimple}[1]{\leavevmode\marginpar{\raggedleft\texttt{#1}}\index{#1}\ignorespaces}
+
+
+
+% Indexing improvements:
+\makeatletter
+
+\newcommand*{\Desc at Type}[1]{\raggedleft{\scriptsize#1}\quad}
+
+% \Describe at Usage{name}{margin tag}{index tag}
+\newcommand*{\Describe at Usage}[3]{%
+% \@bsphack%
+\leavevmode\marginpar{\Desc at Type{#2}\texttt{#1}}%
+\index{#1\actualchar{\protect\ttfamily#1} (#3)\encapchar usage}%
+\index{#3s:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar usage}%
+% \@esphack%
+\ignorespaces%
+}
+
+% \Describe at CmdUsage{name}{margin tag}{index tag}
+% where name is a \macro
+\newcommand*{\Describe at CmdUsage}[3]{%
+% \@bsphack%
+\leavevmode\marginpar{\Desc at Type{#2}\cmd{#1}}%
+\SpecialIndex@{#1}{ (#3)\encapchar usage}%
+\index{#3s:\levelchar\cmd{#1}\encapchar usage}\ignorespaces%
+% \@esphack%
+\ignorespaces%
+}
+
+\newcommand*{\DescribeCommand}[1]{\Describe at Usage{#1}{Cmd}{command}}
+\newcommand*{\DescribeFile}[1]{\Describe at Usage{#1}{File}{file}}
+\newcommand*{\DescribePackage}[1]{\Describe at Usage{#1}{Pkg}{package}}
+\newcommand*{\DescribeOption}[1]{\Describe at Usage{#1}{Opt}{option}}
+\newcommand*{\DescribeArgument}[1]{\Describe at Usage{#1}{Arg}{argument}}
+\newcommand*{\DescribeBoolean}[1]{\Describe at Usage{#1}{Bool}{boolean}}
+\newcommand*{\DescribeLength}[1]{\Describe at CmdUsage{#1}{Len}{length}}
+\newcommand*{\DescribeCounter}[1]{\Describe at Usage{#1}{Ctr}{counter}}
+\newcommand*{\DescribeSimple}[1]{\leavevmode\marginpar{\raggedleft\texttt{#1}}\index{#1=\texttt{#1}}\ignorespaces}
 \renewcommand{\PrintEnvName}[1]{\strut \MacroFont {\scriptsize{}Env\quad}#1\ }
+\renewcommand{\PrintDescribeEnv}[1]{\strut \MacroFont {\scriptsize{}Env\quad}#1\ }
 
+\newcommand*{\DescribeKey}[1]{%
+\Describe at Usage{#1}{Key}{key}%
+}
 
+\makeatother
+
+
 \newcommand{\tikz}{Ti\textit{k}z}
 \newcommand{\htmlfive}{\acro{HTML}\oldstylenums{5}}
 \newcommand{\cssthree}{\acro{CSS}\oldstylenums{3}}
@@ -208,8 +249,10 @@
 %   Grave accent \`      Left brace    \{     Vertical bar \|
 %   Right brace   \}     Tilde         \~}
 
-% \changes{v0.10}{2016/05/05}{\ 2016/05/05 Initial version.}
-% \changes{v0.11}{2016/07/11}{\ 2016/07/11 Minor docs improvements in spelling, grammar, formatting.}
+% \changes{v0.10}{2016/05/05}{\ 2016/05/05 Initial ver.}
+% \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}
 
 
 
@@ -220,9 +263,9 @@
 % \DoNotIndex{\booltrue,\boolfalse}
 % \expandafter\DoNotIndex\expandafter{\detokenize{\(,\),\,,\\,\#,\$,\%,\^,\_,\~,\ ,\&,\{,\}}}
 %
-% \renewcommand{\listfigurename}{List of Illustrations}
-% \begin{titlepage}
-% \centering
+% ^^A \renewcommand{\listfigurename}{List of }
+% \begin{center}
+% \thispagestyle{empty}
 % \vfill
 % ^^A \includegraphics[width=.3\linewidth]{\mypackagename_logo.pdf}
 % \vfill
@@ -239,18 +282,7 @@
 % {\normalsize\textup{\quicksummary}}
 %
 %
-% \vfill
 %
-% 
-% ^^A % \title{The \pkg{lwarp} package\thanks{This document
-% ^^A %   corresponds to \pkg{lwarp}~\fileversion,
-% ^^A %   dated \filedate.}}
-% ^^A % \author{{\small\copyright{} 2016} Brian Dunn\\ \small \texttt{bd at BDTechConcepts.com}}
-% ^^A % \published{}
-% ^^A % \subtitle{\textup{\LaTeX{} to HTML5}}
-% ^^A %
-% ^^A % \maketitle
-%
 % \vfill
 %
 % \begin{abstract}
@@ -265,7 +297,7 @@
 % \vspace*{\fill}
 % \vspace*{\fill}
 % \vspace*{\fill}
-% \end{titlepage}
+% \end{center}
 %
 % \tableofcontents
 % \clearpage
@@ -314,7 +346,7 @@
 %
 % \clearpage
 %
-% \sectionauthor[Other Methods]{Other Methods}{Various}{Authors}
+% \sectionauthor[Other methods]{Other methods}{Various}{Authors}
 % \label{sec:othermethods}
 %
 % For other methods which place the author on a separate line from the title, see the
@@ -337,7 +369,6 @@
 %	{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}
 % \setlength{\fboxsep}{0pt}
 % \centering
@@ -344,10 +375,9 @@
 % \fbox{\includegraphics[height=3in]{engineer.jpg}}
 % \captionartist
 % [The Crazy Engineer]
-% {The Crazy Engineer}[Illustration from \textit{The Crazy Engineer} \\ \textit{McGuffey's Fifth Eclectic Reader}]{H. F.}{Farny}
+% {The Crazy Engineer}[Illustration from \textit{The Crazy Engineer} \par \textit{McGuffey's Fifth Eclectic Reader}]{H. F.}{Farny}
 % \end{figure}
 %
-%
 % \clearpage
 %
 % \begin{figure}
@@ -372,11 +402,11 @@
 % \cs{tocdatafont} is also provided to control the appearance of this data in the \acro{TOC}/\acro{LOF}.
 % \item At the highest level is a sample implementation of user-level macros which provides
 % an easy way to create chapters, sections, and figures with associated authors and artists,
-% along with supplemental information for figures and automatic index entries for both.
+% along with supplemental information for figures, and automatic index entries.
 % \end{itemize}
 %
 %
-% \subsection{Basic Setup}
+% \subsection{Basic setup}
 %
 %
 %
@@ -532,6 +562,27 @@
 % 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.
+% 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
 %
@@ -548,7 +599,7 @@
 % \centering
 % \fbox{\includegraphics[width=3in]{quail.jpg}}
 % \captionartist{Quail\label{fig:quail}}
-%	[Illustration from \textit{About Quail} \\ \textit{McGuffey's Fifth Eclectic Reader}]
+%	[Illustration from \textit{About Quail} \par \textit{McGuffey's Fifth Eclectic Reader}]
 %	{Alexander}{Pope}
 % \end{figure}
 %
@@ -561,7 +612,7 @@
 % \centering
 % \includegraphics[width=3in]{diagram_sunbeam.jpg}
 % \captionartist
-%	{Diagram Of A Sunbeam}[]
+%	{Diagram of a Sunbeam}[]
 %	[Sir]{Isaac}{Newton}
 % \end{figure}
 %
@@ -576,9 +627,13 @@
 %
 %
 % \subsection{Requirements}
+%
+% \changes{v0.12}{2016/12/02}{Added requirement for \pkg{xifthen}.}
+%
 %    \begin{macrocode}
 \RequirePackage{xparse}
 \RequirePackage{etoolbox}
+\RequirePackage{xifthen}
 %    \end{macrocode}
 
 
@@ -678,7 +733,7 @@
 %    \begin{macrocode}
 \TD at usetocdata% <-- newly added for the tocdata package
 %
-\contentspage}[\vspace{-.5ex}]
+\contentspage}[\vspace{-.5ex}]%
 }
 %    \end{macrocode}
 % Likewise for sections:
@@ -687,7 +742,7 @@
 % \dotfill
 \titlerule*[.75pc]{.}%
 \TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]
+\contentspage}[\vspace{-.5ex}]%
 %    \end{macrocode}
 % Likewise for figures:
 %    \begin{macrocode}
@@ -695,7 +750,7 @@
 % \dotfill
 \titlerule*[1pc]{.}%
 \TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]
+\contentspage}[\vspace{-.5ex}]%
 %    \end{macrocode}
 
 %    \begin{macrocode}
@@ -767,16 +822,39 @@
 % which does not have an author/artist name.
 %
 %
+% \subsubsection{User customization}
+%
+%
+% \begin{macro}{\TD at optionalname} \marg{name}
+%
+% Adds optional artist's name and the following space.
+%
+%    \begin{macrocode}
+\newcommand{\TD at optionalname}[1]
+{%
+\ifthenelse{\equal{#1}{}}%
+{}%
+{#1~}%
+}
+%    \end{macrocode}
+% \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.
 %
+% \changes{v0.12}{2016/11/29}{Improved spacing.}
+%
 %    \begin{macrocode}
 \@ifundefined{chapter}
 {}% if no chapters
 {% only of chapters exists in this documentclass:
 \newcommand{\tocdatachapprint}[4]
-{\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- #1 #2 #3#4}}}
+{%
+\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
+\TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
+}
 }% end of chapters-only
 %    \end{macrocode}
 % To remove the author's name, redefine this as a null function taking four arguments:
@@ -789,9 +867,15 @@
 %
 % User-redefinable macro to print the author's name underneath the section title.
 %
+% \changes{v0.12}{2016/11/29}{Improved spacing.}
+%
 %    \begin{macrocode}
 \newcommand{\tocdatasecprint}[4]
-{\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- #1 #2 #3#4}}}
+{%
+\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
+\TD at optionalname{#1}\TD at optionalname{#2}#3#4}%
+}%
+}
 %    \end{macrocode}
 % To remove the author's name, redefine this as a null function taking four arguments:
 % \begin{docsidebar}
@@ -799,8 +883,68 @@
 % \end{docsidebar}
 % \end{macro}
 %
+%
+%
+% \begin{macro}{\tocdatafigprint} \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.}
+%
+%    \begin{macrocode}
+\newcommand{\tocdatafigprint}[4]{%
+\addvspace{2ex}%
+% \addvspace{\medskipamount}%
+\begin{minipage}{\linewidth}%
+\TD at namealign%
+\footnotesize\textsc{{\TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
+\end{minipage}%
+\par%
+\addvspace{2ex}%
+% \addvspace{\medskipamount}%
+}
+%    \end{macrocode}
+% To remove the artist's name, redefine this as a null function taking four arguments:
+% \begin{docsidebar}
+% |\renewcommand{\tocdatafigprint}[4]{}|
+% \end{docsidebar}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\tocdatafigtextprint} \marg{first} \marg{last}
+%
+% 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/29}{Added text alignment.}
+%
+%    \begin{macrocode}
+\newcommand{\tocdatafigtextprint}[1]{%
+\addvspace{2ex}%
+\begin{minipage}{\linewidth}%
+\TD at textalign%
+\footnotesize%
+\setlength{\parskip}{1.5ex}%
+\setlength{\parindent}{0em}%
+#1%
+\end{minipage}%
+\par%
+\addvspace{2ex}%
+% \addvspace{\medskipamount}%
+}
+%    \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}
+%
+% \changes{v0.12}{2016/11/28}{Expands first name before index check.}
 %    \begin{macrocode}
 \@ifundefined{chapter}
 {}% if no chapters
@@ -811,25 +955,25 @@
 % so it is used as-is:
 %    \begin{macrocode}
 \IfBooleanTF{#1}% star:
-{\chapter*{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}
+{\chapter*{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
 %    \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}
+\tocdata{toc}{#5 #6}%
 %    \end{macrocode}
 % Create the chapter 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{#2}%
+{\chapter[#2]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
+{\chapter[#3]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
+}%
 %    \end{macrocode}
 % Create an index entry depending on whether there is a first name:
 %    \begin{macrocode}
-\ifblank{#5}
-{\index{#6}}
-{\index{#6, #5}}
+\ifthenelse{\equal{#5}{}}%
+{\index{#6}}%
+{\index{#6, #5}}%
 }% end of \chapterauthor
 }% end of \@ifundefined{chapter}
 %    \end{macrocode}
@@ -838,6 +982,8 @@
 
 % \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{}}{%
 %    \end{macrocode}
@@ -845,71 +991,132 @@
 % so it is simply used as-is:
 %    \begin{macrocode}
 \IfBooleanTF{#1}% star:
-{\section*{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}
+{\section*{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
 %    \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}
+\tocdata{toc}{#5 #6}%
 %    \end{macrocode}
 % Create the section depending on the optional name:
 %    \begin{macrocode}
-\IfValueTF{#2}
-{\section[#2]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}
-{\section[#3]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}
-}
+\IfValueTF{#2}%
+{\section[#2]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
+{\section[#3]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
+}% 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}}
+\ifthenelse{\equal{#5}{}}%
+{\index{#6}}%
+{\index{#6, #5}}%
 }
 %    \end{macrocode}
 % \end{macro}
-
-
-% \begin{macro}{\tocdatafigprint} \marg{prefix} \marg{first} \marg{last} \marg{suffix}
 %
-% User-redefinable macro to print the artist's name underneath the figure.
 %
 %
+% \subsubsection{Figure name alignment}
+%
+% \begin{macro}{\TD at namealign} Sets text alignment in the optional text.
 %    \begin{macrocode}
-\newcommand{\tocdatafigprint}[4]{%
-\addvspace{1ex}%
-{\centering\footnotesize\textsc{{#1 #2 #3#4}}\par}%
+\newcommand{\TD at namealign}{\centering}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tdnamejustify} Sets justified text alignment in the optional text.
+% \changes{v0.12}{2016/11/30}{etc. Added name alignment.}
+%    \begin{macrocode}
+\newcommand{\tdnamejustify}{%
+\renewcommand{\TD at namealign}{}%
 }
 %    \end{macrocode}
-% To remove the artist's name, redefine this as a null function taking four arguments:
-% \begin{docsidebar}
-% |\renewcommand{\tocdatafigprint}[4]{}|
-% \end{docsidebar}
 % \end{macro}
 %
+% \begin{macro}{tdnamecenter} Sets centered text alignment in the optional text.
+%    \begin{macrocode}
+\newcommand{\tdnamecenter}{%
+\renewcommand{\TD at namealign}{\centering}%
+}
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{macro}{\tocdatafigtextprint} \marg{first} \marg{last}
+% \begin{macro}{tdnameleft} Sets left text alignment in the optional text.
+%    \begin{macrocode}
+\newcommand{\tdnameleft}{%
+\renewcommand{\TD at namealign}{\raggedright}%
+}
+%    \end{macrocode}
+% \end{macro}
 %
-% User-redefinable macro to print the artist's name underneath the figure.
+% \begin{macro}{tdnameright} Sets right text alignment in the optional text.
+%    \begin{macrocode}
+\newcommand{\tdnameright}{%
+\renewcommand{\TD at namealign}{\raggedleft}%
+}
+%    \end{macrocode}
+% \end{macro}
 %
+%
+% \subsubsection{Figure text alignment}
+%
+% \begin{macro}{\TD at textalign} Sets text alignment in the optional text.
 %    \begin{macrocode}
-\newcommand{\tocdatafigtextprint}[1]{%
-\addvspace{1ex}%
-{\centering\footnotesize#1\par}%
+\newcommand{\TD at textalign}{\centering}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tdtextjustify} 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}{}%
 }
 %    \end{macrocode}
 % \end{macro}
-
+%
+% \begin{macro}{tdtextcenter} Sets centered text alignment in the optional text.
+%    \begin{macrocode}
+\newcommand{\tdtextcenter}{%
+\renewcommand{\TD at textalign}{\centering}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{tdtextleft} Sets left text alignment in the optional text.
+%    \begin{macrocode}
+\newcommand{\tdtextleft}{%
+\renewcommand{\TD at textalign}{\raggedright}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{tdtextright} Sets right text alignment in the optional text.
+%    \begin{macrocode}
+\newcommand{\tdtextright}{%
+\renewcommand{\TD at textalign}{\raggedleft}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsubsection{Figures}
+%
 % \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}
 %
+% \changes{v0.12}{2016/11/28}{Allows paragraphs in add'l text.}
+% \changes{v0.12}{2016/11/28}{Expands first name before index check.}
+%
 % This macro 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.
 %
 % If using the optional prefix, the optional text must also be given, even if it
+% \watchout[Optional arguments]
 % is empty.  For example, use:
-% \watchout[Optional arguments]
 % \begin{docsidebar}
 %	|\captionartist{Title}|\textcolor{red}{|[]|}|[Sir]{Isaac}{Newton}|
 %
@@ -919,16 +1126,21 @@
 % interpreted as the optional text, not as the optional prefix.)
 % \end{docsidebar}
 %    \begin{macrocode}
-\NewDocumentCommand{\captionartist}{s o m O{} O{} m m O{}}{%
+\NewDocumentCommand{\captionartist}{s o m +O{} O{} m m O{}}{%
 %    \end{macrocode}
 % Print the artist's name next to the figure:
 %    \begin{macrocode}
-\par\tocdatafigprint{#5}{#6}{#7}{#8}
+\par\addvspace{\medskipamount}%
+\tocdatafigprint{#5}{#6}{#7}{#8}%
 %    \end{macrocode}
 % If supplemental text is provided, print it below the author:
 %    \begin{macrocode}
-\ifblank{#4}{}{\par\tocdatafigtextprint{#4}}
+\ifthenelse{\equal{#4}{}}{}{\par\tocdatafigtextprint{#4}}%
 %    \end{macrocode}
+% Remove any existing vertical space and only use \cs{caption}'s built-in spacing:
+%    \begin{macrocode}
+\unskip%
+%    \end{macrocode}
 % 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}
@@ -935,8 +1147,8 @@
 \IfBooleanTF{#1}%
 {% starred
 \IfValueTF{#2}{\caption*[#2]{#3}}{\caption*{#3}}%
-}%
-{% no starred
+}% starred
+{% not starred
 %    \end{macrocode}
 % No starred, so remember the artist's name for inclusion in the \acro{LOF}:
 %    \begin{macrocode}
@@ -945,11 +1157,11 @@
 % Create the caption depending on the optional name:
 %    \begin{macrocode}
 \IfValueTF{#2}{\caption[#2]{#3}}{\caption{#3}}%
-}
+}% not starred
 %    \end{macrocode}
 % Create an index entry depending on whether there is a first name:
 %    \begin{macrocode}
-\ifblank{#6}%
+\ifthenelse{\equal{#6}{}}%
 {\index{#7}}%
 {\index{#7, #6}}%
 }
@@ -960,7 +1172,7 @@
 % \setlength{\fboxsep}{0pt}
 % \centering
 % \fbox{\includegraphics[width=4in]{lacquer_go_board.jpg}}
-% \captionartist{Lacquer Go Board}[From the series, \textit{Uma Zukushi}.]{Katsushika}{Hokusai}
+% \captionartist{Lacquer Go Board}[From the series \textit{Uma Zukushi}.]{Katsushika}{Hokusai}
 % \end{figure}
 %
 %

Modified: trunk/Master/texmf-dist/tex/latex/tocdata/tocdata.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tocdata/tocdata.sty	2016-12-02 22:57:05 UTC (rev 42622)
+++ trunk/Master/texmf-dist/tex/latex/tocdata/tocdata.sty	2016-12-02 22:57:20 UTC (rev 42623)
@@ -17,12 +17,13 @@
 %% version 2005/12/01 or later.
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{tocdata}
-    [2016/07/11 v0.11 Adds author/artist to TOC entries.]
+    [2016/12/02 v0.12 Adds author/artist to TOC entries.]
 
 
 
 \RequirePackage{xparse}
 \RequirePackage{etoolbox}
+\RequirePackage{xifthen}
 
 \newcommand{\TD at thistocdata}{}
 
@@ -45,16 +46,16 @@
 \titlecontents{chapter}[0em]{}{\contentslabel{2.5em}}{}{%
 \titlerule*[.75pc]{.}%
 \TD at usetocdata% <-- newly added for the tocdata package
-\contentspage}[\vspace{-.5ex}]
+\contentspage}[\vspace{-.5ex}]%
 }
 \titlecontents{section}[2.5em]{}{\contentslabel{2.5em}}{}{%
 \titlerule*[.75pc]{.}%
 \TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]
+\contentspage}[\vspace{-.5ex}]%
 \titlecontents{figure}[0em]{}{\contentslabel{3em}}{}{%
 \titlerule*[1pc]{.}%
 \TD at usetocdata%
-\contentspage}[\vspace{-.5ex}]
+\contentspage}[\vspace{-.5ex}]%
 
 }% end of titletoc loaded
 {% titletoc is not loaded
@@ -73,67 +74,119 @@
 }% end of tocloft patches
 {}% tocloft not loaded
 
+\newcommand{\TD at optionalname}[1]
+{%
+\ifthenelse{\equal{#1}{}}%
+{}%
+{#1~}%
+}
 \@ifundefined{chapter}
 {}% if no chapters
 {% only of chapters exists in this documentclass:
 \newcommand{\tocdatachapprint}[4]
-{\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- #1 #2 #3#4}}}
+{%
+\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
+\TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
+}
 }% end of chapters-only
 \newcommand{\tocdatasecprint}[4]
-{\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- #1 #2 #3#4}}}
+{%
+\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- %
+\TD at optionalname{#1}\TD at optionalname{#2}#3#4}%
+}%
+}
+\newcommand{\tocdatafigprint}[4]{%
+\addvspace{2ex}%
+\begin{minipage}{\linewidth}%
+\TD at namealign%
+\footnotesize\textsc{{\TD at optionalname{#1}\TD at optionalname{#2}#3#4}}%
+\end{minipage}%
+\par%
+\addvspace{2ex}%
+}
+\newcommand{\tocdatafigtextprint}[1]{%
+\addvspace{2ex}%
+\begin{minipage}{\linewidth}%
+\TD at textalign%
+\footnotesize%
+\setlength{\parskip}{1.5ex}%
+\setlength{\parindent}{0em}%
+#1%
+\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}}}
+{\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}}
+\tocdata{toc}{#5 #6}%
+\IfValueTF{#2}%
+{\chapter[#2]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
+{\chapter[#3]{#3\tocdatachapprint{#4}{#5}{#6}{#7}}}%
+}%
+\ifthenelse{\equal{#5}{}}%
+{\index{#6}}%
+{\index{#6, #5}}%
 }% end of \chapterauthor
 }% end of \@ifundefined{chapter}
 
 \NewDocumentCommand{\sectionauthor}{s o m O{} m m O{}}{%
 \IfBooleanTF{#1}% star:
-{\section*{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}
+{\section*{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
 {% 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}{#5 #6}%
+\IfValueTF{#2}%
+{\section[#2]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
+{\section[#3]{#3\tocdatasecprint{#4}{#5}{#6}{#7}}}%
+}% no star
+\ifthenelse{\equal{#5}{}}%
+{\index{#6}}%
+{\index{#6, #5}}%
 }
-\ifblank{#5}
-{\index{#6}}
-{\index{#6, #5}}
+\newcommand{\TD at namealign}{\centering}
+\newcommand{\tdnamejustify}{%
+\renewcommand{\TD at namealign}{}%
 }
-
-\newcommand{\tocdatafigprint}[4]{%
-\addvspace{1ex}%
-{\centering\footnotesize\textsc{{#1 #2 #3#4}}\par}%
+\newcommand{\tdnamecenter}{%
+\renewcommand{\TD at namealign}{\centering}%
 }
-\newcommand{\tocdatafigtextprint}[1]{%
-\addvspace{1ex}%
-{\centering\footnotesize#1\par}%
+\newcommand{\tdnameleft}{%
+\renewcommand{\TD at namealign}{\raggedright}%
 }
-
-\NewDocumentCommand{\captionartist}{s o m O{} O{} m m O{}}{%
-\par\tocdatafigprint{#5}{#6}{#7}{#8}
-\ifblank{#4}{}{\par\tocdatafigtextprint{#4}}
+\newcommand{\tdnameright}{%
+\renewcommand{\TD at namealign}{\raggedleft}%
+}
+\newcommand{\TD at textalign}{\centering}
+\newcommand{\tdtextjustify}{%
+\renewcommand{\TD at textalign}{}%
+}
+\newcommand{\tdtextcenter}{%
+\renewcommand{\TD at textalign}{\centering}%
+}
+\newcommand{\tdtextleft}{%
+\renewcommand{\TD at textalign}{\raggedright}%
+}
+\newcommand{\tdtextright}{%
+\renewcommand{\TD at textalign}{\raggedleft}%
+}
+\NewDocumentCommand{\captionartist}{s o m +O{} O{} m m O{}}{%
+\par\addvspace{\medskipamount}%
+\tocdatafigprint{#5}{#6}{#7}{#8}%
+\ifthenelse{\equal{#4}{}}{}{\par\tocdatafigtextprint{#4}}%
+\unskip%
 \IfBooleanTF{#1}%
 {% starred
 \IfValueTF{#2}{\caption*[#2]{#3}}{\caption*{#3}}%
-}%
-{% no starred
+}% starred
+{% not starred
 \tocdata{lof}{#6 #7}%
 \IfValueTF{#2}{\caption[#2]{#3}}{\caption{#3}}%
-}
-\ifblank{#6}%
+}% not starred
+\ifthenelse{\equal{#6}{}}%
 {\index{#7}}%
 {\index{#7, #6}}%
 }



More information about the tex-live-commits mailing list