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

Hangs when generating Part page with \renewcommand{\thepart}{\Numberstring{part}} #105

Open
buttonsrtoys opened this issue May 17, 2023 · 3 comments

Comments

@buttonsrtoys
Copy link

Hi Michal,

My MWE below creates a simple Parts page. When I attempt to convert to EPub using tex4ebook main.tex, the process hangs. It runs fine when when I don't convert thepart to string.

\documentclass[ebook,12pt,oneside,openany]{memoir}

\usepackage{fmtcount}
\renewcommand{\thepart}{\Numberstring{part}}

\begin{document}
    \part{The Theory}
\end{document}
image
@michal-h21
Copy link
Owner

The redefined version of \thepart seems to cause issues with the auxiliary files. Try this configuration file:

\Preamble{xhtml}
\renewcommand\thepart{\arabic{part}}
\makeatletter
\Configure{part}{}{}
   {\IgnorePar \EndP\HCode{<h1 class="partHead"\csname a:LRdir\endcsname>}%
       \HCode{<span class="titlemark">}\partname \space\Numberstring{part}
       \HCode{<br /></span>}}
   {\HCode{</h1>}\IgnoreIndent\par}

\makeatother
\begin{document}
\EndPreamble

It redefines \thepart back to it's original meaning for the auxiliary files, and in \Configure{part}, we use your version with \Numberstring to print the number as a word.

@buttonsrtoys
Copy link
Author

Thanks Michal! Your solution worked great. I'm curious, what is meant by the "auxiliary files"?

@michal-h21
Copy link
Owner

In addition to the .aux file used by LaTeX, TeX4ht uses some additional files. .xref for links, and .4tc for tables of contents. In this case, the error happened in the .xref file.

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