summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/listlbls/listlbls.sty
blob: 79f1eb33ab4b8f5606a107d98b38559f75f68166 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
%%
%% This is file `listlbls.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% listlbls.dtx  (with options: `package')
%% ----------------------------------------------------------------
%% listlbls --- Creates a list of all labels used throughout a document
%% Author:  Norbert Melzer
%% E-mail:  timmelzer@gmail.com
%% License: Released under the LaTeX Project Public License v1.3c or later
%% See:     http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{listlbls}
    [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}
\ifdefined\chapter*
  \ifllbls@numtoc
    \def\llbls@headline{%
      \chapter{List of Labels}\label{special:listoflabels}}
  \else
    \def\llbls@toccommand{\chapter*}
    \def\llbls@tocgroup{chapter}
  \fi
\else
  \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}%
    \ifllbls@totoc%
      \addcontentsline{toc}%
        {\llbls@tocgroup}%
        {\GetTranslation{llbls-listoflabels}}%
      \relax%
    \fi%
  }
\fi
\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\llbls@zz\else
\read\llbls@zz to \llbls@tmp
\expandafter\llbls@findlabel\llbls@tmp\relax\llbls@findlabel
\repeat
\ifllbls@draft
  \newcommand\listoflabels{%
    \llbls@headline%
    \the\llbls@lablist}
\else
  \let\listoflabels=\relax
\fi
%% 
%% Copyright (C) 2014 by Norbert Melzer <timmelzer@gmail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version.  The latest version of this license is in the file:
%% 
%% http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%% Norbert Melzer.
%% 
%% This work consists of the file listlbls.dtx and a Makefile.
%% Running "make" generates the derived files README, listlbls.pdf and listlbls.sty.
%% Running "make inst" installs the files in the user's TeX tree.
%% Running "make install" installs the files in the local TeX tree.
%% 
%%
%% End of file `listlbls.sty'.