gusbrs / postnotes

Endnotes for LaTeX
LaTeX Project Public License v1.3c
2 stars 1 forks source link

\@textsuperscript in doc leading to problems #6

Closed Hypercube1234 closed 5 months ago

Hypercube1234 commented 5 months ago

In the documentation, the line containing \@textsuperscript leads to problems when reproducing (the »@«)

https://github.com/gusbrs/postnotes/blob/10ba78acb5e3dfff3729577ec97cb7696bfab34c/postnotes-doc.tex#L382

Looks like it was predefined from »listings«. I noticed this when I played around with the font-formatting of the label.

gusbrs commented 5 months ago

What I see in the manual's PDF is:

Screenshot from 2024-05-30 20-07-29

which looks correct to me. Could you elaborate what do you mean by "problems"?

Hypercube1234 commented 5 months ago

Copying the default-values from the documentation into the preamble leads to an incorrect display of the footnote-marker. Removing the @ corrects the display, however.

\documentclass{book}

\usepackage{fontspec} \usepackage{hyperref} \usepackage{postnotes} \postnotesetup{ makemark = {#2\hbox{\@textsuperscript{\normalfont#1}}#3} , maketextmark = {#2#1.#3}}

\begin{document}

Test\postnote{Test} \printpostnotes

\end{document}

github_postnotes

gusbrs commented 5 months ago

Ah, I see. But that is a problem in your document, not in the manual. If you want to use a macro containing a @ you'd need to wrap it between \makeatletter and \makeatother, like so:

\documentclass{book}

\usepackage{fontspec}
\usepackage{hyperref}
\usepackage{postnotes}
\makeatletter
\postnotesetup{
  makemark = {#2\hbox{\@textsuperscript{\normalfont#1}}#3} ,
  maketextmark = {#2#1.#3}}
\makeatother

\begin{document}

Test\postnote{Test}
\printpostnotes

\end{document}

The manual is making a statement on the default value of the option, which is indeed {#2\hbox{\@textsuperscript{\normalfont#1}}#3}, but the handling of catcodes for macros containing @ is already done in the package (inside the .sty). This value is so because it is the same definition used in the kernel for footnotes, which uses the internal \@textsuperscript.

But in your document you can very well just go with \textsuperscript and not bother with that. That's OK.

Anyway, thanks for the concern and the report.