3

Preface: Sorry for the long text. By writing it, I was able to solve an earlier problem leading to this one.

In Underlining with ulem package breaks footnotes Ulrike Fischer and Heiko Oberdiek answer a question regarding the combination of package ulem and \footnote.

I am now confronted with a very similar problem, but with the footnote macros from package (r)eledmac.

How can I solve the following:

\documentclass{book}
\usepackage{ulem}
\usepackage[noreledmac]{eledmac} % or reledmac

\begin{document}
This is \uline{a test containing\footnoteA{A simple footnote.} a simple footnote.}
\end{document}

Using the approach from the linked question I could use:

This is \uline{a test containing\mbox{\footnoteAmark}}%
   \footnoteAtext{A simple footnote.}\uline{ a simple footnote.}

But how do those two macros \footnoteAmark and \footnoteAtext look like? I started with the eledmac manual and took relevant parts of the definition for \footnoteA:

\begingroup%
   \prepare@prenotesX{#1}%
   \newcommand{\content}{##1}%
   \stepcounter{footnote#1}%
   \protected@csxdef{@thefnmark#1}{\csuse{thefootnote#1}}%
   \csuse{@footnotemark#1}%
   \csuse{vfootnote#1}{#1}{\expandonce\content}\m@mmf@prepare%
\endgroup%

Now I split that up into two new definitions:

\makeatletter
\newcommand{\footnoteAmark}{%
   \begingroup%
      \prepare@prenotesX{A}%
      \stepcounter{footnoteA}%
      \protected@csxdef{@thefnmarkA}{\csuse{thefootnoteA}}%
      \csuse{@footnotemarkA}%
   \endgroup%
}%
%
\newcommand{\footnoteAtext}[1]{%
   \begingroup%
      \csuse{vfootnoteA}{A}{\expandonce{#1}}\m@mmf@prepare%
   \endgroup%
}%
\makeatother

It works. However, as I am using this as part of an automated process, is there a way to define some \footnoteAVar doing the magic altogether?

This is \uline{a test containing\footnoteAVar{A simple footnote.} a simple footnote.}

My approach

\newcommand{\footnoteAVar}[1]{%
   \mbox{\footnoteAmark}%       
   \egroup% to end \uline
   \footnoteAtext{#1}%
   \uline\bgroup%
}%

results in a missing footnote text at the bottom of the page:

\documentclass{book}
\usepackage{ulem}
\usepackage[noreledmac]{eledmac} % or reledmac
\makeatletter
\newcommand{\footnoteAmark}{%
   \begingroup%
      \prepare@prenotesX{A}%
      \stepcounter{footnoteA}%
      \protected@csxdef{@thefnmarkA}{\csuse{thefootnoteA}}%
      \csuse{@footnotemarkA}%
   \endgroup%
}%
%
\newcommand{\footnoteAtext}[1]{%
   \begingroup%
      \csuse{vfootnoteA}{A}{\expandonce{#1}}\m@mmf@prepare%
   \endgroup%
}%
\newcommand{\footnoteAVar}[1]{%
   \mbox{\footnoteAmark}%       
   \egroup% to end \uline
   \footnoteAtext{#1}%
   \uline\bgroup%
}%    
\makeatother    
\begin{document}
This is \uline{a test containing\mbox{\footnoteAmark}}\footnoteAtext{A  
simple footnote.}\uline{ a simple footnote.}

This is \uline{a test containing\footnoteAVar{A simple footnote.} a 
simple footnote.}
\end{document}

I guess my grouping is the problem. Does anybody have the missing link?

2
  • 1
    Please open an issue on github. I think that should be implemented directly in reledmac.
    – Maïeul
    Mar 31, 2017 at 20:44
  • Okay, I'll do that.
    – Martin
    Apr 1, 2017 at 9:50

1 Answer 1

2

Thanks to Martin Work, the version 2.19.0 of reledmac, which will be send quickly on CTAN, provides two new command : \footnoteAmark and \footnoteAtext:

\documentclass{article}
\usepackage[noend, noeledsec]{reledmac}
\usepackage{reledpar}
\usepackage{ulem}
\begin{document}
This is \uline{a test containing\mbox{\footnoteAmark}}\footnoteAtext{A  
simple footnote.}\uline{ a simple footnote.}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .