summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tocdata
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-08-06 22:37:51 +0000
committerKarl Berry <karl@freefriends.org>2016-08-06 22:37:51 +0000
commitba638983f65249bb548bd1441329c5d6c0fccbde (patch)
tree49cf33932f29c5429bc47e60aaf4223ce52b7ab7 /Master/texmf-dist/tex/latex/tocdata
parent1f37bf518d2c5aecf1d0f1990d0834ec5cc7ca89 (diff)
tocdata (6aug16)
git-svn-id: svn://tug.org/texlive/trunk@41810 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tocdata')
-rw-r--r--Master/texmf-dist/tex/latex/tocdata/tocdata.sty142
1 files changed, 142 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tocdata/tocdata.sty b/Master/texmf-dist/tex/latex/tocdata/tocdata.sty
new file mode 100644
index 00000000000..97ac015d5e0
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tocdata/tocdata.sty
@@ -0,0 +1,142 @@
+%%
+%% This is file `tocdata.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% tocdata.dtx (with options: `package')
+%% This is a generated file.
+%% Copyright 2016 Brian Dunn
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{tocdata}
+ [2016/07/11 v0.11 Adds author/artist to TOC entries.]
+
+
+
+\RequirePackage{xparse}
+\RequirePackage{etoolbox}
+
+\newcommand{\TD@thistocdata}{}
+
+\newcommand{\settocdata}[1]{\renewcommand{\TD@thistocdata}{#1}}
+
+\newcommand{\tocdata}[2]{%
+\@bsphack\addtocontents{#1}{\protect\settocdata{#2}}\@esphack%
+}
+\newcommand{\tocdatafont}[1]{{\normalfont\textit{\small#1}}}
+\newcommand{\TD@usetocdata}{%
+\tocdatafont{\TD@thistocdata}%
+\global\def\TD@thistocdata{}%
+}
+
+\@ifpackageloaded{titletoc}{
+
+\@ifundefined{chapter}
+{}
+{
+\titlecontents{chapter}[0em]{}{\contentslabel{2.5em}}{}{%
+\titlerule*[.75pc]{.}%
+\TD@usetocdata% <-- newly added for the tocdata package
+\contentspage}[\vspace{-.5ex}]
+}
+\titlecontents{section}[2.5em]{}{\contentslabel{2.5em}}{}{%
+\titlerule*[.75pc]{.}%
+\TD@usetocdata%
+\contentspage}[\vspace{-.5ex}]
+\titlecontents{figure}[0em]{}{\contentslabel{3em}}{}{%
+\titlerule*[1pc]{.}%
+\TD@usetocdata%
+\contentspage}[\vspace{-.5ex}]
+
+}% end of titletoc loaded
+{% titletoc is not loaded
+}% end of \@ifpackageloaded{titletoc}
+
+\@ifpackageloaded{tocloft}
+{
+\if@cfthaschapter
+\renewcommand{\cftchapleader}{\bfseries\cftdotfill{\cftchapdotsep}\TD@usetocdata}
+\renewcommand{\cftsecleader}{\normalfont\cftdotfill{\cftsecdotsep}\TD@usetocdata}
+\renewcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}\TD@usetocdata}
+\else
+\renewcommand{\cftsecleader}{\bfseries\cftdotfill{\cftsecdotsep}\TD@usetocdata}
+\renewcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}\TD@usetocdata}
+\fi
+}% end of tocloft patches
+{}% tocloft not loaded
+
+\@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}}}
+}% end of chapters-only
+\newcommand{\tocdatasecprint}[4]
+{\newline\noindent{\normalfont\normalsize\textit{\hspace*{2em}--- #1 #2 #3#4}}}
+\@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}% star:
+{\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}}}
+}
+\ifblank{#5}
+{\index{#6}}
+{\index{#6, #5}}
+}
+
+\newcommand{\tocdatafigprint}[4]{%
+\addvspace{1ex}%
+{\centering\footnotesize\textsc{{#1 #2 #3#4}}\par}%
+}
+\newcommand{\tocdatafigtextprint}[1]{%
+\addvspace{1ex}%
+{\centering\footnotesize#1\par}%
+}
+
+\NewDocumentCommand{\captionartist}{s o m O{} O{} m m O{}}{%
+\par\tocdatafigprint{#5}{#6}{#7}{#8}
+\ifblank{#4}{}{\par\tocdatafigtextprint{#4}}
+\IfBooleanTF{#1}%
+{% starred
+\IfValueTF{#2}{\caption*[#2]{#3}}{\caption*{#3}}%
+}%
+{% no starred
+\tocdata{lof}{#6 #7}%
+\IfValueTF{#2}{\caption[#2]{#3}}{\caption{#3}}%
+}
+\ifblank{#6}%
+{\index{#7}}%
+{\index{#7, #6}}%
+}
+\endinput
+%%
+%% End of file `tocdata.sty'.