Chapter 6
TeX4ht Options
Following is an incomplete list of options that can be passed to the tex4ht.sty
package. These options can be used to modify the compilation process, for example
to select a SVG format for generated images, to request math environments to be
convert as images or to split sections as separate HTML pages.
The options may be defined in the .4ht files and may depend on the output
format, so it is not feasible to provide their full list. Most of the following options
work only in the HTML output.
There are several ways how to pass the options to TeX4ht. The non-recommended
way is to pass them as options to tex4ht.sty using \usepackage command in the
TeX file.
... \usepackage[xhtml,option1,option2]{tex4ht} ...
Recommended solutions don’t require modifications of the TeX files.
One way is to pass the options to make4ht as an command line argument, next to
the filename:
make4ht filename.tex "fn-in"
For more information on calling scripts see the section 4.
The second way is to pass options in the \Preamble command in a custom
configuration file. Note that first option in the \Preamble command must be
xhtml.
\Preamble{xhtml,fn-in} ... \begin{document} \EndPreamble
See the section Private Configuration Files for more details on configuration files.
6.1 List of options
- -css
-
to ignore
CSScode, use command line option-css. - -xtpipes
-
to avoid
xtpipespost-processing the output. This might be useful for DocbookXMLor ODT output. - 0
-
pagination shall be obtained through the option
0or1, at locations marked with\PageBreak. - 1, 2, 3, 4, 5, 6, 7
-
for automatic sectioning pagination (to break at various section levels), use the appropriate command line option
1, 2, 3, 4,5, 6, 7. Option 1 break pages at parts, 2 at chapters, 3 at sections, 4 at subsections, 5 at subsubsections and 6 at paragraphs. - DOCTYPE
-
to request a
DOCTYPEdeclaration, use the command line optionDOCTYPE. - Gin-dim
-
for key dimensions of the graphic, try this option.
- Gin-dim+
-
for key dimensions when the bounding box is not available.
- Gin-percent
-
calculate size of the graphics on the relation to the page width.
- NoFonts
-
don’t use original font style information.
- NoSections
-
don’t use frames for text alignment environments in the ODT output.
- PMath
-
Option to choose positioned math. Example:
\def\({\PMath$};\def\){$\EndPMath};\def\[{\PMath$$};\def\]{$$\EndPMath}. - RL2LR
-
to reverse the direction of RL sentences.
- TocLink
-
option to request links from the tables of contents.
- ^13
-
option for active superscript character.
- _13
-
option for active subscript character.
- accent-
-
This option is available only together with new-accents. It produces pictures for some math accents.
- bib-
-
for degraded bibliography friendlier for conversion to
.doc. - bibtex2
-
Option
bibtex2requires compilation of\jobname j.auxwith bibtex. - charset
-
for alternate character set, use the command line option
charset=...(e.g.,charset=utf-8). - css-in
-
the inline
CSScode will be extracted from the input of the previous compilation, so an extra compilaion might be needed for this option to make it effective. - css2
-
for
CSS2 code. - cut-fullname
-
by default filenames for files created by section breaking options base their names on truncated section type names. Use this option to disable truncating.
- early^
-
for default catcode of superscript in the
\Preamble. - early_
-
for default catcode of subscript in the
\Preamble. - endnotes
-
for end notes instead of footnotes, use this option.
- enumerate+
-
for enumerated list elements that keep the list couter value. This will use the description list like
<dt>...</dt>for the list counter. - enumerate-
-
for enumerated list element’s
<li>’s with value attributes, use this command line option. This will be an ordered list with the value of list counter provided as an attribute namely,valueof the<li>element. - fancylogo
-
try to visually emulate
\TeXand\LaTeXlogos. - fastmathjax
-
turn-off post-processing of math in the MathJax mode. It can speed-up the compilation, but it can result in invalid characters in the generated HTML file.
- fn-in
-
for inline footnotes use this option.
- fn-out
-
for offline footnotes.
- fonts
-
use HTML elements and CSS for LATeX font commands, such as
\textit. - fonts+
-
for marking of the base font, use this option.
- font
-
for adjusted font size, use the command line option
font=...(e.g., font=-2). - frames-
-
for frames support.
framesis also valid option for frames support. - frames-fn
-
for content,
TOCand footnotes in three frames. - frames
-
for
TOCand content in two frames. - fulltoc
-
adds a full
TOCto every generated page. ThisTOCincludes links to all sections in the document, making navigation easier across separate HTML files. It is especially useful in multi-page outputs where readers need consistent access to the document structure. When combined with thecollapsetocDOM filter, theTOCcan be automatically collapsed to show only top-level sections and the subsections relevant to the current page. - gif
-
for bitmaps of pictures in
.gifformat, use this option. - graphics-
-
if the included graphics are of degraded quality, try the command line options
graphics-numorgraphics-. Thenumshould provide the density of pixels in the bitmaps (e.g., 110). - hidden-ref
-
option to hide clickable index and bibliography references.
- html+
-
for stricter
HTMLcode. - imgdir
-
for addressing images in a subdirectory, use the option
\imgdir:.../. - image-maps
-
for
image-mapssupport. - index
-
for n-column index, use the command line option,
index=n(e.g., index=2). - info-oo
-
for extra tracing information while generating open office output.
- info
-
for extra information in the
\jobname.logfile. - itemize+
-
for original characters used as bullets in the
itemizelist. - java
-
for
javasupport. - javahelp
-
for
JavaHelpoutput format, use this command line option. - javascript
-
for
javascriptsupport. - jh-
-
for sources failing to produce
XMLversions ofHTML, try this command line option. - jpg
-
for bitmaps of pictures in
.jpgformat, use this option. - li-
-
for enumerated list elements li’s with value attributes.
- math-
-
option to use when sources fail to produce clean math code.
- mathjax
-
use MathJax for the math rendering.
- mathltx-
-
option to use when sources fail to produce clean
mathltxcode. - mathml-
-
option to use when sources fail to produce clean
MathMLcode. - mathplayer
-
for
MathMLon Internet Explorer + MathPlayer. - minipage-width
-
use CSS to set the minipage width.
- minitoc<
-
for mini tocs immediately after the header use the command line option,
minitoc<. - mouseover
-
for pop ups on mouse over.
- new-accents
-
alternative configurations for accented characters.
- next
-
for linear cross-links of pages, use this option.
- nikud
-
for Hebrew vowels, use the command line option,
nikud. - no-DOCTYPE
-
to remove
DOCTYPEdeclaration from the output. - no-VERSION
-
to remove
<?xml version="..."?>processing instruction from the output. - NoFonts
-
disable ht-fonts processing in the document.
- no-halign
-
suppress
\halignredefinition. It doesn’t work with thetabularenvironment. - no^
-
for non-active
^(superscript), use the optionno^. - no_
-
for non-active
_(subscript command), use the command line option,no_. - no_^
-
for both non-active superscript and subscript, use the option
no_^. - nolayers
-
to remove overlays of slides, use this option.
- nominitoc
-
this will eliminate mini tables of contents from the output.
- nostyle
-
to prevent default CSS style for section titles and page dimensions.
- notoc*
-
for tocs without
*entries, use this option. Thenotoc*option is applicable only to pages that are automatically decomposed into separate web pages along section divides. It shall be used when\addcontentslineinstructions are present in the sources. - obj-toc
-
for frames-like object based table of contents, use the command line option
obj-toc. - p-width
-
for width specifications of tabular
pentries, use this option. - p-indent
-
for indented paragraphs, without blank spaces.
- pic-RL
-
for pictorial RL.
- pic-align
-
for pictorial align environment.
- pic-array
-
for pictorial array.
- pic-cases
-
for pictorial cases environment.
- pic-eqalign
-
for pictorial equalign environment.
- pic-eqnarray
-
for pictorial eqnarray.
- pic-equation
-
for pictorial equations.
- pic-fbox
-
for pictorial or bitmapped fbox’es.
- pic-framebox
-
for bitmap fameboxes.
- pic-longtable
-
for bitmapped longtable.
- pic-m+
-
for pictorial
$...$and$$...$$environments with LATeX alt, use the command line optionpic-m+(not safe). - pic-m
-
for pictorial
$...$environments, use the command line optionpic-m(not recommended). - pic-matrix
-
for pictorial matrix.
- pic-tabular
-
use this option for pictorial tabular.
- plain-
-
for scaled down implimentation.
- prog-ref
-
for pointers to code files from root fragments, use the command line option
prof-ref. This is for debugging. - refcaption
-
for links into captions, instead of flat heads, use this option.
- rl2lr
-
to reverse the direction of Hebrew words, use this option.
- sec-filename
-
for file names derived from section titles, use the command line option
sec-filename. - sec-slugname
-
create filenames for chapters and sections for the current cut levels, derived from a slugified version of the section titles. Slugification involves converting the title to lowercase, removing diacritics, replacing spaces with hyphens, and stripping out characters that are not alphanumeric or hyphens. This ensures clean, URL-friendly filenames. Works only with LuaLaTeX.
- sections+
-
for back links to table of contents, use this option.
- svg-
-
for external
SVGfiles, try this option. - svg-obj
-
same as above.
- svg
-
for dvi pictures in
svgformat. - svg-inline
-
same as the svg, but the
SVGfiles are included in the document body. - tab-eq
-
for tab-based layout of equation environment, use this option.
- texsource
-
add the original LaTeX math code as an annotation in MathML. Works only in the HTML+MathML mode.
- trace-onmo
-
for mouseover tracing of compilation, use the command line option,
trace-onmo. - url-enc
-
for
URLencoding within href, use this option.\Configure{url-encoder}can be used to fine tune encoding. - url-il2-pl
-
for il2-pl
URLencoding. - ver
-
for vertically stacked frames. Effective when
framesoption is requested. - xht
-
for file name extension,
.xht, use this command line option. - xhtml
-
for
XMLcode, use the command line option,xmlorxhtml. - xml
-
See previous entry.
6.2 Options for the ODT output
- bib-
-
produces degraded bibliography that should be friendlier for conversion to Word.
- description-inline
-
use run-in style for description lists.
- endnotes
-
convert footnotes to endnotes.
- hidden-ref
-
hide clickable index and bibliography references.
- NoSections
-
don’t use sections for text alignment environments.
- tab-eq
-
tab based layout of equations.
- timestamp
-
save creation date in the document metadata.
- TocLink
-
request links from table of contents.