TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've used HEVEA and HACHA in the past to make web-pages from TEX sources. The result is a separate web page for each \section{} of the original manuscript.

My latest manuscripts are more complex and HEVEA can't cut it. However, using HTLATEX, I can convert the manuscript to a single webpage.

Is there any way to get HTLATEX to automagically split the output into sub-documents for easier navigation?

share|improve this question
I found the answer at [CTAN][1]. Apparently I needed to include the command-line parameter htlatex source.tex "html,3,next" Not sure what the 3 means.. but lower numbers did not produce the sub-documents. [1]: tug.org/TUGboat/Articles/tb25-1/gurari.pdf – SmileAndNod Jun 7 '11 at 23:47
Could you please turn this into an answer and self-accept it (after the waiting period) so that question is officially concluded. Thanks! – Martin Scharrer Sep 18 '11 at 19:58
up vote 4 down vote accepted

I found the answer at TUG, contributed by Eitan Gurari in his presentation entitled TeX4ht: HTML production.

I needed to include the command-line parameter htlatex source.tex "html,3,next".(PS The 3 has to do with the subsection depth at which htlatex stops generating HTML.)

share|improve this answer
Would you show precisely the command line? – egreg Nov 1 '11 at 0:34
@egreg my file name is journal.tex, so I would enter: htlatex journal.tex "html,3,next" – SmileAndNod Nov 23 '11 at 13:16
For further clarification, inside journal.tex, I have my usual LaTeX syntax which htlatex will render into a webpage. If I want htlatex to generate a link to a new page for a section of the content, I cut and paste the content to a new file called, let's say, howtolink.tex. To create the link, I add the code: \section{How To Link\label{howtolink}} (this goes in journal.tex where the original content was cut from). HTLATEX interprets the label as a command to render howtolink.tex to a separate html document. – SmileAndNod Nov 23 '11 at 13:27
One additional correction: you must also input howtolink.tex into journal.tex. This is done by adding the line \input{howtolink} to journal.tex on the line immediately following the section title. – SmileAndNod Nov 23 '11 at 14:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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