2

I've been fiddling with this for three hours and I feel so lost because it seems like nothing I do has any effect on the tex4ht generated html.

I have a fairly large document that I'm building as a pdf using pdflatex as well as for html using tex4ht.

I have a few html requirements:

  • Front page ToC with sections and subsections.
  • Numbered paragraphs.
  • Section page ToC with subsection, subsubsections, and paragraphs.
  • Paragraph headings on a new line.

In pdf I have the same requirements as html, but I don't need the third. I have fulfilled the first two requirements, I'm just missing the final one but that's a bonus question. I want to focus on the tex4ht things.

I currently have the front page ToC with sections and subsections using \Configure{tableofcontents*}{section,subsection}. I have numbered paragraphs using \setcounter{secnumdepth}{4}. I can't for the life of me get the others to work.

Here is my raw cfg file: https://pastebin.com/64ECC1G6

1 Answer 1

2

Try these configurations for the paragraphs:

\Configure{paragraph}{}{}{\ifvmode\IgnorePar\fi\EndP\HCode{<h4 class="paragraphHead">}\TitleMark\space}{\HCode{</h4>}\IgnoreIndent}
\ConfigureMark{paragraph}{\theparagraph}
\Css{.paragraphToc{margin-left:6em;}}

The \Configure{paragraph} configures paragraph, the \ifvmode\IgnorePar\fi\EndP takes care of closing paragraphs, \TitleMark prints the paragraph number and \IgnoreIndent disables indent for the next text paragraph.

\ConfigureMark{paragraph}{\theparagraph} enables \theparagraph counter to be available in the \TitleMark.

The CSS code configures indentation in the TOC.

Sample result:

enter image description here

2
  • I was hopeful, but no dice. Is there anything I can send you that would help debug this?
    – Braaedy
    Nov 10, 2018 at 2:44
  • @Braaedy just send it to my mail (michal.h21@gmail.com)
    – michal.h21
    Nov 10, 2018 at 8:19

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.