diff options
author | Karl Berry <karl@freefriends.org> | 2017-06-17 23:46:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-06-17 23:46:41 +0000 |
commit | a70c3b1833479b4409e5b938d82f0dbb3539f4c4 (patch) | |
tree | 7b480db99f5ea96f5fbbe32372f72a6c8b687035 /Master/texmf-dist/tex/latex/leipzig/leipzig.sty | |
parent | 6af599a81babf26727b20aa5c22f32e84f039f7d (diff) |
leipzig (17jun17
git-svn-id: svn://tug.org/texlive/trunk@44625 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/leipzig/leipzig.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/leipzig/leipzig.sty | 605 |
1 files changed, 453 insertions, 152 deletions
diff --git a/Master/texmf-dist/tex/latex/leipzig/leipzig.sty b/Master/texmf-dist/tex/latex/leipzig/leipzig.sty index 4dd8d510df8..c6b0b8387b1 100644 --- a/Master/texmf-dist/tex/latex/leipzig/leipzig.sty +++ b/Master/texmf-dist/tex/latex/leipzig/leipzig.sty @@ -5,8 +5,6 @@ %% The original source files were: %% %% leipzig.dtx (with options: `package') -%% This is a generated file. -%% %% ---------------------------------------------------------------- %% leipzig --- A package to typeset and index linguistic gloss abbreviations. %% E-mail: natalie.a.weber@gmail.com @@ -14,8 +12,7 @@ %% See http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- %% -%% -%% Copyright (C) 2013 by Natalie Weber +%% Copyright (C) 2017 by Natalie Weber <natalie.a.weber@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -31,175 +28,479 @@ %% %% The Current Maintainer of this work is Natalie Weber. %% -%% This work consists of the files leipzig.dtx, -%% leipzig.ins -%% leipzig.tex -%% -%% and the derived files leipzig.sty and leipzig.pdf. +%% This work consists of the file leipzig.dtx, +%% and the derived files +%% README.md, +%% leipzig.ins, +%% leipzig.tex, +%% leipzig.sty, and +%% leipzig.pdf %% \NeedsTeXFormat{LaTeX2e}[1996/10/24]% \ProvidesPackage{leipzig}% - [2013/05/26 v1.0 Leipzig package for linguistic abbreviations]% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% This is a simple list of newcommands which create shortcuts for %% -%% standard linguistic glosses (see the Leipzig Glossing rules, %% -%% http://www.eva.mpg.de/lingua/resources/glossing-rules.php %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\long\def\tlist@if@empty@nTF #1{% - \expandafter\ifx\expandafter\\\detokenize{#1}\\% - \expandafter\@firstoftwo% - \else% - \expandafter\@secondoftwo% - \fi% -}% -\newif\ifleipzig@glossaries\leipzig@glossariesfalse + [2017/06/16 v2.0 Leipzig package for linguistic abbreviations]% + + + + +\newif\ifleipzig@glossaries\leipzig@glossariestrue \newif\ifleipzig@noglossaries\leipzig@noglossariesfalse -\newif\ifleipzig@donotindex\leipzig@donotindexfalse +\newif\ifleipzig@sepglosses\leipzig@sepglossesfalse +\newif\ifleipzig@nostandards\leipzig@nostandardsfalse +\newif\ifleipzigdonotindex\leipzigdonotindexfalse +\newcommand*{\@leipzig@default@style}{inline} +\newif\ifleipzighyper\leipzighyperfalse +\newif\ifleipzignonumbers\leipzignonumberstrue +\newcommand{\leipzigfont}[1]{\textsc{#1}}% \DeclareOption{glossaries}{\leipzig@glossariestrue} -\DeclareOption{noglossaries}{\leipzig@noglossariestrue} -\DeclareOption{nostandards}{\leipzig@donotindextrue} +\DeclareOption{noglossaries}{% + \leipzig@glossariesfalse + \leipzig@noglossariestrue +}% +\DeclareOption{glosses}{\leipzig@sepglossestrue} +\DeclareOption{leipzig}{\leipzig@sepglossestrue} +\DeclareOption{nostandards}{\leipzig@nostandardstrue} +\DeclareOption{block}{% + \renewcommand*{\@leipzig@default@style}{leipzigalttree}% +}% +\DeclareOption{mcolblock}{% + \renewcommand*{\@leipzig@default@style}{leipzigmcolalttree}% +}% +\DeclareOption{inline}{% + \renewcommand*{\@leipzig@default@style}{inline}% +}% +\DeclareOption{leipzighyper}{\leipzighypertrue} +\DeclareOption{leipzignohyper}{\leipzighyperfalse} \DeclareOption*{% - \PassOptionsToPackage{\CurrentOption}{glossaries}% + \PassOptionsToPackage{\CurrentOption}{glossaries}% }% \ProcessOptions\relax -\@ifpackageloaded{glossaries}{% true text - \ifleipzig@noglossaries\leipzig@glossariesfalse\relax - \else\leipzig@glossariestrue\relax\fi -}{% false text - \ifleipzig@glossaries\PackageWarning{leipzig}{% - glossaries package not loaded. Load glossaries - package at some point.}% - \else\leipzig@glossariesfalse\relax\fi -}% -\@ifpackageloaded{glossary-inline}{% renew inline -\renewglossarystyle{inline}{% - \renewenvironment{theglossary}% - {% - \def\gls@inlinesep{}% - \def\gls@inlinesubsep{}% - \def\gls@inlineshortlongsep{% - \glsinlineshortlongseparator}% added this - }% - {\glspostinline}% - \renewcommand*{\glossaryheader}{}% - \renewcommand*{\glsgroupheading}[1]{}% - \renewcommand*{\glossaryentryfield}[5]{% - \gls@inlinesep - \glsentryitem{##1}\glstarget{##1}{##2}% - \def\glo@desc{##3}% - \def\@no@post@desc{\nopostdesc}% - \ifx\glo@desc\@no@post@desc +\ifleipzig@noglossaries\relax +\else + \ifleipzig@glossaries + \@ifpackageloaded{glossaries}% + {\relax}% + {\IfFileExists{glossaries.sty}{% + \RequirePackage{glossaries}% + }% + {\PackageError{leipzig}% + {glossaries.sty not found.}% + {Install glossaries.sty or use [noglossaries] option.}% + }% + \IfFileExists{glossary-tree.sty}{% + \RequirePackage{glossary-tree}% + }% + {\PackageWarning{leipzig}% + {glossary-tree.sty not found.}% + {Install glossary-tree.sty to use leipzigalttree style.}% + }% + \IfFileExists{glossary-mcols.sty}{% + \RequirePackage{glossary-mcols}% + }% + {\PackageWarning{leipzig}% + {glossary-mcols.sty not found.}% + {Install glossary-mcols.sty to use leipzigmcolalttree style.}% + }% + \IfFileExists{glossary-inline.sty}{% + \RequirePackage{glossary-inline}% + }% + {\PackageWarning{leipzig}% + {glossary-inline.sty not found.}% + {Install glossary-inline.sty to use inline style.}% + }% + }% + \fi +\fi +\@ifpackageloaded{glossaries}{% + \newcommand*{\leipzigtype}{\glsdefaulttype}% + \newcommand{\leipzigname}{Abbreviations}% + \providecommand*{\printglosses}[1][]{}% + \providecommand*{\printleipzig}[1][]{}% + \newcommand{\firstleipzigfont}[1]{\leipzigfont{#1}}% + \newif\ifleipzigdesccapitalize\leipzigdesccapitalizefalse + \newcommand*{\leipzig@glossentrydesc}[1]{% + \ifleipzigdesccapitalize + \expandafter\ifx#1\nopostdesc + \glossentrydesc{#1}% + \else\Glossentrydesc{#1}% + \fi \else - \ifstrempty{##3}{}{\gls@inlineshortlongsep##3}% + \glossentrydesc{#1}% \fi - \ifglshaschildren{##1}% + }% + \newcommand*{\glspostnamespace}{\space}% +}{}% +\@ifpackageloaded{glossaries}{% + \ifleipzig@sepglosses + \newglossary[lpz]{leipzig}{lzs}{lzo}{\leipzigname}% + \renewcommand*{\leipzigtype}{leipzig}% + \newcommand*{\gls@tr@set@leipzig@toctitle}{% + \translatelet{\glossarytoctitle}{Abbreviations}% + }% + \else + \renewcommand*{\glossaryname}{\leipzigname} + \fi + \DeclareAcronymList{\leipzigtype}% + \newacronymstyle{long-lpz-short}% {% - \glsresetsubentrycounter - \glsinlineparentchildseparator - \def\gls@inlinesubsep{}% + \GlsUseAcrEntryDispStyle{long-short}% + }% + {% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand{\acronymfont}[1]{\leipzigfont{##1}}% + \renewcommand{\firstacronymfont}[1]{\firstleipzigfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% + }% + \setacronymstyle{long-lpz-short} +\AtBeginDocument{% + \if\@glossary@default@style\relax + \setglossarystyle{\@leipzig@default@style}% + \fi + \ifx\@leipzig@default@style\relax + \renewcommand*{\printglosses}[1][]{% + \printglossary[type=\leipzigtype,#1]% + }% + \else + \ifleipzignonumbers + \renewcommand*{\printglosses}[1][]{% + \printglossary[type=\leipzigtype,% + style=\@leipzig@default@style,% + nonumberlist,#1] + }% + \else + \renewcommand*{\printglosses}[1][]{% + \printglossary[type=\leipzigtype,% + style=\@leipzig@default@style,#1] + }% + \fi + \fi + \let\printleipzig\printglosses + \renewcommand*{\printglossaries}{% + \forallglossaries{\@@glo@type}{% + \edef\tempa{\@@glo@type}% + \edef\tempb{\leipzigtype}% + \ifx\tempa\tempb% + \printglosses% + \else + \printglossary[type=\@@glo@type]% + \fi% }% - {}% - \def\gls@inlinesep{\glsinlineseparator}% }% - \renewcommand*{\glossarysubentryfield}[6]{% - \gls@inlinesubsep% - \glstarget{##2}{}% - \glssubentryitem{##2}##4% - \def\gls@inlinesubsep{\glsinlinesubseparator}% +}% +}% +{\relax}% +\@ifpackageloaded{glossaries}{% + \forallglossaries[\leipzigtype]{\@@glo@type}{% + \glsnogroupskiptrue + \glsnopostdottrue }% - \renewcommand*{\glsgroupskip}{}% -} -\newcommand*{\glsinlineshortlongseparator}{\,=\,\linebreak[1]}% added this -\renewcommand*{\glsinlineseparator}{,\space}% changed from ;\space -\renewcommand*{\glsinlinesubseparator}{,\space} -\renewcommand*{\glsinlineparentchildseparator}{:\space} -\renewcommand*{\glspostinline}{.\space}% changed from . -\renewcommand{\glsnamefont}[1]{\textsc{#1}}% abbrv in glossary are \sc -\renewcommand*{\glossarysection}[2][]{}% no section name -}{\relax}% if glossary-inline not loaded -\newcommand{\leipzigfont}[1]{\textsc{#1}}% -\newcommand{\firstleipzigfont}[1]{\leipzigfont{#1}}% -\ifleipzig@glossaries %if glossaries package loaded - \renewcommand*{\acrpluralsuffix}{\textup{\glspluralsuffix}}% - \newcommand{\leipzigname}{Abbreviations} - \newglossary{leipzig}{lzs}{lzo}{\leipzigname} - \newcommand{\leipzigtype}{leipzig} -%% The following commands are based on the Custom Acronym commands in the glossaries package. -\newcommand*{\SetLeipzigDisplayStyle}[1]{% - \defglsdisplay[#1]{\leipzigfont{##1}##4}% - \defglsdisplayfirst[#1]{\firstleipzigfont{##1}##4}% -} -\newcommand*{\CustomLeipzigFields}{% - name={\the\glsshorttok},% - description={\the\glslongtok},% - symbol={\the\glsshorttok},% - first={\firstleipzigfont{\the\glsshorttok}},% - firstplural={\firstleipzigfont{\the\glsshorttok}\noexpand\acrpluralsuffix},% - text={\leipzigfont{\the\glsshorttok}},% - plural={\leipzigfont{\the\glsshorttok}\noexpand\acrpluralsuffix}% -} -\newcommand*{\LeipzigAcronymDef}{% - \protected@edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\leipzigtype,% - short={\leipzigfont{\the\glsshorttok}},% used in e.g. \acrshort - shortplural={\leipzigfont{\the\glsshorttok}\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - user1={\the\glsshorttok},% - user2={\the\glsshorttok\noexpand\acrpluralsuffix},% - user3={\the\glslongtok},% - user4={\the\glslongtok\noexpand\acrpluralsuffix},% - \CustomLeipzigFields,% - \the\glskeylisttok +}{\relax}% +\@ifpackageloaded{glossary-tree}{% + \newglossarystyle{leipzigalttree}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {\def\@gls@prevlevel{-1}% + \mbox{}\par + }% + {\par}% + \renewcommand*{\glstreenamefmt}[1]{##1} + \renewcommand{\glossentry}[2]{% + \ifnum\@gls@prevlevel=0\relax + \else + \settowidth{\glstreeindent}{% + \glstreenamefmt{\@glswidestname\glspostnamespace}% + }% + \fi + \hangindent\glstreeindent + \parindent\glstreeindent + \makebox[0pt][r]{% + \glstreenamebox{\glstreeindent}{% + \glsentryitem{##1}\glstreenamefmt{% + \glstarget{##1}{\glossentryname{##1}}% + }% + }% + }% + \ifglshassymbol{##1}{(\glossentrysymbol{##1})\space}{}% + \leipzig@glossentrydesc{##1}\glspostdescription\space ##2\par + \def\@gls@prevlevel{0}% + }% + \renewcommand{\subglossentry}[3]{% + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \ifnum\@gls@prevlevel=##1\relax + \else + \@ifundefined{@glswidestname\romannumeral##1}{% + \settowidth{\gls@tmplen}{% + \glstreenamefmt{\@glswidestname\glspostnamespace}}% + }{% + \settowidth{\gls@tmplen}{\glstreenamefmt{% + \csname @glswidestname\romannumeral##1\endcsname + \glspostnamespace}}% + }% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% + \settowidth{\glstreeindent}{\glstreenamefmt{% + \@glswidestname\glspostnamespace}}}{% + \settowidth{\glstreeindent}{\glstreenamefmt{% + \csname @glswidestname\romannumeral\@gls@prevlevel + \endcsname\glspostnamespace}}}% + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi + \hangindent\glstreeindent + \makebox[0pt][r]{\glstreenamebox{\gls@tmplen}{% + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}}}% + \ifglshassymbol{##2}{(\glossentrysymbol{##2})\space}{}% + \leipzig@glossentrydesc{##2}\glspostdescription\space ##3\par + \def\@gls@prevlevel{##1}% }% }% - \@do@newglossaryentry -} -\newcommand*{\SetLeipzigStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\leipzigtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetLeipzigDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \LeipzigAcronymDef + \newglossarystyle{block}{% + \setglossarystyle{leipzigalttree}% }% -%% \@for\@gls@type:=\@glsacronymlists\do{% sets style for all acronymlists? -%%%% \SetCustomDisplayStyle{\@gls@type}% -%% \SetLeipzigDisplayStyle{\@gls@type}% -%% }% }% -\SetLeipzigStyle -%%Normally would have |\leipzigfont{#2}|, but I coded the leipzigfont directly into the short form. How else to do it? -\renewcommand{\acrfullformat}[2]{#1\space(#2)} -\newcommand{\newleipzig}[4][]{% - \bgroup - \tlist@if@empty@nTF{#1}% - {\newacronym[type=\leipzigtype]{#2}{#3}{#4}}% - {\newacronym[type=\leipzigtype,#1]{#2}{#3}{#4}}% - % \newacronym[type=\leipzigtype][#1]{n#2}{n#3}{Non-#4} - \@newleipzig(#3)#2\@nil}% - \def\@newleipzig(#1)#2#3\@nil{% - \ifleipzig@donotindex - \uppercase{\expandafter\gdef\csname #2}#3\endcsname{\leipzigfont{#1}} +{\relax}% +\@ifpackageloaded{glossary-tree}{% + \@ifpackageloaded{glossary-mcols}{% + \newglossarystyle{leipzigmcolalttree}{% + \setglossarystyle{leipzigalttree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}% + \raggedcolumns + \def\@gls@prevlevel{-1}% + \mbox{}\par + \vspace{-\baselineskip}% + }% + {\par + \end{multicols}}% + }% + \newglossarystyle{mcolblock}{% + \setglossarystyle{leipzigmcolalttree}% + }% + }% + {\relax}% +}% +{\relax}% +\@ifpackageloaded{glossary-inline}{% if glossary-inline loaded + \providecommand{\renewglossarystyle}[2]{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}{Glossary style `#1' isn't already defined}{}% + }% + {% + \csdef{@glsstyle@#1}{#2}% + }% + } + \@ifpackagelater{glossaries}{2012/05/22}{% + \renewglossarystyle{inline}{% + \renewenvironment{theglossary}% + {% + \def\gls@inlinesep{}% + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{}% + }% + {\glspostinline}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsinlinedopostchild + \gls@inlinesep + \glsentryitem{##1}% + \glsinlinenameformat{##1}{% + \glossentryname{##1}% + }% + \ifglsdescsuppressed{##1}% + {% + \glsinlineemptydescformat + {% + \glossentrysymbol{##1}% + }% + {% + ##2% + }% + }% + {% + \ifglshasdesc{##1}% + {\glsinlinedescformat{\leipzig@glossentrydesc{##1}}{\glossentrysymbol{##1}}{##2}}% + {\glsinlineemptydescformat{\glossentrysymbol{##1}}{##2}}% + }% + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{\glsinlinepostchild}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% + \renewcommand{\subglossentry}[3]{% + \gls@inlinesubsep% + \glsinlinesubnameformat{##2}{% + \glossentryname{##2}}% + \glssubentryitem{##2}% + \glsinlinesubdescformat{\leipzig@glossentrydesc{##2}}{\glossentrysymbol{##2}}{##3}% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% + \renewcommand*{\glsgroupskip}{}% + \renewcommand*{\glsinlineseparator}{,\space}% original: ;\space + \renewcommand*{\glsinlinesubseparator}{,\space}% + \renewcommand*{\glsinlineparentchildseparator}{:\space}% + \renewcommand*{\glsinlinepostchild}{}% + \renewcommand*{\glspostinline}{.\space}% original: \glspostdescription\space + \renewcommand*{\glsinlinenameformat}[2]{\glstarget{##1}{##2}}% + \renewcommand*{\glsinlinedescformat}[3]{% + \,=\,\linebreak[1]##1}% original: \space#1 + \renewcommand*{\glsinlineemptydescformat}[2]{}% + \renewcommand*{\glsinlinesubnameformat}[2]{% + \glstarget{##1}{##2}}%original: \glstarget{#1}{} + \renewcommand*{\glsinlinesubdescformat}[3]{% + \,=\,\linebreak[1]##1}%original: #1 + \renewcommand*{\glossarysection}[2][\@gls@title]{}% no section header + }% + }% + {% + \renewglossarystyle{inline}{% + \renewenvironment{theglossary}% + {% + \def\gls@inlinesep{}% + \def\gls@inlinesubsep{}% + \def\gls@inlineshortlongsep{% + \glsinlineshortlongseparator}% added this v1.0 + }% + {\glspostinline}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand*{\glossaryentryfield}[5]{% + \gls@inlinesep + \glsentryitem{##1}\glstarget{##1}{##2}% + \def\glo@desc{##3}% + \def\@no@post@desc{\nopostdesc}% + \ifx\glo@desc\@no@post@desc + \else + \ifstrempty{##3}{}{\gls@inlineshortlongsep##3}% + \fi + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% + \renewcommand*{\glossarysubentryfield}[6]{% + \gls@inlinesubsep% + \glstarget{##2}{}% + \glssubentryitem{##2}##4% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% + \renewcommand*{\glsgroupskip}{}% + \newcommand*{\glsinlineshortlongseparator}{% + \,=\,\linebreak[1]}% added this v1.0 + \renewcommand*{\glsinlineseparator}{,\space}% original: ;\space + \renewcommand*{\glsinlinesubseparator}{,\space}% + \renewcommand*{\glsinlineparentchildseparator}{:\space}% + \renewcommand*{\glspostinline}{.\space}% changed from . + % \renewcommand{\glsnamefont}[1]{\textsc{##1}}% removed v2.0 + \renewcommand*{\glossarysection}[2][\@gls@title]{}% added v1.0 + }% + }% +}{\relax}% +\@ifpackageloaded{glossaries}{% + \newcommand{\newleipzig}[4][]{% + \bgroup + {\newacronym[type=\leipzigtype,#1]{#2}{#3}{#4}}% + \@newleipzig#2\@nil% + }% + \def\@newleipzig#1#2\@nil{% + \ifleipzigdonotindex + \uppercase{\expandafter\gdef\csname #2}#2\endcsname{% + \leipzigfont{\glsentryshort{#1#2}}% + }% + \else + \ifleipzighyper + \uppercase{\expandafter\gdef\csname #1}#2\endcsname{% + \acrshort{#1#2}% + }% \else - \uppercase{\expandafter\gdef\csname #2}#3\endcsname{\gls{#2#3}} + \uppercase{\expandafter\gdef\csname #1}#2\endcsname{% + \acrshort*{#1#2}% + }% \fi - \egroup - }% end if glossaries loaded -\else % if glossaries not loaded + \fi + \egroup + }% +\newcommand{\renewleipzig}[2][]{% + \if@leipzig@defined{#2} + {% + \renew@leipzig{#1}{#2}% + }% + {% + \PackageError{leipzig} + {Abbreviation `#2' undefined} + {No `#2` abbreviation is defined, use \string\newleipzig}% + \@gobbletwo + }% +} +\def\if@leipzig@defined#1{% + \uppercase\expandafter{\expandafter\ifcsname\@car#1\@nil}\@cdr#1\@nil\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\def\renew@leipzig#1#2{% + \ifcsname glo@\glsdetoklabel{#2}@name\endcsname + \csundef{glo@\glsdetoklabel{#2}@name} + \fi + \if\relax\detokenize{#2}\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + {\newleipzig{#2}}{\newleipzig[#1]{#2}}% +}% +}{% \newcommand{\newleipzig}[4][]{\@newleipzig(#3)#2\@nil}% + \newcommand{\renewleipzig}[4][]{% + \if@leipzig@defined{#2} + {% + \@newleipzig(#3)#2\@nil% + }% + {% + \PackageError{leipzig} + {Abbreviation `#2' undefined} + {No `#2` abbreviation is defined, use \string\newleipzig}% + \@gobbletwo + }% + } \def\@newleipzig(#1)#2#3\@nil{% \uppercase{\expandafter\gdef\csname #2}#3\endcsname{\leipzigfont{#1}} }% -\fi -\input{leipzig.tex} -\ifleipzig@donotindex\leipzig@donotindexfalse\fi +} +\@ifpackageloaded{glossaries}{% + \loadglsentries{leipzig.tex}% + }% + {\input{leipzig.tex}}% +%% +%% Copyright (C) 2017 by Natalie Weber <natalie.a.weber@gmail.com> +%% +%% 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 (at your option) 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. +%% +%% End of file `leipzig.sty'. |