fix whitespace around \vocab

This commit is contained in:
Maximilian Keßler 2022-08-18 16:09:02 +02:00
parent b6a13cfa40
commit 521ce5c804
Signed by: max
GPG Key ID: BCC5A619923C0BA5

View File

@ -21,25 +21,25 @@ __IF__(index)
%Emphasize \vocabulary
\RequirePackage{expl3}
\ExplSyntaxOn
\NewDocumentCommand{\vocab}{O{} m}{
\NewDocumentCommand{\vocab}{O{} m}{%
\textbf{\color{blue} #2}%
\if\relax\detokenize{#1}\relax%
\index[vocabindex]{\text_titlecase_first:n{#2}} % true branch: #1 was empty
\else
\else%
\index[vocabindex]{#1} % false branch: #1 was supplied
\fi
\fi%
}
\ExplSyntaxOff
\newcommand\printvocabindex{
\printindex[vocabindex]
\newcommand\printvocabindex{%
\printindex[vocabindex]%
}
\NewDocumentCommand{\PrintVocabIndex}{ }
{
\printindex[vocabindex]
{%
\printindex[vocabindex]%
}
\else
\NewDocumentCommand{\vocab}{O{} m }{
\textbf{\color{blue} #2}
}
\NewDocumentCommand{\vocab}{O{} m }{%
\textbf{\color{blue} #2}%
}%
\fi