michal-h21 / tex4ebook

Converter from LaTeX to ebook formats (epub, mobi). Using tex4ht and texlua scripts.
311 stars 32 forks source link

Appendix page out of order #124

Closed user6778 closed 7 months ago

user6778 commented 7 months ago

With tex4ebook and make4ht installed from github on top of the latest Tex Live on MacOS, I see the appendix page appear between the title and TOC with the simple document below. The appendix chapters themselves are at the end as expected. I've noted some stack overflow issues that indicate this issue is fixed, however I am still seeing it on the latest code. Please advise.

\documentclass{memoir}

\title{Title}
\author{Author}

\begin{document}
\maketitle

\tableofcontents

\chapter{Chap1}

Chap1 text

\backmatter
\appendix
\appendixpage
Appendix page text

\chapter{App1}
Appendix A text

\end{document}
michal-h21 commented 7 months ago

Content which is outside of sections, end in the main HTML file. In your case, it is \maketitle and then the appendix content before \chapter{App1}.

You can move the appendix text to a standalone page using the following configuration file:

\Preamble{xhtml}
\AddToHook{cmd/appendix/after}{\HPage{}}
\begin{document}
\EndPreamble

Unfortunately, it seems to work only with Memoir, it doesn't work correctly with the book class, so I cannot use it in tex4ebook core.

user6778 commented 7 months ago

Perfect, thanks!