1

I use make4ht to generate html file with css from latex document. And when I manually execute this command

make4ht main-tex -c tex4ht.cfg

it compiles part of LaTeX, then freeze with new line and "?" mark waiting for any key pressed, then it compiles next part and few times situation repeats. After that I have fully generated html file. That was a easy part, now if I want to use ie. Jenkins to do that, make4ht generates only first part of html, and skip everything that would be generated after freeze. Does anyone know why it behave in such way, and how to force it to build everything without key pressing?

MWE (copied from LaTeX Error: \theHchapter undefined when using tex4ht with hyperref and appendix package)

\documentclass{article}
\usepackage[toc,page]{appendix}
\usepackage{hyperref}
\begin{document}
\author{me}
\title{title}
\date{\today}
\maketitle
\tableofcontents

\section{first}
  some text

\section{two}
  some text in section 2

\begin{appendices}
\section{somesection inside appendices}
  some text again
\end{appendices}

\end{document}
5
  • 2
    Can you post a minimal example of a LaTeX document where this behavior still occurs and whatever error messages make4ht gives (if any)? Oct 24, 2019 at 9:22
  • ok, preparing such minimal document will take some time, and the only error I found is ! LaTeX Error: Command \theHchapter undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.1 \begin{appendices} ?
    – darvark
    Oct 24, 2019 at 9:24
  • Please make a minimal working example (MWE). Does this concern also exist when compiling with LaTeX? If yes, there might be some errors in your code.
    – dexteritas
    Oct 24, 2019 at 9:25
  • ok I found something, and looks like tex.stackexchange.com/questions/140008/… is ananswer to my question.
    – darvark
    Oct 24, 2019 at 9:28
  • @darvark please still update your question with a sample coe
    – michal.h21
    Oct 24, 2019 at 9:39

1 Answer 1

1

We can reuse the appendix.4ht file I posted earlier:

\def\@blockelement#1{% for handling paragraphs in block level elements
    \ifvmode\IgnorePar\fi\EndP\HCode{#1}
}
\renewcommand{\@chap@pppage}{%
    \chapter*{\appendixpagename}
}

\renewcommand{\@sec@pppage}{%
    \section*{\appendixpagename}
    \nobreak
    \@afterheading
}

\ConfigureEnv{appendices}{\@blockelement{<div class="appendices">}}{\@blockelement{</div>}}{}{}
\ifdefined\theHchapter\else\newcommand\theHchapter{\Alph{chapter}}\fi
\ifdefined\theHsection\else\newcommand\theHsection{\Alph{section}}\fi

I've also added this to the tex4ht sources, so the support for the appendix package should be added to the TeX distributions soon.

This is the generated page:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.