summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/support/make4ht/readme.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/support/make4ht/readme.tex')
-rw-r--r--Master/texmf-dist/doc/support/make4ht/readme.tex51
1 files changed, 37 insertions, 14 deletions
diff --git a/Master/texmf-dist/doc/support/make4ht/readme.tex b/Master/texmf-dist/doc/support/make4ht/readme.tex
index 83244743deb..77e1ecdc6b1 100644
--- a/Master/texmf-dist/doc/support/make4ht/readme.tex
+++ b/Master/texmf-dist/doc/support/make4ht/readme.tex
@@ -93,7 +93,11 @@ Make:name()
\begin{verbatim}
Make:add("text", "hello, input file: ${input}")
-Make:add("function", function(params) for k, v in pairs(params) do print(k..": "..v) end)
+Make:add("function", function(params)
+ for k, v in pairs(params) do
+ print(k..": "..v)
+ end
+)
\end{verbatim}
\texttt{parameters} is a table or \texttt{nil} value.
@@ -111,7 +115,7 @@ input TeX file
parameters to \texttt{latex}
\item[packages]
insert additionl LaTeX code which is inserted before
-\texttt{\textbackslash{}documentclass}. useful for passing options to
+\texttt{\textbackslash{}documentclass}. Useful for passing options to
packages or additional packages loading
\item[tex4ht\_sty\_par]
parameters to \texttt{tex4ht.sty}
@@ -124,7 +128,8 @@ output directory
\item[repetition]
limit number of command execution.
\item[correct\_exit]
-expected \texttt{exit code} from the command.
+expected \texttt{exit code} from the command. The compilation will be
+terminted when the command \texttt{exit code} is different.
\end{description}
You may add your own parameters, they will be accessible in templates
@@ -139,11 +144,11 @@ in the build file, because they would be called also by
You can set expected exit code from a command with
\texttt{correct\_exit}. Compilation is stopped when command returns
-different exit code. Situation is little bit difficult with LaTeX (all
-engines and formats in fact), because it doesn't differentiate between
-fatal and non fatal errors and returns same exit code in all cases. Log
-parsing is used because of that, error code \texttt{1} is returned in
-the case of fatal error, \texttt{0} is used otherwise.
+different exit code. The situation is different for LaTeX (for all TeX
+engines and formats, in fact), because it doesn't differentiate between
+fatal and non fatal errors, and it returns the same exit code in all
+cases. Log parsing is used because of that, error code \texttt{1} is
+returned in the case of fatal error, \texttt{0} is used otherwise.
\subsection{File matches}\label{file-matches}
@@ -197,6 +202,10 @@ underscores to \texttt{\textless{}hr\textgreater{}} elements
convert prohibited named entities to numeric entities (currently, only
\texttt{\ }, as it causes validation errors, and \texttt{tex4ht} is
producing it sometimes
+\item[fix-links]
+replace colons in local links and \texttt{id} attributes with
+underscores. Some cross-reference commands may produce colons in
+internal links, which results in validation error.
\end{description}
Function \texttt{filter} accepts also function arguments, in this case
@@ -226,7 +235,7 @@ These pictures are stored in special \texttt{dvi} file, on which
\texttt{dvi to image} commands are called.
This conversion is normally configured in the \texttt{env file}, which
-is system dependent and which has a little bit unintuitive syntax. This
+is system dependent and which has a bit unintuitive syntax. This
configuration is processed by \texttt{t4ht} application and conversion
commands are called for all pictures.
@@ -254,10 +263,11 @@ There are three parameters:
page - page number of the converted image
\end{itemize}
-\subsection{\texttt{mode} variable}\label{mode-variable}
+\subsection{The \texttt{mode} variable}\label{the-mode-variable}
-Variable \texttt{mode} contains contents of \texttt{-mode} command line
-option. It can be used to run some commands conditionally. For example:
+The \texttt{mode} variable contains contents of \texttt{-{}-mode}
+command line option. It can be used to run some commands conditionally.
+For example:
\begin{verbatim}
if mode == "draft" then
@@ -269,14 +279,27 @@ option. It can be used to run some commands conditionally. For example:
end
\end{verbatim}
-In this example (which is default configuration used by
+In this example (which is the default configuration used by
\texttt{make4ht}), LaTeX is called only once when \texttt{make4ht} is
-called with
+called with \texttt{draft} mode:
\begin{verbatim}
make4ht -m draft filename
\end{verbatim}
+\subsection{The \texttt{settings} table}\label{the-settings-table}
+
+You may want to access to the parameters also outside commands, file
+matches and image conversion functions. For example, if you want to
+convert your file to the \texttt{OpenDocument Format}, you can use the
+following settings, based on \texttt{oolatex} command:
+
+\begin{verbatim}
+settings.tex4ht_sty_par = settings.tex4ht_sty_par ..",ooffice"
+settings.tex4ht_par = settings.tex4ht_par .. " ooffice/! -cmozhtf"
+settings.t4ht_par = settings.t4ht_par .. " -cooxtpipes -coo "
+\end{verbatim}
+
\section{Command line options}\label{command-line-options}
\begin{verbatim}