2

tex4ht takes a number as an option which specifies the split level, i.e. to make a section or subsection and so on, as separate web pages.

I have an article with sections and subsections and subsubsections. I want each subsubsection to be on its own web page since they are large.

I tried split 2 and 3 and 4 and none of these are working. The subsubsections all show up on same web page under its parent subsection page.

Here is an MWE and the commands I used and a screen shot of the web page

    \documentclass[12pt]{article} 
    \begin{document}  
    \section{section 1} 
     \subsection{subsection 1} 
        \subsubsection{subsubsection 1} %want this on its webpage
         stuff
        \subsubsection{subsubsection 2} %want this on its webpage
         stuff
        \subsubsection{subsubsection 3} %want this on its webpage
         stuff    
    \end{document}

The command

make4ht -ulm default -a debug foo.tex "mathjax,htm,3"

produces

[INFO]    mkparams: Output dir:
[INFO]    mkparams: Compiler: dvilualatex
[INFO]    mkparams: Latex options: -jobname=foo
[INFO]    mkparams: tex4ht.sty: xhtml,mathjax,htm,3,charset=utf-8
[INFO]    mkparams: tex4ht:  -cmozhtf -utf8
[INFO]    mkparams: build_file: foo.mk4
[INFO]    mkparams: Output format: html5
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: foo.tex
....
[INFO]    make4ht-lib: executing: t4ht  "foo.dvi"
----------------------------
t4ht.c (2018-07-04-14:25 kpathsea)
t4ht foo.dvi
(/usr/local/texlive/2021/texmf-dist/tex4ht/base/unix/tex4ht.env)
Entering foo.lg
Entering foo.css
Entering foo.tmp

[INFO]    mkutils: Parse LG
[INFO]    make4ht-lib: parse_lg process file: foo.htm
[INFO]    make4ht-lib: parse_lg process file: foo.htm
[DEBUG]   tocid: Duplicate id found: subsubsection-. New id: subsubsection-1
[DEBUG]   tocid: Duplicate id found: subsubsection-. New id: subsubsection-2
[INFO]    make4ht-lib: parse_lg process file: foo.htm
[INFO]    make4ht: outdir:
[INFO]    make4ht-lib: parse_lg process file: foo.css
[INFO]    make4ht: outdir:
[INFO]    make4ht-lib: parse_lg process file: foo.tmp
[INFO]    make4ht-lib: tmp file
[INFO]    make4ht-lib: parse_lg process file: fose1.htm
[INFO]    make4ht-lib: parse_lg process file: fose1.htm
[INFO]    make4ht-lib: parse_lg process file: fose1.htm
[INFO]    make4ht: outdir:
[INFO]    make4ht-lib: parse_lg process file: fosu1.htm
[INFO]    make4ht-lib: parse_lg process file: fosu1.htm
[INFO]    make4ht-lib: parse_lg process file: fosu1.htm
[INFO]    make4ht: outdir:
[STATUS]  make4ht: Conversion finished

The resulting page:

enter image description here

So all subsubsections are on the same page.

Does tex4ht support splitting articles at the subsubsection level?

I am using TL 2021 on Linux.

1 Answer 1

4

You stopped trying numbers too early. The numbers seem to work like this:

For document classes with \chapter command:

  • 1 - split at \part
  • 2 - split at \chapter
  • 3 - split at \section
  • 4 - split at \subsection
  • 5 - split at \subsubsection
  • 6 - split at \paragraph

For document classes without \chapter (like article):

  • 1 - split at \part
  • 2 - split at \section
  • 3 - split at \subsection
  • 5 - split at \subsubsection
  • 6 - split at \paragraph

So you should try

 make4ht -ulm default -a debug foo.tex "mathjax,htm,5"

enter image description here

8
  • Thanks. That worked,. But I thought because this was article class, then 1-> section and 2->subsection, and so on. I did not know it uses the book numbering that is why I did not think it could be anything over 4.
    – Nasser
    Jan 26, 2022 at 22:30
  • 1
    @Nasser yes, the code for page breaking is quite complex, and it would be even more if it depended on used class. so the numbers are static. it is true that it isn't documented anywhere, and I had to take a look at the source code to find what the particular numbers do.
    – michal.h21
    Jan 26, 2022 at 22:37
  • Thanks for the list. But isn't true also that if no split number is given, then it will not split also. So I assume then the "default" internally is to use split=1 if no value is given by user. Yes, it makes sense to use the same numbers for all classes, otherwise it become a nightmare to maintain.
    – Nasser
    Jan 26, 2022 at 23:20
  • @Nasser yes, I think 1 has some differences to no value at all, it may add some table of contents. but I never used that, it just seems so from reading of the source code. it is old code, it can be more than 15 years old, I haven't changed it at all.
    – michal.h21
    Jan 27, 2022 at 9:45
  • 1
    @Nasser Article have \part too. But I updated my answer, thanks to cut-fullname option it is more obvious what gets broken. It seems that 3 breaks subsections for articles, but only 5 breaks subsubsections.
    – michal.h21
    May 15, 2022 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .