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

Problem(s) with package enotez #91

Open
FredericVivien opened this issue Jan 16, 2022 · 6 comments
Open

Problem(s) with package enotez #91

FredericVivien opened this issue Jan 16, 2022 · 6 comments

Comments

@FredericVivien
Copy link

Hi Michal

I ran into a weird problem with the enotez package. It looks like due to some interaction with that package a regular \label \pageref becomes broken. Here is first a MWE and then some comments and symptoms.

\documentclass[12pt]{book}
\usepackage{tex4ebook}
\usepackage{enotez}
\begin{document}
See page~\pageref{mylabel}.

text\endnote{Some \textbf{note}}

{Thing \endnote{Stuff}}
\label{mylabel}

\printendnotes
\end{document}

This is processed with tex4ebook -f epub3 MWE.tex "fonts"

epubcheck complains: ERROR(RSC-012): MWE.epub/OEBPS/MWE.xhtml(8,70): Fragment identifier is not defined.

The problem is the a tag associated to mylabel (it is more explicit in a bigger example where it is obvious that the ref is missing the name of the file including it, from what I understand).

The above example is close to a MWE. All work if the first endnote is commented or if the brackets {} around the second endnote are removed... (This last remark did not enable me to find a workaround in my real-life case.)

Another unrelated problem: in the text of the notes, the size of the text changes when using \textbf. I may be doing something wrong here.

Frédéric

@michal-h21
Copy link
Owner

Hi Frédéric,

it was caused by a bug in latex.4ht, the destinations for \label commands didn't work if the counter that they were referencing was inside a group.

Note that your example may not work correctly even with normal LaTeX, when you use \ref{mylabel}, it will report number 1, instead of 2. I think you should put the \label command inside the group, otherwise, you point to the first note.

I may try to add a full support for enotez later, I think it would be nice to have hyperlinks between note marks in text and corresponding endnotes.

@FredericVivien
Copy link
Author

Hi Michal

It looks like things work for enotez. I used it with
\setenotez{backref} and the links ``between note marks in text and corresponding endnotes'' work both ways.

In my example, I do not want to reference an endnote, but just the page I have placed the label on. I was not able to produce an example without using enotez, though. Thinking about your answer, I wonder whether the problem is not due to an underlying limitation. Schematically, see my document as a long text without any sectionning or special environment (figure, etc.). I want to refer to a certain page. Hence I set a \label{something}. And then I reference it with \pageref{something}. I am beginning to wonder whether this is robust...

I will later check the fix. Thanks.

Frédéric

@buttonsrtoys
Copy link

Sounds like Frédéric had better luck than me getting links to work with enotez. My mwe below doesn't work. Is there something I'm missing?

\documentclass{memoir}
\usepackage{enotez}
\setenotez{backref=true}
\usepackage{hyperref}

\begin{document}
    Some sample text.\endnote{And a sample endnote}
    \printendnotes
\end{document}

I used his \label suggestion and rolled my own which I post here but I'd rather get it working with enotez.

@michal-h21
Copy link
Owner

I've found a solution and posted it on TEX.sx too. I've also updated TeX4ht sources, so it should be available in TeX Live soon.

@buttonsrtoys
Copy link

Thanks @michal-h21!!! That's awesome. I can't wait to use it. I'm not familiar with the TeX Live repo. If you have a minute, can post a link to your PR here so I can watch for when it gets merged?

@michal-h21
Copy link
Owner

It seems that updates to TeX Live are posted here. I've already found that Enotez support was merged, so it should be available in the update soon, maybe even today.

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

3 participants