summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-22 01:15:20 +0000
committerKarl Berry <karl@freefriends.org>2014-01-22 01:15:20 +0000
commitdec2025a3e0893a568059050cacc64fae530e70f (patch)
tree8a7869c30c5d4ea1db452c6a824de7ed9fe40e6a /Master/texmf-dist/tex
parent14b940d3a9e9e7be69d633ba04b359fb4a9e358a (diff)
lexref (21jan14)
git-svn-id: svn://tug.org/texlive/trunk@32751 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-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