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

Conflicting packages lastpage and hyperref #121

Closed
claell opened this issue Oct 13, 2023 · 5 comments
Closed

Conflicting packages lastpage and hyperref #121

claell opened this issue Oct 13, 2023 · 5 comments

Comments

@claell
Copy link

claell commented Oct 13, 2023

Took me some time to nail this down from a complex document to this MWE. The error happens, when both packages are used.

MWE:

\documentclass{book}
\usepackage{lastpage}
\usepackage{hyperref}


\begin{document}

Test

\end{document}

Output:

tex4ebook test.tex
[STATUS]  tex4ebook: Conversion started
[STATUS]  tex4ebook: Input file: test.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename     Line    Message
[ERROR]   htlatex: ./test.tex   870      Undefined control sequence.
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename     Line    Message
[ERROR]   htlatex: ./test.tex   870      Undefined control sequence.
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename     Line    Message
[ERROR]   htlatex: ./test.tex   870      Undefined control sequence.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
Der Befehl "tidy" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
[WARNING] exec_epub: tidy command seems missing, you should install it in order
  to make valid epub file

zip error: Internal logic error (fstat(stdin))
        1 Datei(en) kopiert.
[STATUS]  tex4ebook: Conversion finished
C:\texlive\2023\bin\windows\runscript.tlu:921: command failed with exit code 1:
texlua c:\texlive\2023\texmf-dist\scripts\tex4ebook\tex4ebook test.tex

Also note that the line for the error is always 870, no matter, what I change in the document. That also made finding the issue more complicated. Possibly related or another issue.

@michal-h21
Copy link
Owner

You are right. Some Hyperref macros used by Lastpage are not defined. Try this config file:

\Preamble{xhtml}
\makeatletter
  \def\Hy@PageAnchorSlidesPlain{}%
  \def\Hy@PageAnchorSlide{}%
\makeatother
\begin{document}
\EndPreamble

@claell
Copy link
Author

claell commented Oct 16, 2023

Ah, that makes sense. I'll do that!

@claell
Copy link
Author

claell commented Apr 21, 2024

I think with this workaround available, this can be closed! Thanks again!

@claell claell closed this as completed Apr 21, 2024
@michal-h21
Copy link
Owner

The fix is now included also in TeX4ht sources, so you don't need this configuration file anymore.

@claell
Copy link
Author

claell commented Apr 21, 2024

Oh, even better. I already wondered whether this is the case! That's perfect, thanks for the hint!

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