Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical notes with footnote marker? #855

Closed
baem2 opened this issue Apr 17, 2020 · 14 comments
Closed

Critical notes with footnote marker? #855

baem2 opened this issue Apr 17, 2020 · 14 comments

Comments

@baem2
Copy link
Contributor

baem2 commented Apr 17, 2020

For a new edition project, I probably need to follow new/other rules.

Most importantly, in the text they want a footnote mark after the lemma; in the apparatus, they want the footnote mark instead of the line number. It is possible to do this with a workaround (not using \edtext and \Afootnote, but a regular footnote), but it means loosing a lot of other functionality. Would it be possible to add this as a regular feature? (Or is it possible already and I didn't see that?)

Here's a MWE that produces the required output:

\documentclass{book}

\usepackage[latin]{babel}

\usepackage[utf8]{inputenc}

\usepackage[series={A},noledgroup]{reledmac}

\begin{document}


\makeatletter
\renewcommand*{\thefootnoteA}{\alph{footnoteA}}
\renewcommand*{\footfootmarkA}{\textbf{\@nameuse{@thefnmarkA}}}
\makeatother

\newcommand{\app}[2]{#1\footnoteA{ #1] #2}}

\beginnumbering
\pstart
Non est nobis animus de dignitate atque utilitate \emph{\app{studii}{studij X} Theologici} praefationis loco multis disserere, sed methodum rectè illud instituendi ac pertexendi illis, qui se huic studio consecratos volunt, praescribere.
\pend
\endnumbering

PS If you are interested in my last edition project, please send me your address (if the pdf fits your needs, it will be available freely soon).

@maieul
Copy link
Owner

maieul commented Apr 17, 2020 via email

@baem2
Copy link
Contributor Author

baem2 commented Apr 17, 2020

A feature missing is for example that \edtext takes over the correct settings of the font (in the MWE: \emph), while my solution doesn't. But it's fine, I just wanted to know if I overlooked some existing way to do it.

@maieul
Copy link
Owner

maieul commented Apr 17, 2020 via email

@baem2
Copy link
Contributor Author

baem2 commented Apr 17, 2020

Thanks. But as far as I see, normal text in the second argument of edtext is placed before the lemma in the main text. So the counter given in 2., third "-", will be placed before the lemma in the main text if I see it correctly.

@maieul
Copy link
Owner

maieul commented Apr 17, 2020 via email

@baem2
Copy link
Contributor Author

baem2 commented Apr 17, 2020

Ah, now I see how you want to do it. This seems to work, thanks!

(The second argument of edtext is also typeset in the main text, but in front of the lemma. At least in reledmac 2.26.2.)

@maieul
Copy link
Owner

maieul commented Apr 17, 2020

sorry??????
please provide a MWE....

@maieul
Copy link
Owner

maieul commented Apr 17, 2020

\edtext{toto}{\Afootnote{something}}

the second argument is not typeset... if it is typeset it is because you use it wrong :)

@baem2
Copy link
Contributor Author

baem2 commented Apr 17, 2020

If you do something like this \edtext{toto}{\Afootnote{something}42} the 42 will be typeset in the main text, before the lemma. But this might be "doing something wrong" ;)

@maieul
Copy link
Owner

maieul commented Apr 17, 2020

indeed. why adding this 42 in the second argumment?

you should use the \lemma command

@baem2
Copy link
Contributor Author

baem2 commented Apr 17, 2020

Yap, right, I was just trying to put the footnote marker to the correct position. But that works now.

I tried to implement the solution you suggested. One problem I wasn't able to fix: In the apparatus, the footnote mark does not fit (it's always the last status of the counter [even if I use a new counter, not the internal one]). See MWE.

The internal counter from your "1." is called "edtext"; the hook to prevent the line number is \Xnonumber.

MWE:

\documentclass{book}

\usepackage[latin]{babel}

\usepackage[utf8]{inputenc}

\usepackage[series={A},noledgroup]{reledmac}

\begin{document}

\newcommand{\app}[2]{\edtext{#1\textsuperscript{\alph{edtext}}}{\lemma{{\normalfont\textbf{\alph{edtext}}} #1}\Afootnote{#2}}}

\Xnonumber[A]

\Xinplaceofnumber[A]{0mm}

\beginnumbering
\pstart
Non est nobis animus de dignitate atque utilitate \emph{\app{studii}{studij X} Theologici} \app{praefationis}{prafationis X} loco multis disserere, sed methodum rectè illud instituendi ac pertexendi illis, qui se huic studio consecratos volunt, praescribere.
\pend
\endnumbering
\end{document}

@maieul
Copy link
Owner

maieul commented Apr 17, 2020

Ha, yes, it is a classical problem of expansion.

Basically, \lemma macro just defines an internal reledmac macros, used later, when the footnote are send to to the output routine.

With you code, you say that this internal macro must contain \alph{edtext}, which mean "get the current value of the edtext counter". As it is called after all the main text is parsed, of course it will get the last version of the counter.

reledmac/latex classical footnote have internal "hack" to deal with that,

Basically, what you need is to expand the the result of \alph{edtext} before sending it to \lemma. So you need to deal with \expandafter.

In order to avoir expandafter long string, we could store the result of \alph{edtext} in a temporary macro.

That will do :


\newcommand{\app}[2]{%
  \edtext{%
    #1\textsuperscript{\alph{edtext}}
  }%
  {%
    \edef\thisedtext{\unexpanded{\normalfont\textbf}{\alph{edtext}}}%
  \expandafter\lemma\expandafter{\thisedtext\ #1}%
  \Afootnote{#2}}%
}

I am tired and I have no time now for a learning about expansion problem with TeX, but you will get many ressource on the internet.

@baem2
Copy link
Contributor Author

baem2 commented Apr 18, 2020

Yap, I already thought it might be about exapnsion (I know what it is!), I just did not know how to work around that. Thank you very much! Your support is great as always. (I even mentioned that in my recent preface!)

@baem2 baem2 closed this as completed Apr 18, 2020
@maieul
Copy link
Owner

maieul commented Apr 18, 2020

your welcome. Please don't forget to add your book on the collaborative bibliography, if not done. (I have no place at home for a physical volume)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants