tex4ht
采取一个数字作为选项,指定分割级别,即将一个部分或一个子部分等制作为单独的网页。
我有一篇文章,其中包含章节、子章节和子子章节。subsubsection
由于它们很大,我希望每个章节都放在自己的网页上。
我尝试过 split2
和3
,但4
这些都不起作用。它们subsubsections
都显示在父subsection
页面下的同一网页上。
这是 MWE 和我使用的命令以及网页的屏幕截图
\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}
命令
make4ht -ulm default -a debug foo.tex "mathjax,htm,3"
生产
[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
结果页面:
因此所有子小节都在同一页面上。
是否tex4ht
支持在子部分级别拆分文章?
我在 Linux 上使用 TL 2021。
答案1
您过早停止尝试数字。数字似乎像这样工作:
对于带有命令的文档类\chapter
:
- 1 - 拆分于
\part
- 2 - 拆分为
\chapter
- 3 - 拆分为
\section
- 4 - 拆分为
\subsection
- 5 - 拆分为
\subsubsection
- 6 - 拆分为
\paragraph
对于没有的文档类\chapter
(如article
):
- 1 - 拆分于
\part
- 2 - 拆分为
\section
- 3 - 拆分为
\subsection
- 5 - 拆分为
\subsubsection
- 6 - 拆分为
\paragraph
所以你应该尝试
make4ht -ulm default -a debug foo.tex "mathjax,htm,5"