0

I have a little problem with my footnotes and using package glossaries-extra. I'm using a solution (see here) to add a period at the end of every \footnote{} (yes, I have to use \footnote{} and not \footcite{} because I have to add some text in my footnotes, too) and most of the time it works fine. But when I'm using an abbreviation (\gls{}) which ends with a period at the end of a sentence in a footnote it doesn't work. I'll get two periods. I have no clue how to solve this problem. Hopefully, someone could help me. (I had a similiar question but with package acro [see here].)

MWE:

\documentclass[paper=a4,fontsize=12pt]{scrbook}
\KOMAoptions{twoside=false}
\usepackage[ngerman]{babel}
\usepackage{fontspec}
\usepackage[german=guillemets]{csquotes}
\usepackage[hidelinks]{hyperref}
\usepackage[style=german-legal-book]{biblatex}
\setmainfont{ebgaramond}[]
\usepackage[style=long,nogroupskip,nonumberlist]{glossaries-extra}
\setabbreviationstyle{short-nolong}
\glssetcategoryattribute{abbreviation}{noshortplural}{true}
\glssetcategoryattribute{abbreviationdot}{discardperiod}{true}
%
\newabbreviation[%
     description={mit weiteren/m Nachweisen/Nachweis},%Darstellung der longform im Abkürzungsverzeichnis
     category=abbreviationdot,%
     longplural={mit weiteren Nachweisen},%
     shortplural=m.~w.~N.,
     sort={mwN},%
     ]%
     {mwN}%key
     {m.~w.~N.}%shortform
     {mit weiterem Nachweis}%longform
%
%automatic final period in footnote
\makeatletter%
\long\def\@makefntext#1{%
   \parindent 1em\noindent \hb@xt@ 1.8em{\hss\@makefnmark}#1%
   \ifnum\the\spacefactor<3000
     \ifnum\the\spacefactor=\blx@sf@period
     \else
     .%
     \fi
   \fi}
\makeatother
%
\begin{document}
There are no two dots at the end of sentence \gls{mwN}.\footnote{And here in the footnote is a dot at the end of the sentence}
Here is a dot.\footnote{But here, I only want one dot not two: \gls{mwN}}
\end{document}
stbu
  • 33

1 Answers1

1

I found a solution which seems to work. It's based on this issue.

MWE:

\documentclass[paper=a4,fontsize=12pt] {scrbook}
\KOMAoptions{twoside=false}
\usepackage[ngerman]{babel}
\usepackage{fontspec}
\usepackage[german=guillemets]{csquotes}
\usepackage[hidelinks]{hyperref}
\usepackage[style=german-legal-book]{biblatex}
\setmainfont{ebgaramond}[]
\usepackage[style=long,nogroupskip,nonumberlist]{glossaries-extra}
\usepackage{xpatch}
\setabbreviationstyle{short-nolong}
\glssetcategoryattribute{abbreviation}{noshortplural}{true}
\glssetcategoryattribute{abbreviationdot}{discardperiod}{true}

\makeatletter \newcommand{\addperiod}{\blx@imc@addperiod}
\makeatother

\makeatletter \protected\def\blx@imc@addperiod{% \ifnum\blx@spacefactor=999 @% \fi \blx@addpunct{period}% \ifnum\blx@spacefactor=\blx@sf@dot \spacefactor\blx@sf@period \fi}

\makeatother %automatic final period in footnote \makeatletter% \long\def@makefntext#1{% \parindent 2em% \hangindent = 1.7em% \hangafter = 1% \noindent % \hb@xt@ 1.6em{\hss@makefnmark\hspace{0,1 cm}}#1%\parindent 1em\noindent \hb@xt@ 1.8em{\hss@makefnmark}#1 \makebox[0.5em][l] \ifnum\the\spacefactor<3000 \ifnum\the\spacefactor=\blx@sf@period \else .% \fi \fi} \makeatother

\newabbreviation[% description={mit weiteren/m Nachweisen/Nachweis},%Darstellung der longform im Abkürzungsverzeichnis category=abbreviationdot,% longplural={mit weiteren Nachweisen},% shortplural=m.~w.~N\addperiod, sort={mwN},% ]% {mwN}%key {m.~w.~N\addperiod}%shortform {mit weiterem Nachweis}%longform % \begin{document}

There are no two dots at the end of sentence \gls{mwN}.\footnote{And here in the footnote is a dot at the end of the sentence}

Here is a dot.\footnote{But here, I only want one dot not two: \gls{mwN}}

\end{document}

stbu
  • 33