2

I have a little problem with my footnotes. I'm using a solution 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 acronym (\ac{}) that is at the at of a sentence in a footnote it doesn't work. I'm pretty sure it's because of the \acdot which provides that at the end of a sentence (in the main text) won't be two dots. But I have no clue how to solve this problem. Hopefully, someone could help me.

MWE:

\documentclass[a4paper,12pt]{scrbook}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}

\usepackage[german=guillemets]{csquotes} \usepackage[hidelinks]{hyperref} \usepackage[style=german-legal-book]{biblatex}

\addbibresource{mylit.bib}

\bibliography{mylit} \begin{filecontents}{mylit.bib} @article{Smith, Author={Smith, John}, Journal={ExamplePaper}, Title={Titel}, Year={2006}, Number={5}, Pages={1--10} } \end{filecontents}

\usepackage{acro} \acsetup{ list/template = styleabbrev, list/heading = chapter, list/name = Abkürzungsverzeichnis }

\DeclareAcronym{mwN}{ short = m.~w.~N\acdot , long = mit weiterem Nachweis , first-style = short }

\let\orgfootnote\footnote \newcommand\myautodot{% \ifthenelse{\the\spacefactor>\sfcode`,}{}{.}% } \renewcommand\footnote[2][\empty]{% \ifx#1\empty% \orgfootnote{\normalsfcodes#2\myautodot}% \else% \orgfootnote[#1]{\normalsfcodes#2\myautodot}% \fi% }

\begin{document}

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

Some text.\footnote{No two dots at the end of the sentence.}

Some more text.\footnote{Some text \cite[2]{Smith}}

Different text.\footnote{I like \cite[4]{Smith}.}

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

\end{document}

stbu
  • 33

1 Answers1

3

acro is configured to look for a literal . and absorb that if present, we have a similar problem to yours using just

\newcommand\mydot{.}
\ac{mwN}\mydot

in the main text.

In order to have \myautodot be absorbed acro needs to be told that it is a trailing character that \acdot-type macros may wish to absorb, and should be allowed to with the register (documented erroneously as define) and activate keys. Assuming we always want \acdot to absorb both . and \myautodot we can redefine it so it looks for dot (the internal name acro uses for .) and autodot (which is what we've named \myautodot)

\acsetup{
trailing/register = \myautodot {autodot},
trailing/activate = {autodot}
}
\renewcommand*\acdot{\aciftrailing{dot,autodot}{}{\abbrdot}}
Dai Bowen
  • 6,117