%%
%% 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}
    [2023/05/24 v1.04 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}
\DeclareTranslation{Portuguese}%
  {llbls-listoflabels}%
  {Lista de R\'{o}tulos}
\DeclareTranslation{Portuguese}%
  {llbls-onpage}%
  {na p\'{a}gina}
\ifdefined\chapter
  \ifllbls@numtoc
    \def\llbls@headline{%
      \chapter{List of Labels}\label{\llbls@labelname}}
  \else
    \def\llbls@toccommand{\chapter*}
    \def\llbls@tocgroup{chapter}
  \fi
\else
  \ifllbls@numtoc
    \def\llbls@headline{%
      \section{List of Labels}\label{\llbls@labelname}}
  \else
    \def\llbls@toccommand{\section*}
    \def\llbls@tocgroup{section}
  \fi
\fi
\ifdefined\llbls@headline\else
  \def\llbls@headline{%
    \llbls@toccommand{\GetTranslation{llbls-listoflabels}}%
    \label{\llbls@labelname}%
    \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}[1][special:listoflabels]{%
    \def\llbls@labelname{#1}%
    \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'.
