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 %Emphasize \vocabulary
\RequirePackage{expl3} \RequirePackage{expl3}
\ExplSyntaxOn \ExplSyntaxOn
\NewDocumentCommand{\vocab}{O{} m}{ \NewDocumentCommand{\vocab}{O{} m}{%
\textbf{\color{blue} #2}% \textbf{\color{blue} #2}%
\if\relax\detokenize{#1}\relax% \if\relax\detokenize{#1}\relax%
\index[vocabindex]{\text_titlecase_first:n{#2}} % true branch: #1 was empty \index[vocabindex]{\text_titlecase_first:n{#2}} % true branch: #1 was empty
\else \else%
\index[vocabindex]{#1} % false branch: #1 was supplied \index[vocabindex]{#1} % false branch: #1 was supplied
\fi \fi%
} }
\ExplSyntaxOff \ExplSyntaxOff
\newcommand\printvocabindex{ \newcommand\printvocabindex{%
\printindex[vocabindex] \printindex[vocabindex]%
} }
\NewDocumentCommand{\PrintVocabIndex}{ } \NewDocumentCommand{\PrintVocabIndex}{ }
{ {%
\printindex[vocabindex] \printindex[vocabindex]%
} }
\else \else
\NewDocumentCommand{\vocab}{O{} m }{ \NewDocumentCommand{\vocab}{O{} m }{%
\textbf{\color{blue} #2} \textbf{\color{blue} #2}%
} }%
\fi \fi