summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/listlbls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-08-10 22:20:40 +0000
committerKarl Berry <karl@freefriends.org>2014-08-10 22:20:40 +0000
commit93eabd122c74d35dfd34e5d1b5e645dcdbe73998 (patch)
treec64fb4bf97d737443becc3125bb8f892e87f06d0 /Master/texmf-dist/tex/latex/listlbls
parent23023f7f597d32093136b854d157773aa6ccbe06 (diff)
listlbls
git-svn-id: svn://tug.org/texlive/trunk@34893 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/listlbls')
-rw-r--r--Master/texmf-dist/tex/latex/listlbls/listlbls.sty112
1 files changed, 77 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/listlbls/listlbls.sty b/Master/texmf-dist/tex/latex/listlbls/listlbls.sty
index c94c1be6855..79f1eb33ab4 100644
--- a/Master/texmf-dist/tex/latex/listlbls/listlbls.sty
+++ b/Master/texmf-dist/tex/latex/listlbls/listlbls.sty
@@ -15,60 +15,102 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{listlbls}
- [2014/07/27 v1.02 Creates a list of all labels used throughout a document]
-\newif\if@draft\@draftfalse
-\newif\if@totoc\@totocfalse
-\newif\if@numtoc\@numtocfalse
-\DeclareOption{draft}{\@drafttrue}
-\DeclareOption{final}{\@draftfalse}
-\DeclareOption{totoc}{\@totoctrue}
-\DeclareOption{notoc}{\@totocfalse}
-\DeclareOption{numtoc}{\@numtoctrue}
+ [2014/08/04 v1.03 Creates a list of all labels used throughout a document]
+\newif\ifllbls@draft\llbls@draftfalse
+\newif\ifllbls@totoc\llbls@totocfalse
+\newif\ifllbls@numtoc\llbls@numtocfalse
+\newif\ifllbls@nameref\llbls@namereftrue
+\DeclareOption{draft}{\llbls@drafttrue}
+\DeclareOption{final}{\llbls@draftfalse}
+\DeclareOption{totoc}{\llbls@totoctrue}
+\DeclareOption{notoc}{\llbls@totocfalse}
+\DeclareOption{numtoc}{\llbls@numtoctrue}
+\DeclareOption{nonameref}{\llbls@namereffalse}
\ProcessOptions*\relax
\RequirePackage{translations}
-\DeclareTranslationFallback{llbls-listoflabels}{List of Labels}
-\DeclareTranslationFallback{llbls-onpage}{on page}
-\DeclareTranslation{English}{llbls-listoflabels}{List of Labels}
-\DeclareTranslation{English}{llbls-onpage}{on page}
-\DeclareTranslation{German}{llbls-listoflabels}{Sprungmarkenverzeichnis}
-\DeclareTranslation{German}{llbls-onpage}{auf Seite}
-\DeclareTranslation{French}{llbls-listoflabels}{Liste des \'etiquettes}
-\DeclareTranslation{French}{llbls-onpage}{\`a la page}
+\DeclareTranslationFallback%
+ {llbls-listoflabels}%
+ {List of Labels}
+\DeclareTranslationFallback%
+ {llbls-onpage}%
+ {on page}
+\DeclareTranslation{English}%
+ {llbls-listoflabels}%
+ {List of Labels}
+\DeclareTranslation{English}%
+ {llbls-onpage}%
+ {on page}
+\DeclareTranslation{German}%
+ {llbls-listoflabels}%
+ {Sprungmarkenverzeichnis}
+\DeclareTranslation{German}%
+ {llbls-onpage}%
+ {auf Seite}
+\DeclareTranslation{French}%
+ {llbls-listoflabels}%
+ {Liste des \'etiquettes}
+\DeclareTranslation{French}%
+ {llbls-onpage}%
+ {\`a la page}
\ifdefined\chapter*
- \if@numtoc
- \def\llbls@headline{\chapter{List of Labels}\label{special:listoflabels}}
+ \ifllbls@numtoc
+ \def\llbls@headline{%
+ \chapter{List of Labels}\label{special:listoflabels}}
\else
\def\llbls@toccommand{\chapter*}
\def\llbls@tocgroup{chapter}
\fi
\else
- \if@numtoc
- \def\llbls@headline{\section{List of Labels}\label{special:listoflabels}}
+ \ifllbls@numtoc
+ \def\llbls@headline{%
+ \section{List of Labels}\label{special:listoflabels}}
\else
\def\llbls@toccommand{\section*}
\def\llbls@tocgroup{section}
\fi
\fi
\ifdefined\llbls@headline\else
- \def\llbls@headline{\llbls@toccommand{\GetTranslation{llbls-listoflabels}}\label{special:listoflabels}%
- \if@totoc\addcontentsline{toc}{\llbls@tocgroup}{\GetTranslation{llbls-listoflabels}}\relax\fi}
+ \def\llbls@headline{%
+ \llbls@toccommand{\GetTranslation{llbls-listoflabels}}%
+ \label{special:listoflabels}%
+ \ifllbls@totoc%
+ \addcontentsline{toc}%
+ {\llbls@tocgroup}%
+ {\GetTranslation{llbls-listoflabels}}%
+ \relax%
+ \fi%
+ }
\fi
-\long\def\@findlabel#1#2\@findlabel{%
- \ifx\newlabel#1\lablist\expandafter{\the\lablist\@showlabel#2}\fi}
-\def\@showlabel#1#2{%
- \par\noindent Label: \texttt{\detokenize{#1}}\dotfill\ref{#1}~\GetTranslation{llbls-onpage}~\pageref{#1}}
-\newtoks\lablist
-\newread\zz
-\immediate\openin\zz=\jobname.aux
+\ifdefined\nameref
+ \ifllbls@nameref
+ \newcommand\llbls@refs[1]{\nameref{#1}, \ref{#1}}
+ \else
+ \newcommand\llbls@refs[1]{\ref{#1}}
+ \fi
+\else
+ \newcommand\llbls@refs[1]{\ref{#1}}%
+\fi
+\long\def\llbls@findlabel#1#2\llbls@findlabel{%
+ \ifx\newlabel#1%
+ \llbls@lablist\expandafter{\the\llbls@lablist\llbls@showlabel#2}
+ \fi}
+\def\llbls@showlabel#1#2{%
+ \par\noindent Label: %
+ \texttt{\detokenize{#1}}\dotfill%
+ \llbls@refs{#1}~\GetTranslation{llbls-onpage}~\pageref{#1}%
+}
+\newtoks\llbls@lablist
+\newread\llbls@zz
+\immediate\openin\llbls@zz=\jobname.aux
\loop
-\ifeof\zz\else
-\read\zz to \tmp
-\expandafter\@findlabel\tmp\relax\@findlabel
+\ifeof\llbls@zz\else
+\read\llbls@zz to \llbls@tmp
+\expandafter\llbls@findlabel\llbls@tmp\relax\llbls@findlabel
\repeat
-\if@draft
+\ifllbls@draft
\newcommand\listoflabels{%
\llbls@headline%
- \the\lablist}
+ \the\llbls@lablist}
\else
\let\listoflabels=\relax
\fi