summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lexref/lexref.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/lexref/lexref.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lexref/lexref.sty27
1 files changed, 20 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/lexref/lexref.sty b/Master/texmf-dist/tex/latex/lexref/lexref.sty
index 3a91e00d712..ed804a95500 100644
--- a/Master/texmf-dist/tex/latex/lexref/lexref.sty
+++ b/Master/texmf-dist/tex/latex/lexref/lexref.sty
@@ -1,5 +1,5 @@
%------------ identification --------------
-\ProvidesPackage{lexref}[2013/12/03 v1.0a]%
+\ProvidesPackage{lexref}[2014/01/21 v1.0.1a]%
\NeedsTeXFormat{LaTeX2e}%
%------------ package loading --------------
\RequirePackage{etoolbox}%
@@ -7,8 +7,10 @@
\RequirePackage{xstring}%
\RequirePackage{nomencl}%
\RequirePackage{splitidx}%
+\RequirePackage{ifthen}
+\RequirePackage{stringstrings}
%------------ initial code --------------
-% Toggle and counter creation
+% Toggle creation
\newtoggle{lexnoprint}
\newtoggle{lexindexing}
\newtoggle{lexnomencl}
@@ -27,7 +29,7 @@ be either 'alt' or nothing. Check your \protect\DeclareCite\space macros}}
\DeclareOption{noprint}{\toggletrue{lexnoprint}}
\DeclareOption{indexing}{\toggletrue{lexindexing}\makeindex}
\DeclareOption{nomencl}{\toggletrue{lexnomencl}\robustify{\nomenclature}\makenomenclature}
-\DeclareOption{shortcutstolist}{\toggletrue{lexshortcutstolist}\makenomenclature}
+\DeclareOption{shortcutstolist}{\toggletrue{lexshortcutstolist}\makenomenclature}%\robustify{\nomenclature}}
\DeclareOption{CHfr}{\toggletrue{lexrefCHfr}}
\DeclareOption{CHde}{\toggletrue{lexrefCHde}}
\DeclareOption{DE}{\toggletrue{lexrefDE}}
@@ -110,7 +112,7 @@ be either 'alt' or nothing. Check your \protect\DeclareCite\space macros}}
}{}
% german CH shortcuts
\iftoggle{lexrefCHde}{%
-\RenewLexShortcut{\DispPrefixMain}{Art.}[Artikel]%
+\RenewLexShortcut{\DispPrefixMain}{Art.}[Artikel(n)]%
\RenewLexShortcut{\DispsPrefixMain}{Art.}%
\RenewLexShortcut{\DispPrefixAlt}{\S}%
\RenewLexShortcut{\DispsPrefixAlt}{\S\S}%
@@ -126,7 +128,7 @@ be either 'alt' or nothing. Check your \protect\DeclareCite\space macros}}
\iftoggle{lexrefDE}{%
\RenewLexShortcut{\DispPrefixMain}{\S}%
\RenewLexShortcut{\DispsPrefixMain}{\S\S}%
-\RenewLexShortcut{\DispPrefixAlt}{Art.}[Artikel]%
+\RenewLexShortcut{\DispPrefixAlt}{Art.}[Artikel(n)]%
\RenewLexShortcut{\DispsPrefixAlt}{Art.}%
\RenewLexShortcut{\SubPrefix}{Abs.}[Absatz, -\"{ }e]
\RenewLexShortcut{\SubSubPrefixNumber}{Ziff.}[Ziffer(n)]
@@ -209,7 +211,7 @@ be either 'alt' or nothing. Check your \protect\DeclareCite\space macros}}
\newrobustcmd{\LexRefPrefixTests}[1]{%
% Testing if singular or plural profix needed
-\IfSubStr{#1}{\sq}% First testing if string contains \sq or \sqq
+\IfSubStr{#1}{\sq}% First testing if string contains \psq or \psqq
{\toggletrue{lexpluralform}}% if yes, plural form
{% else
\IfSubStr{#1}{-}% testing if string contains a dash
@@ -282,11 +284,22 @@ be either 'alt' or nothing. Check your \protect\DeclareCite\space macros}}
{%
\IfSubStr{#2}{-}% Test dash
{\StrBefore{#2}{-}[\lexciteindextempone]}% if true, take everything before
- {\ifdef{\lexciteindextempone}{\renewcommand{\lexciteindextempone}{#2}}{\newcommand{\lexciteindextempone}{#2}}}
+ {\ifdef{\lexciteindextempone}{\renewcommand{\lexciteindextempone}{#2}}{\newcommand{\lexciteindextempone}{#2}}}%
}%
}% else take everything
% 2) Second cleaning
\fullexpandarg%
+%\let\lexciteindextemponenew\lexciteindextempone
+%\renewcommand{\lexciteindextempone}{\noblanks{\lexciteindextemponenew}}%
+%%%%%% Remplacer l'escalier ci-dessous par un \loop (Knuth, pp. 217 ss)
+% \loop A \if B \repeat
+%\IfInteger{\lexciteindextempone}% Test if integer
+% {}% if true do nothing
+% {\loop\StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]\if\ifboolexpr{not test {\IfInteger{\lexciteindextempone}}}{}{}\repeat}% else
+%% Alternativement: utiliser \whiledo du package ifthen
+%\IfInteger{\lexciteindextempone}{\setcounter{lexcitecountinteger}{0}}{}%If integer, set counter to zero
+%\whiledo{\value{lexcitecountinteger}>0}{\StrGobbleRight{\lexciteindextempone}{1}[\lexciteindextempone]\IfInteger{\lexciteindextempone}{\setcounter{lexcitecountinteger}{0}}{}}
+%%%%%%% If the counter is greater than zero (= macro isn't an integer), remove last char and set counter to zero if macro is now an integer
\IfInteger{\lexciteindextempone}% Test if integer
{}% if true do nothing
{% else