summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-12-05 00:09:12 +0000
committerKarl Berry <karl@freefriends.org>2013-12-05 00:09:12 +0000
commitff27a4afbbe5da5f18f62fc47cce84e746c8ce6c (patch)
tree97d0d3b63e4cdbf1495bdd35bf68af5988bfe657
parent1f584cd4b06d66903c0ff82dcd1a7f03066a081d (diff)
lexref (4dec13)
git-svn-id: svn://tug.org/texlive/trunk@32323 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/lexref/README17
-rw-r--r--Master/texmf-dist/doc/latex/lexref/lexref.pdfbin0 -> 369319 bytes
-rw-r--r--Master/texmf-dist/doc/latex/lexref/lexref.tex631
-rw-r--r--Master/texmf-dist/tex/latex/lexref/lexref.sty433
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rw-r--r--Master/tlpkg/tlpsrc/collection-humanities.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/lexref.tlpsrc0
7 files changed, 1083 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/lexref/README b/Master/texmf-dist/doc/latex/lexref/README
new file mode 100644
index 00000000000..1078140af53
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lexref/README
@@ -0,0 +1,17 @@
+lexref 2013/12/03 v1.0 alpha
+Copyright (c) Adrien Vion. adrien[dot]vion3[at]gmail[dot]com.
+--------------------------------------------------------
+This LaTeX package is aimed at continental lawyers (especially swiss and german). It provides macros to make references to legal provisions conveniently and uniformly. It also allows the user to automatically add cited Acts to a nomenclature list and to build specific indexes for each cited Act.
+
+Please read the package documentation for further information.
+
+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 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.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Adrien Vion.
+
+This work consists of the file lexref.sty and the related information files.
+
+Please note that this work is experimental (still alpha version) and that retrocompatibility may not be ensured. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/lexref/lexref.pdf b/Master/texmf-dist/doc/latex/lexref/lexref.pdf
new file mode 100644
index 00000000000..7bba68c17a6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lexref/lexref.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/lexref/lexref.tex b/Master/texmf-dist/doc/latex/lexref/lexref.tex
new file mode 100644
index 00000000000..06e5fb07e75
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lexref/lexref.tex
@@ -0,0 +1,631 @@
+\documentclass[a4paper]{ltxdockit}[2011/03/25]
+\usepackage{btxdockit}
+\usepackage[utf8]{inputenc}
+\usepackage[english]{babel}
+\usepackage[strict]{csquotes}
+\usepackage[parfill]{parskip}
+\usepackage{tabularx}
+\usepackage{longtable}
+\usepackage{booktabs}
+\usepackage{shortvrb}
+\usepackage{pifont}
+\usepackage{libertine}
+\usepackage[scaled=0.8]{beramono}
+\usepackage{microtype}
+\lstset{basicstyle=\ttfamily,keepspaces=true}
+\KOMAoptions{numbers=noenddot}
+\addtokomafont{paragraph}{\spotcolor}
+\addtokomafont{section}{\spotcolor}
+\addtokomafont{subsection}{\spotcolor}
+\addtokomafont{subsubsection}{\spotcolor}
+\addtokomafont{descriptionlabel}{\spotcolor}
+\pretocmd{\cmd}{\sloppy}{}{}
+\pretocmd{\bibfield}{\sloppy}{}{}
+\pretocmd{\bibtype}{\sloppy}{}{}
+\makeatletter
+\patchcmd{\paragraph}
+ {3.25ex \@plus1ex \@minus.2ex}{-3.25ex\@plus -1ex \@minus -.2ex}{}{}
+\patchcmd{\paragraph}{-1em}{1.5ex \@plus .2ex}{}{}
+\makeatother
+
+\usepackage{geometry}
+\geometry {left=5cm, right=2cm, top=1.5cm, bottom=1.3cm, includeheadfoot}
+
+\usepackage[CHde]{lexref}
+
+\titlepage{%
+ title={lexref},
+ subtitle={},
+ url={},
+ author={Adrien Vion},
+ email={adrien[dot]vion3[at]gmail[dot]com},
+ revision={1.0a},
+ date={2013-12-03}}
+
+\hypersetup{%
+ pdftitle={lexref},
+ pdfsubject={},
+ pdfauthor={Adrien Vion},
+ pdfkeywords={tex, latex, legal, reference, citation, article, paragraph}}
+
+% tables
+
+\newcolumntype{T}{>{\sffamily\large\bfseries\spotcolor}c}
+\newcolumntype{H}{>{\sffamily\bfseries\spotcolor}l}
+\newcolumntype{L}{>{\raggedright\let\\=\tabularnewline}p}
+\newcolumntype{R}{>{\raggedleft\let\\=\tabularnewline}p}
+\newcolumntype{C}{>{\centering\let\\=\tabularnewline}p}
+\newcolumntype{V}{>{\raggedright\let\\=\tabularnewline\ttfamily}p}
+
+\newcommand*{\sorttablesetup}{%
+ \tablesetup
+ \ttfamily
+ \def\new{\makebox[1.25em][r]{\ensuremath\rightarrow}\,}%
+ \def\alt{\par\makebox[1.25em][r]{\ensuremath\hookrightarrow}\,}%
+ \def\note##1{\textrm{##1}}}
+
+\newcommand{\tickmarkyes}{\Pisymbol{psy}{183}}
+\newcommand{\tickmarkno}{\textendash}
+\providecommand*{\textln}[1]{#1}
+\providecommand*{\lnstyle}{}
+
+% markup and misc
+
+\setcounter{secnumdepth}{9}
+
+\makeatletter
+
+\newenvironment{nameparts}
+ {\trivlist\item
+ \tabular{@{}ll@{}}}
+ {\endtabular\endtrivlist}
+
+\newenvironment{namedelims}
+ {\trivlist\item
+ \tabularx{\textwidth}{@{}c@{=}l>{\raggedright\let\\=\tabularnewline}X@{}}}
+ {\endtabularx\endtrivlist}
+
+\newenvironment{namesample}
+ {\def\delim##1##2{\@delim{##1}{\normalfont\tiny\bfseries##2}}%
+ \def\@delim##1##2{{%
+ \setbox\@tempboxa\hbox{##1}%
+ \@tempdima=\wd\@tempboxa
+ \wd\@tempboxa=\z@
+ \box\@tempboxa
+ \begingroup\spotcolor
+ \setbox\@tempboxa\hb@xt@\@tempdima{\hss##2\hss}%
+ \vrule\lower1.25ex\box\@tempboxa
+ \endgroup}}%
+ \ttfamily\trivlist
+ \setlength\itemsep{0.5\baselineskip}}
+ {\endtrivlist}
+
+\makeatother
+
+\newcommand{\lexref}{\texttt{lexref}\xspace}
+
+\newcommand{\supra}{\emph{supra}\xspace}
+\newcommand{\infra}{\emph{infra}\xspace}
+\newcommand{\Cf}{\textnormal{Cf. }}
+\newcommand{\cf}{cf.\xspace}
+\newcommand{\GM}{\enquote}
+\newcommand{\pex}{\textnormal{par exemple}\xspace}
+\newcommand{\Pex}{\textnormal{Par exemple}\xspace}
+\newcommand{\marg}[1]{\{\texttt{#1}\}}
+\newcommand{\oarg}[1]{\texttt{[#1]}}
+
+\newcommand{\variable}[1]{$\langle$\textsl{#1}$\rangle$}
+
+
+
+\begin{document}
+\printtitlepage
+
+\begin{quote}
+This document contains information about the \lexref package. This \LaTeX{} package is aimed at continental lawyers (especially swiss and german). It provides macros to make \textbf{references to legal provisions} conveniently and uniformly. It also allows the user to automatically add cited Acts to a \textbf{nomenclature list} and to build \textbf{specific indexes} for each cited Act.\end{quote}
+
+\tableofcontents
+
+\section{Introduction}
+
+\subsection{Purposes}
+
+Lawyers have to make reference to Acts, Codes and various kind of regulations every day. \LaTeX{} contains very powerful solutions to handle bibliographies (e.g. the \texttt{biblatex} package by Philipp Lehman), but no really easy way to reference legal texts, which in fact differs a bit from citing regular documents (books, etc.). Usually, legal texts shouldn't be part of the bibliography but have instead to appear in a separate nomenclature list, which also often contains other shortcuts, etc.
+
+This package has \textbf{three purposes}:
+\begin{enumerate}
+\item First of all, this package will help you \textbf{reference conveniently and uniformly regulations} inside your text, whether in text body, brackets or footnotes. By using a simple \cs{DeclareLex} macro, you define precisely and once and for all how each Act will be referenced.
+\item Acts cited must frequently be added to a nomenclature list. When done manually, this can be painful, especially in long documents citing many different Acts. This package can do this 'dirty job' for you, ensuring that every cited Act will be \textbf{included in the nomenclature}. The package I chose to build the nomenclature is \texttt{nomencl}\footnote{\url{http://www.ctan.org/tex-archive/macros/latex/contrib/nomencl}}. The nomenclature list can also be completed with any arbitrary other shortcuts.
+\item A very useful thing for readers of legal books is an \textbf{index of every legal disposition cited}. Again, doing this manually is a tedious task; \lexref will also do this for you. The package \texttt{splitidx}\footnote{\url{http://www.ctan.org/pkg/splitindex}} is used to this end and creates a \textbf{separate subindex} for every Act.
+\end{enumerate}
+
+
+
+
+\subsection{Requirements}
+
+You need the following packages in order to use \lexref:
+\begin{marglist}
+\item[etoolbox] Used to define commands, test things, etc.
+\item[xargs] Used to define commands with optionnal arguments.
+\item[xstring] Used to test strings.
+\item[nomencl] Used to build the nomenclature list.
+\item[splitidx] Used to build the multiple indexes.
+\end{marglist}
+
+You don't need to load them; \lexref already does it.
+These packages are all part of standard \LaTeX{} distributions so there shouldn't be any problem about their loading.
+
+Splitidx uses python to process the index file, so be sure to have it installed if you want to use the indexing feature of \lexref. \texttt{splitidx} also offers alternate ways to proceed, see its documentation for further details.
+
+\subsection{Legal Status of this package}
+
+\copyright~Adrien Vion 2013.
+
+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 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.
+
+This work has the LPPL maintenance status 'maintained'.
+
+The Current Maintainer of this work is Adrien Vion.
+
+This work consists of the file lexref.sty and the related information files.
+
+Please note that this work is experimental (still alpha version) and that retrocompatibility may not be ensured.
+
+
+\section{Basic usage}
+
+\subsection{Package loading}
+
+Use the standard macro in the preamble of your .tex document:
+
+\cs{usepackage}\oarg{\variable{option list}}\marg{lexref}
+
+\variable{option list} is a comma separated list of options.
+
+\subsection{Options}\label{options}
+
+\subsubsection{Language and region selection}
+
+The package contains some language and region dependant macros, which are mostly prefixes used to cite dispositions (e.g. 'art.'). Default is english (see the annex, p. \pageref{annex}). You can use the three following options to override default settings:
+
+\begin{marglist}
+\item[CHfr] For users from french part of Switzerland. See the annex for the list of macro redefinitions.
+\item[CHde] For users from german part of Switzerland. See the annex for the list of macro redefinitions.
+\item[DE] For users from Germany. See the annex for the list of macro redefinitions.
+\end{marglist}
+
+Please note that these options are totally independent from your \texttt{babel} settings.
+
+Using another language is possible and easy: you will just have to renew the LexShortcuts (see p. \pageref{customization}).
+
+Please note that citing french laws might not properly work, mostly because of the dashes and letters contained in their disposition numbers. As a matter of fact, you shouldn't have any serious problem regarding the citation \textit{print} (as 'art.' is the same in singular or plural), but indexing won't work properly with french laws. To get a better result, the string tests applied to disposition numbers in order to determine if they're plural or singular, and to sort them within the indexes should be finetuned. This could be implemented in next versions, as well as some other options to the \cs{DeclareLex} macro.
+
+\subsubsection{Other options}
+
+The four following options can also be loaded:
+
+\begin{marglist}
+\item[nomencl] When loaded, this option adds to the nomenclature every Act, if at least one of its dispositions is cited. See p. \pageref{nomenclature} for further details.
+\item[shortcutstolist] When loaded, this option adds to the nomenclature every LexShortcut used in the document. See p. \pageref{nomenclature} for further details.
+\item[indexing] When loaded, process every citation of a disposition to an \texttt{.idx} file which also allows to build a subindex for every Act. See p. \pageref{indexing} for further details.
+\item[noprint] When loaded, the Act citation macros don't print anything but will still affect the nomenclature and the index.
+\end{marglist}
+
+
+\subsection{Declaring Acts with \cs{DeclareLex}}
+
+The first step is using the following macro for each Act you want to cite in your document.
+
+\begin{ltxsyntax}
+\cmditem{DeclareLex}{abbreviation}[Act's full name][alt option]
+\end{ltxsyntax}
+
+
+An example with swiss ZGB would be (assuming the package option CHde is set):
+
+\begin{ltxcode}
+<<\DeclareLex>>{ZGB}[Schweizerisches Zivilgesetzbuch vom 10. Dezember 1907]
+\end{ltxcode}
+
+The third argument can be either undefined (\oarg{}) or containing 'alt' (\oarg{alt}). When it is set to 'alt', the article prefixes (by default \cs{DispPrefixMain} and \cs{DispsPrefixMain}) will be overrided by alternate article prefixes (\cs{DispPrefixAlt} and \cs{DispsPrefixAlt}), in every citation of the defined Act. This is useful to cite Acts which use a different prefix. For instance, with package option CHde, \cs{DispPrefixMain} is set to 'Art.' and \cs{DispPrefixAlt} to '\S'. If you want to cite the german BGB in the same document, you can use:
+
+\begin{ltxcode}
+<<\DeclareLex>>{BGB}[B\"urgerliches Gesetzbuch][alt]
+\end{ltxcode}
+
+so that for example \cs{ZGB}\marg{2} will output 'Art. 2 ZGB', whereas \cs{BGB}\marg{154} will output '\S{} 154 BGB'.
+
+\subsection{Citing legal provisions}
+
+\subsubsection{Main macros}\label{citationmainmacros}
+
+The \cs{DeclareLex} creates for each Act the following macros:
+
+\begin{ltxsyntax}
+\cmditem{\prm{abbreviation}}{art./Art.}[al./Abs.][ch./Ziff.][let./lit.]
+\end{ltxsyntax}
+
+
+
+\begin{ltxsyntax}
+\cmditem{np\prm{abbreviation}}{art./Art.}[al./Abs.][ch./Ziff.][let./lit.]
+\end{ltxsyntax}
+
+\begin{ltxsyntax}
+\cmditem{\prm{abbreviation}ns}{art./Art.}[al./Abs.][ch./Ziff.][let./lit.]
+\end{ltxsyntax}
+
+\begin{ltxsyntax}
+\cmditem{np\prm{abbreviation}ns}{art./Art.}[al./Abs.][ch./Ziff.][let./lit.]
+\end{ltxsyntax}
+
+
+As you can see, the control sequences names of these macros depend on the \variable{abbreviation} set as first argument in \cs{DeclareLex}. In the csnames, 'np' stands for 'no prefix' and 'ns' for 'no suffix' (the suffix being the Act's name). That explains the output of the macros, for instance (assuming the package option CHde is set):
+
+% which means the diffrerence between these two macros is that the first will omit the article prefix ('560 Abs. 1 ZGB', whereas the second macro will output 'Art. 560 Abs. 1 ZGB').
+
+
+
+An example with swiss ZGB would be :
+
+\begin{ltxcode}
+<<\DeclareLex>>{ZGB}[Schweizerisches Zivilgesetzbuch vom 10. Dezember 1907]
+\end{ltxcode}
+
+which allows you to you use the following in your document
+
+\begin{tabular}{llll}
+\begin{ltxcode}
+<<\ZGB>>{2}[1]
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\npZGB>>{2}[1]
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\ZGBns>>{2}[1]
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\npZGBns>>{2}[1]
+\end{ltxcode}
+\\
+Art. 2 Abs. 1 ZGB
+&
+2 Abs. 1 ZGB
+&
+Art. 2 Abs. 1
+&
+2 Abs. 1
+\end{tabular}
+
+These variants are useful to write lists of dispositions in your text. For instance, if you type:
+
+\begin{ltxcode}
+'Siehe insbesondere <<\ZGBns>>{2}[2], <<\npZGBns>>{3}[1] und <<\npZGB>>{8}'
+\end{ltxcode}
+
+\DeclareLex{ZGB}
+you will get
+
+'Siehe insbesondere \ZGBns{2}[2], \npZGBns{3}[1] und \npZGB{8}'
+
+instead of getting
+
+'Siehe insbesondere \ZGB{2}[2], \ZGB{3}[1] und \ZGB{8}'
+
+(which is by far less elegant).
+
+An example with letters:
+
+\begin{ltxcode}
+<<\DeclareLex>>{OR}
+<<\OR>>{40a}[1][][b]
+\end{ltxcode}
+
+\DeclareLex{OR}
+will output '\OR{40a}[1][][b]'.
+
+ Note that the prefix will detect if you're citing more than one provision and will then be in plural form (for instance, \S\S {} instead of \S).
+
+\subsubsection{Additionnal macros}
+
+You should also use the following macros in the arguments of \cs{\variable{abbreviation}} and the other main macros listed in the previous section:
+
+\begin{tabular}{lllll}
+\begin{ltxcode}
+<<\sq>>
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\sqq>>
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\bis>>
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\ter>>
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\quater>>
+\end{ltxcode}
+\\
+sq.
+&
+sqq.
+&
+$^{bis}$
+&
+$^{ter}$
+&
+$^{quater}$
+\\
+\begin{ltxcode}
+<<\quinquies>>
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\sexies>>
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\septies>>
+\end{ltxcode}
+&
+\begin{ltxcode}
+<<\octies>>
+\end{ltxcode}
+
+&
+\begin{ltxcode}
+<<\nonies>>
+\end{ltxcode}
+\\
+$^{quinquies}$
+&
+$^{sexies}$
+&
+$^{septies}$
+&
+$^{octies}$
+&
+$^{nonies}$
+\end{tabular}
+
+Example (with package option CHde):
+
+\DeclareLex{FG}
+\begin{ltxcode}
+<<\DeclareLex>>{FG}[Fiktives Gesetz]
+<<\FG>>{40<<\quinquies>>}[1 <<\sqq>>]
+\end{ltxcode}
+
+Output: \FG{40\quinquies}[1 \sqq]
+
+\section{Customizing shortcuts and prefixes}\label{customization}
+
+Default shortcuts are listed in the annex (p. \pageref{annex}) and depend on the language/region options.
+
+You can fully customize them by using the following macro:
+
+\begin{ltxsyntax}
+\cmditem{RenewLexShortcut}{LexShortcut}{redefinition}[nomenclature]
+\end{ltxsyntax}
+
+Suppose you want for instance that \cs{\variable{abbreviation}} commands output full 'article' or 'articles' instead of 'art.'. You can do it this way:
+
+\begin{ltxcode}
+<<\RenewLexShortcut>>{<<\DispPrefixMain>>}{article }[]
+<<\RenewLexShortcut>>{<<\DispsPrefixMain>>}{articles }[]
+\end{ltxcode}
+
+By leaving the third argument blank, you ensure this redefined shortcut won't appear in the nomenclature list anymore.
+
+The complete list of LexShortcuts which can be renewed is in the annex.
+
+A precision about the nomenclature list title: it is controlled by the macro \cs{nomname}, which should be modified by a regular \cs{renewcommand} and not by \cs{RenewLexShortcut}.
+
+\section{Building a nomenclature list containing the cited Acts' titles}\label{nomenclature}
+
+\subsection{Basics}
+
+The following conditions must be concurrently fulfilled in order for an Act to appear in the nomenclature list:
+\begin{enumerate}
+\item the Act must have been declared with \cs{DeclareLex}
+\item the second argument of \cs{DeclareLex} (i. e. the full name of the Act) has to be defined (otherwise it makes no sense to have it in the list!)
+\item the Act must have been at least cited once in the document, using either \cs{\variable{abbreviation}} or any other main citation macro (see list above: \ref{citationmainmacros}).
+\end{enumerate}
+
+Follow these steps:
+\begin{enumerate}
+\item Activate the \texttt{nomencl} and/or \texttt{shortcutstolist} options of \lexref.
+\item Do a latex compilation. This will create a .nlo file in the directory where your .tex file is located.
+\item Open a terminal window and get to the directory where your .tex file is located (on UNIX-like systems, use the 'cd' command to do so).
+\item Type the following in the terminal (replace 'filename' by the name of the file you want to process):
+\begin{ltxcode}
+makeindex filename.nlo -s nomencl.ist -o filename.nls
+\end{ltxcode}
+
+This will create .nls file in the directory where your .tex file is located.
+\item Return to your \LaTeX{} editor and put \cs{printnomenclature} where you want the list to be printed.
+\item Run latex once again.
+\end{enumerate}
+
+For any additionnal information, you should check the \texttt{nomencl} package documentation.
+
+
+
+\subsection{Adding any other shortcut to the nomenclature list}
+
+Simply use in your .tex file
+
+\begin{ltxsyntax}
+\cmditem{nomenclature}{shortcut}{nomenclature}
+\end{ltxsyntax}
+
+for every item of the nomenclature list, then rerun the steps 2-4 and 6 of the procedure described above.
+
+\section{Indexing citations of provisions}\label{indexing}
+
+\subsection{Basics}
+
+The following conditions must concurrently be fulfilled in order for the references to be indexed:
+\begin{enumerate}
+\item the Act must have been declared with \cs{DeclareLex}
+\item the Act must have been at least cited once in the document, using either \cs{\variable{abbreviation}}, any other main citation macro (see list above: \ref{citationmainmacros}) or \cs{idx\variable{abbreviation}}
+\end{enumerate}
+
+Follow these steps:
+\begin{enumerate}
+\item Activate the \texttt{indexing} option of \lexref.
+\item Do a latex compilation. This will create a .idx file in the directory where your .tex file is located.
+\item Open a terminal window and run the following script (replace 'filename' by the name of the file you want to process):
+
+\begin{ltxcode}
+splitindex.pl filename.idx
+\end{ltxcode}
+
+It may be a bit more complicated, e. g. you'll have to locate the splitindex.pl in your texlive directory and then, in the terminal, run the script on the file specifying its absolute path, etc.
+
+This script will create a new .idx file for each different Act cited in the document, follwing this syntax \variable{filename}-\variable{abbreviation}.idx
+
+\item get to the directory where your .tex file is located (on UNIX-like systems, use the 'cd' command to do so).
+
+\item run the following command in the terminal, once for every different abbreviation (replace 'filename' and 'abbreviation' by the one you actually use)
+
+\begin{ltxcode}
+makeindex filename-abbreviation.idx
+\end{ltxcode}
+
+This will create .ilg and .ind files for every abbreviation.
+
+\item Return to your \LaTeX{} editor and insert the following macros where you want your index printed:
+
+\begin{ltxcode}
+<<\pagebreak>>
+\section*{Cited Acts index}% Modify this title as you wish
+<<\twocolumn>>
+<<\printsubindex*>>
+\end{ltxcode}
+
+You can finetune the output by using a \cs{printsubindex}\oarg{\variable{abbreviation}} macro for every Act appearing in the index, rather than using \cs{printsubindex*}. This will also allow you to print other indexes than the Acts' index (general index, authors index, etc.). See the \texttt{splitidx} manual for further information.
+
+\item Run latex once again.
+\end{enumerate}
+
+
+
+\subsection{Indexing without printing}
+
+If you want to do this globally, you should consider the \texttt{noprint} option (see p. \pageref{options}).
+
+If, for any reason, you want to create an index entry at a given location in your file without having any printed output there, you can use
+
+\begin{ltxsyntax}
+\cmditem{idx\prm{abbreviation}}{art./Art.}[par./al./Abs.][nr./ch./Ziff.][let./lit.]
+\end{ltxsyntax}
+
+The \variable{abbreviation} is the first argument used in \cs{DeclareLex}.
+
+\section{Annex: Default shortcuts (depending on language)}\label{annex}
+
+\begin{table}[h!]\label{}
+\tablesetup
+\caption{Default settings (english)}
+\begin{tabularx}{\textwidth}{@{}p{4cm}@{}p{3cm}@{}X@{}}
+\toprule
+\multicolumn{1}{@{}H}{macro} &
+\multicolumn{1}{@{}H}{output} &
+\multicolumn{1}{@{}H}{nomenclature} \\
+\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule{3-3}
+\cs{DispPrefixMain} & art. & article(s) \\ %\hline
+\cs{DispsPrefixMain} & art. & \\ %\hline
+\cs{DispPrefixAlt} &\S{} & \\ %\hline
+\cs{DispsPrefixAlt} & \S\S{} & \\ %\hline
+\cs{SubPrefix} & par. & paragraph(s)\\ %\hline
+\cs{SubSubPrefixNumber} & nr. & number(s)\\ %\hline
+\cs{SubSubPrefixLetter} & let. & letter(s)\\ %\hline
+\cs{sq} & sq. & sequiturque\\ %\hline
+\cs{sqq} & sqq. & sequunturque\\ %\hline
+\cs{nomname} & Nomenclature & \\ %\hline
+\bottomrule
+\end{tabularx}
+\end{table}
+
+\begin{table}[h!]\label{}
+\tablesetup
+\caption{CHfr settings}
+\begin{tabularx}{\textwidth}{@{}p{4cm}@{}p{3cm}@{}X@{}}
+\toprule
+\multicolumn{1}{@{}H}{macro} &
+\multicolumn{1}{@{}H}{output} &
+\multicolumn{1}{@{}H}{nomenclature} \\
+\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule{3-3}
+\cs{DispPrefixMain} & art. & article(s) \\ %\hline
+\cs{DispsPrefixMain} & art. & \\ %\hline
+\cs{DispPrefixAlt} &\S{} & \\ %\hline
+\cs{DispsPrefixAlt} & \S\S{} & \\ %\hline
+\cs{SubPrefix} & al. & alin\'ea(s)\\ %\hline
+\cs{SubSubPrefixNumber} & ch. & chiffre(s)\\ %\hline
+\cs{SubSubPrefixLetter} & let. & lettre(s)\\ %\hline
+\cs{sq} & s. & et suivant(e)\\ %\hline
+\cs{sqq} & ss & et suivant(e)s\\ %\hline
+\cs{nomname} & Abr\'eviations & \\ %\hline
+\bottomrule
+\end{tabularx}
+\end{table}
+
+\begin{table}[h!]\label{}
+\tablesetup
+\caption{CHde settings}
+\begin{tabularx}{\textwidth}{@{}p{4cm}@{}p{3cm}@{}X@{}}
+\toprule
+\multicolumn{1}{@{}H}{macro} &
+\multicolumn{1}{@{}H}{output} &
+\multicolumn{1}{@{}H}{nomenclature} \\
+\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule{3-3}
+\cs{DispPrefixMain} & Art. & Artikel \\ %\hline
+\cs{DispsPrefixMain} & Art. & \\ %\hline
+\cs{DispPrefixAlt} &\S{} & \\ %\hline
+\cs{DispsPrefixAlt} & \S\S{} & \\ %\hline
+\cs{SubPrefix} & Abs. & Absatz, -\"{ }e\\ %\hline
+\cs{SubSubPrefixNumber} & Ziff. & Ziffer(n)\\ %\hline
+\cs{SubSubPrefixLetter} & lit. & litera\\ %\hline
+\cs{sq} & f. & und die folgende\\ %\hline
+\cs{sqq} & ff. & und die folgenden\\ %\hline
+\cs{nomname} & Abk\"urzungen & \\ %\hline
+\bottomrule
+\end{tabularx}
+\end{table}
+
+\begin{table}[h!]\label{}
+\tablesetup
+\caption{DE settings}
+\begin{tabularx}{\textwidth}{@{}p{4cm}@{}p{3cm}@{}X@{}}
+\toprule
+\multicolumn{1}{@{}H}{macro} &
+\multicolumn{1}{@{}H}{output} &
+\multicolumn{1}{@{}H}{nomenclature} \\
+\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule{3-3}
+\cs{DispPrefixMain} &\S{} & \\ %\hline
+\cs{DispsPrefixMain} & \S\S{} & \\ %\hline
+\cs{DispPrefixAlt} & Art. & Artikel \\ %\hline
+\cs{DispsPrefixAlt} & Art. & \\ %\hline
+\cs{SubPrefix} & Abs. & Absatz, -\"{ }e\\ %\hline
+\cs{SubSubPrefixNumber} & Ziff. & Ziffer(n)\\ %\hline
+\cs{SubSubPrefixLetter} & lit. & litera\\ %\hline
+\cs{sq} & f. & und die folgende\\ %\hline
+\cs{sqq} & ff. & und die folgenden\\ %\hline
+\cs{nomname} & Abk\"urzungen & \\ %\hline
+\bottomrule
+\end{tabularx}
+\end{table}
+
+\vfill {~}
+\end{document}
diff --git a/Master/texmf-dist/tex/latex/lexref/lexref.sty b/Master/texmf-dist/tex/latex/lexref/lexref.sty
new file mode 100644
index 00000000000..3a91e00d712
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/lexref/lexref.sty
@@ -0,0 +1,433 @@
+%------------ identification --------------
+\ProvidesPackage{lexref}[2013/12/03 v1.0a]%
+\NeedsTeXFormat{LaTeX2e}%
+%------------ package loading --------------
+\RequirePackage{etoolbox}%
+\RequirePackage{xargs}%
+\RequirePackage{xstring}%
+\RequirePackage{nomencl}%
+\RequirePackage{splitidx}%
+%------------ initial code --------------
+% Toggle and counter creation
+\newtoggle{lexnoprint}
+\newtoggle{lexindexing}
+\newtoggle{lexnomencl}
+\newtoggle{lexpluralform}
+\newtoggle{lexaltoverride}
+\newtoggle{lexshortcutstolist}
+\newtoggle{lexrefCHfr}
+\newtoggle{lexrefCHde}
+\newtoggle{lexrefDE}
+\newcounter{lexcitecountinteger}
+% Error messages setting
+\newcommand{\lexcite@err@invalidthirdarg@DeclareLex}{\PackageError{lexref}{%
+Third argument of \protect\DeclareLex\space must
+be either 'alt' or nothing. Check your \protect\DeclareCite\space macros}}
+%------------ declaration of options --------------
+\DeclareOption{noprint}{\toggletrue{lexnoprint}}
+\DeclareOption{indexing}{\toggletrue{lexindexing}\makeindex}
+\DeclareOption{nomencl}{\toggletrue{lexnomencl}\robustify{\nomenclature}\makenomenclature}
+\DeclareOption{shortcutstolist}{\toggletrue{lexshortcutstolist}\makenomenclature}
+\DeclareOption{CHfr}{\toggletrue{lexrefCHfr}}
+\DeclareOption{CHde}{\toggletrue{lexrefCHde}}
+\DeclareOption{DE}{\toggletrue{lexrefDE}}
+%------------ execution of options --------------
+\ProcessOptions
+%------------ main code --------------
+% DEFINITION OF LITERAL PREFIXES AND SHORTCUTS
+\newcommandx{\NewLexShortcut}[3][3]{%
+\ifdef{#1}{% This test makes sure an already defined command is overrided, ensuring the nomenclature tests will work properly
+\renewrobustcmd{#1}{#2%
+\iftoggle{lexshortcutstolist}{% Entry in nomenclature, if option activated and #3 defined.
+ \ifstrempty{#3}%
+ {}%
+ {\ifcsdef{nomalreadydef#2}% Nomencl crashes if the same act is already passed to \nomenclature in another page, so this test ensures it won't be passed more than once
+ {}%
+ {%
+ \nomenclature{#2}{#3}%
+ \expandafter\newcommand\csname nomalreadydef#2\endcsname\relax%
+ }%
+ }%
+ }%
+ {}%
+}}%
+{%
+\newrobustcmd{#1}{#2%
+\iftoggle{lexshortcutstolist}{% Entry in nomenclature, if option activated and #3 defined.
+ \ifstrempty{#3}%
+ {}%
+ {\ifcsdef{nomalreadydef#2}% Nomencl crashes if the same act is already passed to \nomenclature in another page, so this test ensures it won't be passed more than once
+ {}%
+ {%
+ \nomenclature{#2}{#3}%
+ \expandafter\newcommand\csname nomalreadydef#2\endcsname\relax%
+ }%
+ }%
+ }%
+ {}%
+}}%
+}%
+% Following shortcuts may be redefined using \RenewLexShortcut
+\newcommandx{\RenewLexShortcut}[3][3]{%
+\renewrobustcmd{#1}{#2%
+\iftoggle{lexshortcutstolist}{% Entry in nomenclature, if option activated and #3 defined.
+ \ifstrempty{#3}%
+ {}%
+ {\ifcsdef{nomalreadydef#2}% Nomencl crashes if the same act is already passed to \nomenclature in another page, so this test ensures it won't be passed more than once
+ {}%
+ {%
+ \nomenclature{#2}{#3}%
+ \expandafter\newcommand\csname nomalreadydef#2\endcsname\relax%
+ }%
+ }%
+ }%
+ {}%
+}}
+% Default shortcuts: english
+\NewLexShortcut{\DispPrefixMain}{art.}[article(s)]%
+\NewLexShortcut{\DispsPrefixMain}{art.}%
+\NewLexShortcut{\DispPrefixAlt}{\S}%
+\NewLexShortcut{\DispsPrefixAlt}{\S\S}%
+\NewLexShortcut{\SubPrefix}{par.}[paragraph(s)]
+\NewLexShortcut{\SubSubPrefixNumber}{nr.}[number(s)]
+\NewLexShortcut{\SubSubPrefixLetter}{let.}[letter(s)]
+\NewLexShortcut{\sq}{sq.}[sequiturque]
+\NewLexShortcut{\sqq}{sqq.}[sequunturque]
+\NewLexShortcut{\analog}{by an.}[by analogy]
+% french shortcuts
+\iftoggle{lexrefCHfr}{%
+\RenewLexShortcut{\DispPrefixMain}{art.}[article(s)]%
+\RenewLexShortcut{\DispsPrefixMain}{art.}%
+\RenewLexShortcut{\DispPrefixAlt}{\S}%
+\RenewLexShortcut{\DispsPrefixAlt}{\S\S}%
+\RenewLexShortcut{\SubPrefix}{al.}[alin\'ea(s)]
+\RenewLexShortcut{\SubSubPrefixNumber}{ch.}[chiffre(s)]
+\RenewLexShortcut{\SubSubPrefixLetter}{let.}[lettre(s)]
+\RenewLexShortcut{\sq}{s.}[et suivant(e)]
+\RenewLexShortcut{\sqq}{ss}[et suivant(e)s]
+\RenewLexShortcut{\analog}{p. an.}[par analogie]
+\renewrobustcmd{\nomname}{Abr\'eviations}
+}{}
+% german CH shortcuts
+\iftoggle{lexrefCHde}{%
+\RenewLexShortcut{\DispPrefixMain}{Art.}[Artikel]%
+\RenewLexShortcut{\DispsPrefixMain}{Art.}%
+\RenewLexShortcut{\DispPrefixAlt}{\S}%
+\RenewLexShortcut{\DispsPrefixAlt}{\S\S}%
+\RenewLexShortcut{\SubPrefix}{Abs.}[Absatz, -\"{ }e]
+\RenewLexShortcut{\SubSubPrefixNumber}{Ziff.}[Ziffer(n)]
+\RenewLexShortcut{\SubSubPrefixLetter}{lit.}[litera]
+\RenewLexShortcut{\sq}{f.}[und die folgende]
+\RenewLexShortcut{\sqq}{ff.}[und die folgenden]
+\RenewLexShortcut{\analog}{analog}
+\renewrobustcmd{\nomname}{Abk\"urzungen}
+}{}
+% german DE shortcuts
+\iftoggle{lexrefDE}{%
+\RenewLexShortcut{\DispPrefixMain}{\S}%
+\RenewLexShortcut{\DispsPrefixMain}{\S\S}%
+\RenewLexShortcut{\DispPrefixAlt}{Art.}[Artikel]%
+\RenewLexShortcut{\DispsPrefixAlt}{Art.}%
+\RenewLexShortcut{\SubPrefix}{Abs.}[Absatz, -\"{ }e]
+\RenewLexShortcut{\SubSubPrefixNumber}{Ziff.}[Ziffer(n)]
+\RenewLexShortcut{\SubSubPrefixLetter}{lit.}[litera]
+\RenewLexShortcut{\sq}{f.}[und die folgende]
+\RenewLexShortcut{\sqq}{ff.}[und die folgenden]
+\RenewLexShortcut{\analog}{analog}
+\renewrobustcmd{\nomname}{Abk\"urzungen}
+}{}
+% Latin shortcuts
+\NewLexShortcut{\bis}{$^{bis}$}
+\NewLexShortcut{\ter}{$^{ter}$}
+\NewLexShortcut{\quater}{$^{quater}$}
+\NewLexShortcut{\quinquies}{$^{quinquies}$}
+\NewLexShortcut{\sexies}{$^{sexies}$}
+\NewLexShortcut{\septies}{$^{septies}$}
+\NewLexShortcut{\octies}{$^{octies}$}
+\NewLexShortcut{\nonies}{$^{nonies}$}
+
+% FRONT-END USER INTERFACE
+
+ % #1 = Act abbr.
+ % #2 = Act full name
+ % #3 = alt option
+
+\newcommandx{\DeclareLex}[3][2,3]{%
+\protecting{%
+% 1) Creation of \newindex, if needed
+\iftoggle{lexindexing}{\newindex[#2]{#1}}{}%
+% 2) Creation of \#1 command
+\expandafter\newcommandx\csname#1\endcsname[4][2,3,4]{%
+\ifstrempty{#3}{\togglefalse{lexaltoverride}}{\ifstrequal{#3}{alt}{\toggletrue{lexaltoverride}}{\lexcite@err@invalidthirdarg@DeclareLex}}%Checking whether #3 is blank or set to 'alt', else: error
+\iftoggle{lexnoprint}{}{\LexRef{#1}{##1}[##2][##3][##4]}% Printing, unless noprint option activated
+\iftoggle{lexnomencl}{% Entry in nomenclature, if option activated and #2 defined.
+ \ifstrempty{#2}%
+ {}%
+ {\ifcsdef{nomalreadydef#1}% Nomencl crashes if the same act is already passed to \nomenclature in another page, so this test ensures it won't be passed more than once
+ {}%
+ {%
+ \nomenclature{#1}{#2}%
+ \expandafter\newcommand\csname nomalreadydef#1\endcsname\relax}%
+ }%
+ }%
+ {}%
+\iftoggle{lexindexing}{\LexIndex{#1}{##1}[##2][##3][##4]}{}% Indexing, if option activated
+}%
+% 3) Creation of \#1ns command
+\expandafter\newcommandx\csname #1ns\endcsname[4][2,3,4]{%
+\ifstrempty{#3}{\togglefalse{lexaltoverride}}{\ifstrequal{#3}{alt}{\toggletrue{lexaltoverride}}{\lexcite@err@invalidthirdarg@DeclareLex}}%Checking whether #3 is blank or set to 'alt', else: error
+\iftoggle{lexnoprint}{}{\LexRefns{#1}{##1}[##2][##3][##4]}% Printing, unless noprint option activated
+\iftoggle{lexindexing}{\LexIndex{#1}{##1}[##2][##3][##4]}{}% Indexing, if option activated
+}%
+% 4) Creation of \np#1 command
+\expandafter\newcommandx\csname np#1\endcsname[4][2,3,4]{%
+\iftoggle{lexnoprint}{}{\npLexRef{#1}{##1}[##2][##3][##4]}% Printing, unless noprint option activated
+\iftoggle{lexnomencl}{% Entry in nomenclature, if option activated and #2 defined.
+ \ifstrempty{#2}%
+ {}%
+ {\ifcsdef{nomalreadydef#1}% Nomencl crashes if the same act is already passed to \nomenclature in another page, so this test ensures it won't be passed more than once
+ {}%
+ {%
+ \nomenclature{#1}{#2}%
+ \expandafter\newcommand\csname nomalreadydef#1\endcsname\relax}%
+ }%
+ }%
+ {}%
+\iftoggle{lexindexing}{\LexIndex{#1}{##1}[##2][##3][##4]}{}% Indexing, if option activated
+}%
+% 5) Creation of \np#1ns command
+\expandafter\newcommandx\csname np#1ns\endcsname[4][2,3,4]{%
+\iftoggle{lexnoprint}{}{\npLexRefns{#1}{##1}[##2][##3][##4]}% Printing, unless noprint option activated
+\iftoggle{lexindexing}{\LexIndex{#1}{##1}[##2][##3][##4]}{}% Indexing, if option activated
+}%
+% 6) Creation of \idx#1 command
+\iftoggle{lexindexing}{\expandafter\newcommandx\csname idx#1\endcsname[4][2,3,4]{%
+\LexIndex{#1}{##1}[##2][##3][##4]}}{}% Indexing, if option activated
+}}
+
+% PRINTING MACROS
+
+\newrobustcmd{\LexRefPrefixTests}[1]{%
+% Testing if singular or plural profix needed
+\IfSubStr{#1}{\sq}% First testing if string contains \sq or \sqq
+ {\toggletrue{lexpluralform}}% if yes, plural form
+ {% else
+ \IfSubStr{#1}{-}% testing if string contains a dash
+ {\toggletrue{lexpluralform}}% if yes, plural form
+ {% else
+ \IfSubStr{#1}{,}% testing if string contains a comma
+ {\toggletrue{lexpluralform}}% if yes, plural form
+ {\togglefalse{lexpluralform}}% else singular form
+ }%
+ }%
+% Printing MAIN or ALT Prefix depending on lexaltoverride, and singular/plural depending on previous test
+\iftoggle{lexpluralform}%
+ {\iftoggle{lexaltoverride}%
+ {\DispsPrefixAlt}%
+ {\DispsPrefixMain}%
+ }%
+ {\iftoggle{lexaltoverride}%
+ {\DispPrefixAlt}%
+ {\DispPrefixMain}%
+ }%
+}
+
+% Macro with prefix and suffix
+\newcommandx{\LexRef}[5][3,4,5]{%
+\LexRefPrefixTests{#2} %
+#2%
+\ifstrempty{#3}{}{ \SubPrefix{} #3}%
+\ifstrempty{#4}{}{ \SubSubPrefixNumber{} #4}%
+\ifstrempty{#5}{}{ \SubSubPrefixLetter{} #5}%
+{} #1%
+}
+
+% Macro with prefix, without suffix
+\newcommandx{\LexRefns}[5][3,4,5]{%
+\LexRefPrefixTests{} %
+#2%
+\ifstrempty{#3}{}{ \SubPrefix{} #3}%
+\ifstrempty{#4}{}{ \SubSubPrefixNumber{} #4}%
+\ifstrempty{#5}{}{ \SubSubPrefixLetter{} #5}%
+}
+
+% Macro without prefix, with suffix
+\newcommandx{\npLexRef}[5][3,4,5]{%
+#2%
+\ifstrempty{#3}{}{ \SubPrefix{} #3}%
+\ifstrempty{#4}{}{ \SubSubPrefixNumber{} #4}%
+\ifstrempty{#5}{}{ \SubSubPrefixLetter{} #5}%
+{} #1%
+}
+
+% Macro without prefix nor suffix
+\newcommandx{\npLexRefns}[5][3,4,5]{%
+#2%
+\ifstrempty{#3}{}{ \SubPrefix{} #3}%
+\ifstrempty{#4}{}{ \SubSubPrefixNumber{} #4}%
+\ifstrempty{#5}{}{ \SubSubPrefixLetter{} #5}%
+}
+
+
+% INDEXING MACRO
+
+\newcommandx{\LexIndex}[5][3,4,5]{%
+% 1) First cleaning
+\noexpandarg%
+\IfSubStr{#2}{\sq}% Test \sq
+ {\StrBefore{#2}{\sq}[\lexciteindextempone]\fullexpandarg\StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]\noexpandarg}% if true, take everything before and remove the space
+ {% else
+ \IfSubStr{#2}{\sqq}% Test \sqq
+ {\StrBefore{#2}{\sqq}[\lexciteindextempone]\fullexpandarg\StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]\noexpandarg}% if true, take everything before and remove the space
+ {%
+ \IfSubStr{#2}{-}% Test dash
+ {\StrBefore{#2}{-}[\lexciteindextempone]}% if true, take everything before
+ {\ifdef{\lexciteindextempone}{\renewcommand{\lexciteindextempone}{#2}}{\newcommand{\lexciteindextempone}{#2}}}
+ }%
+ }% else take everything
+% 2) Second cleaning
+\fullexpandarg%
+\IfInteger{\lexciteindextempone}% Test if integer
+ {}% if true do nothing
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}% if true do nothing
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in stringe
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {% else
+ \StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]% delete last char in string
+ \IfInteger{\lexciteindextempone}
+ {}%
+ {}%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+% 3) Counting the cleaned integer
+\StrLen{\lexciteindextempone}[\lexciteindextemptwo]%
+% 4) Proper indexation, sorting (1, 10, 100 or 1000) depending of integer length (1, 2, 3, 4) and of opt args of each entry
+\ifdefstring{\lexciteindextemptwo}{1}% integer length = 1
+ {\ifboolexpr{% if #3, #4 and #5 are defined
+ not test {\ifstrempty{#3}}%
+ and%
+ not test {\ifstrempty{#4}}%
+ and%
+ not test {\ifstrempty{#5}}%
+ }%
+ {\sindex[#1]{1@#1 #2!-- \SubPrefix{} #3}}% index only takes #3 as subentry
+ {%
+ \sindex[#1]{1@#1 #2% else: indexing everything
+ \ifstrempty{#3}{}{!-- \SubPrefix{} #3}%
+ \ifstrempty{#4}{}{!-- \SubSubPrefixNumber{} #4}%
+ \ifstrempty{#5}{}{!-- \SubSubPrefixLetter{} #5}%
+ }}%
+ }%
+ {\ifdefstring{\lexciteindextemptwo}{2}% integer length = 2
+ {\ifboolexpr{% if #3, #4 and #5 are defined
+ not test {\ifstrempty{#3}}%
+ and%
+ not test {\ifstrempty{#4}}%
+ and%
+ not test {\ifstrempty{#5}}%
+ }%
+ {\sindex[#1]{10@#1 #2!-- \SubPrefix{} #3}}% index only takes #3 as subentry
+ {%
+ \sindex[#1]{10@#1 #2% else: indexing everything
+ \ifstrempty{#3}{}{!-- \SubPrefix{} #3}%
+ \ifstrempty{#4}{}{!-- \SubSubPrefixNumber{} #4}%
+ \ifstrempty{#5}{}{!-- \SubSubPrefixLetter{} #5}%
+ }}%
+ }%
+ {\ifdefstring{\lexciteindextemptwo}{3}% integer length = 3
+ {\ifboolexpr{% if #3, #4 and #5 are defined
+ not test {\ifstrempty{#3}}%
+ and%
+ not test {\ifstrempty{#4}}%
+ and%
+ not test {\ifstrempty{#5}}%
+ }%
+ {\sindex[#1]{100@#1 #2!-- \SubPrefix{} #3}}% index only takes #3 as subentry
+ {%
+ \sindex[#1]{100@#1 #2% else: indexing everything
+ \ifstrempty{#3}{}{!-- \SubPrefix{} #3}%
+ \ifstrempty{#4}{}{!-- \SubSubPrefixNumber{} #4}%
+ \ifstrempty{#5}{}{!-- \SubSubPrefixLetter{} #5}%
+ }}%
+ }%
+ {\ifdefstring{\lexciteindextemptwo}{4}% integer length = 4
+ {\ifboolexpr{% if #3, #4 and #5 are defined
+ not test {\ifstrempty{#3}}%
+ and%
+ not test {\ifstrempty{#4}}%
+ and%
+ not test {\ifstrempty{#5}}%
+ }%
+ {\sindex[#1]{1000@#1 #2!-- \SubPrefix{} #3}}% index only takes #3 as subentry
+ {%
+ \sindex[#1]{1000@#1 #2% else: indexing everything
+ \ifstrempty{#3}{}{!-- \SubPrefix{} #3}%
+ \ifstrempty{#4}{}{!-- \SubSubPrefixNumber{} #4}%
+ \ifstrempty{#5}{}{!-- \SubSubPrefixLetter{} #5}%
+ }}%
+ }%
+ {\ifdefstring{\lexciteindextemptwo}{5}% integer length = 5
+ {\ifboolexpr{% if #3, #4 and #5 are defined
+ not test {\ifstrempty{#3}}%
+ and%
+ not test {\ifstrempty{#4}}%
+ and%
+ not test {\ifstrempty{#5}}%
+ }%
+ {\sindex[#1]{10000@#1 #2!-- \SubPrefix{} #3}}% index only takes #3 as subentry
+ {%
+ \sindex[#1]{10000@#1 #2% else: indexing everything
+ \ifstrempty{#3}{}{!-- \SubPrefix{} #3}%
+ \ifstrempty{#4}{}{!-- \SubSubPrefixNumber{} #4}%
+ \ifstrempty{#5}{}{!-- \SubSubPrefixLetter{} #5}%
+ }}%
+ }%
+ {}%
+ }%
+ }%
+ }%
+ }%
+}
+
+\endinput \ No newline at end of file
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index f5180be489a..523b95f37e7 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -269,7 +269,7 @@ my @TLP_working = qw(
latexmk latexmp latexpand
lato layaureo layouts lazylist
lcd lcg lcyw leading leaflet lecturer ledmac leftidx leipzig lengthconvert
- lettre lettrine levy lewis lexikon lfb lgreek lh lhcyr lhelp
+ lettre lettrine levy lewis lexikon lexref lfb lgreek lh lhcyr lhelp
libertine
libgreek librarian librebaskerville librecaslon
libris lilyglyphs limap linearA linegoal
diff --git a/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc b/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc
index d69d263e719..6469fe89999 100644
--- a/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-humanities.tlpsrc
@@ -28,6 +28,7 @@ depend jurarsp
depend ledmac
depend leipzig
depend lexikon
+depend lexref
depend lineno
depend linguex
depend liturg
diff --git a/Master/tlpkg/tlpsrc/lexref.tlpsrc b/Master/tlpkg/tlpsrc/lexref.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/lexref.tlpsrc