summaryrefslogtreecommitdiff
path: root/support/tex4ebook/readme.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-11-02 03:01:48 +0000
committerNorbert Preining <norbert@preining.info>2019-11-02 03:01:48 +0000
commit3479a92321ed7fe7e2133d3daec2d4f5fd53fbc6 (patch)
treef81c77e1742124279f68e41484d9e53ad40248ff /support/tex4ebook/readme.tex
parent61b8d58232b999b6cc966aee9152fb86bbb759cd (diff)
CTAN sync 201911020301
Diffstat (limited to 'support/tex4ebook/readme.tex')
-rw-r--r--support/tex4ebook/readme.tex137
1 files changed, 87 insertions, 50 deletions
diff --git a/support/tex4ebook/readme.tex b/support/tex4ebook/readme.tex
index 2a6110e03f..13b064bf31 100644
--- a/support/tex4ebook/readme.tex
+++ b/support/tex4ebook/readme.tex
@@ -1,29 +1,23 @@
\hypertarget{introduction}{%
\section{Introduction}\label{introduction}}
-\texttt{TeX4ebook} is bundle of Lua scripts and \texttt{LaTeX} packages
-for conversion of LaTeX files to ebook formats, for example
-\texttt{epub}, \texttt{mobi} and \texttt{epub3}. \texttt{tex4ht} is used
-as conversion engine.
-
-Note that while \texttt{mobi} is supported by Amazon Kindle, most
-widespread ebook reader, it doesn't support \texttt{mathml} and this
-means that math must re represented as images. The same is true for
-\texttt{epub}. This is not a good thing, especially for inline math, as
-you may experience wrong baselines. If your ebook contains math, the
-only correct solution is to produce \texttt{epub3}, as it supports
-\texttt{mathml}. The issue with \texttt{epub3} is, that majority of
-\texttt{e-ink} ebook readers doesn't support this format, reader
-applications exists mainly for Android and Apple devices. For books
-which contains mainly prose, all formats should be suitable, but
-\texttt{epub3} supports most features from web standards, such as
-\texttt{CSS}.
-
-As with \texttt{tex4ht}, the emphasis is on conversion of document's
-logical structure and metadata, basic visual appearance is preserved as
-well, but you should use custom configurations if you want to make the
-document more visually appealing. You can include custom \texttt{CSS} or
-fonts in configuration files.
+\texttt{TeX4ebook} is a tool for conversion from \LaTeX~to ebook
+formats, such as EPUB, MOBI and EPUB 3. It is based on
+\texttt{TeX4ht}\footnote{\url{https://tug.org/tex4ht/}}, which provides
+instructions for the actual \LaTeX~to HTML conversion, and on
+\texttt{make4ht}\footnote{\url{https://ctan.org/pkg/make4ht?lang=en}}.
+
+The conversion is focused on the logical structure of the converted
+document and metadata. Basic visual appearance is preserved as well, but
+you should use custom configurations if you want to make the document
+more visually appealing. You can include custom \texttt{CSS} or fonts in
+a configuration file.
+
+\texttt{TeX4ebook} supports the same features as \texttt{make4ht}, in
+particular build files and extensions. These may be used for
+post-processing of the generated HTML files, or to configure the image
+conversion. See the \texttt{make4ht} documentation to see the supported
+features.
\hypertarget{license}{%
\subsection{License}\label{license}}
@@ -67,8 +61,11 @@ But it is optional. You shouldn't need to modify your \TeX~files
\section{Command line options}\label{command-line-options}}
\begin{description}
+\item[\texttt{-a,-\/-loglevel}]
+Set message log level. Possible values: debug, info, status, warning,
+error, fatal. Default: status.
\item[\texttt{-c,-\/-config}]
-specify custom config file for \texttt{tex4ht}
+specify custom config file for \texttt{TeX4ht}
\end{description}
\textbf{example config file}: File \texttt{sample.cfg}
@@ -95,7 +92,10 @@ Specify make4ht build file\footnote{\url{https://github.com/michal-h21/make4ht\#
Defaulf build file filename is \texttt{filename.mk4}, use this option if
you use different filename.
\item[\texttt{-f,-\/-format\ (default\ epub)}]
-Output format. Epub, Epub3 and Mobi formats are supported.
+Output format. Possible values are \texttt{epub}, \texttt{epub3} and
+\texttt{mobi}.
+\item[\texttt{-j,-\/-jobname}]
+Specify the output file name, without file extension.
\item[\texttt{-l,-\/-lua}]
Use LuaLaTeX as TeX engine.
\item[\texttt{-m,-\/-mode\ (default\ default)}]
@@ -107,8 +107,8 @@ times.
Resolution of generated images, for example math. It should meet
resolution of target devices, which is usually about 167 ppi.
\item[\texttt{-s,-\/-shell-escape}]
-Enable shell escape in htlatex run. This may be needed if you run
-external commands from your source files.
+Enable shell escape in the \texttt{htlatex} run. This is necessary for
+the execution of the external commands from your source files.
\item[\texttt{-t,-\/-tidy}]
process output html files with \texttt{HTML\ tidy} command\footnote{It
needs to be installed separately}.
@@ -121,8 +121,8 @@ Print the version number.
\hypertarget{configuration}{%
\section{Configuration}\label{configuration}}
-\texttt{tex4ebook} uses \texttt{tex4ht}\footnote{\url{http://www.tug.org/tex4ht/}}
-for conversion from LaTeX to html. \texttt{tex4ht} is highly
+\texttt{TeX4ebook} uses \texttt{TeX4ht}\footnote{\url{http://www.tug.org/tex4ht/}}
+for conversion from LaTeX to html. \texttt{TeX4ht} is highly
configurable using config files. Basic config file structure is
\begin{verbatim}
@@ -134,19 +134,19 @@ configurable using config files. Basic config file structure is
\end{verbatim}
Basic info about command configurations can be found in a
-work-in-progres \emph{tex4ht tutorial}\footnote{\url{https://github.com/michal-h21/helpers4ht/wiki/tex4ht-tutorial}},
-\emph{tex4ht documentation}\footnote{\url{http://www.tug.org/applications/tex4ht/mn11.html}},
+work-in-progres \emph{TeX4ht tutorial}\footnote{\url{https://github.com/michal-h21/helpers4ht/wiki/tex4ht-tutorial}},
+\emph{TeX4ht documentation}\footnote{\url{http://www.tug.org/applications/tex4ht/mn11.html}},
and in series of blogposts on CV Radhakrishnan's blog: \emph{Configure
-part 1}\footnote{\url{http://www.cvr.cc/?p=323}}, \emph{Configure part
-2}\footnote{\url{http://www.cvr.cc/?p=362}}, \emph{Low level
-commands}\footnote{\url{http://www.cvr.cc/?p=482}}. Available options
-for \texttt{\textbackslash{}Preamble} command are listed in the article
-\emph{TeX4ht: options}\footnote{\url{http://www.cvr.cc/?p=504}}.
+part 1}\footnote{\url{https://web.archive.org/web/20180908234227/http://www.cvr.cc/?p=323}},
+\emph{Configure part 2}\footnote{\url{https://web.archive.org/web/20180908201057/http://www.cvr.cc/?p=362}},
+\emph{Low level commands}\footnote{\url{https://web.archive.org/web/20180909101325/http://cvr.cc/?p=482}}.
+Available options for \texttt{\textbackslash{}Preamble} command are
+listed in the article \emph{TeX4ht: options}\footnote{\url{https://web.archive.org/web/20180813043722/http://cvr.cc/?p=504}}.
\emph{Comparison of tex4ebook and Pandoc output}\footnote{\url{https://github.com/richelbilderbeek/travis_tex_to_epub_example_1}}
-Great source of tips for \texttt{tex4ht} configuring is \emph{tex4ht tag
-on TeX.sx}\footnote{\url{http://tex.stackexchange.com/questions/tagged/tex4ht}},
-there is also a \emph{tag for tex4ebook}\footnote{\url{http://tex.stackexchange.com/questions/tagged/tex4ebook}}.
+A great source of tips for \texttt{TeX4ht} configuration is \emph{tex4ht
+tag on TeX.sx}\footnote{\url{http://tex.stackexchange.com/questions/tagged/tex4ht}}.
+There is also a \emph{tag for tex4ebook}\footnote{\url{http://tex.stackexchange.com/questions/tagged/tex4ebook}}.
Examples of interesting questions are \emph{including images and fonts
in ebooks}\footnote{\url{http://tex.stackexchange.com/a/213165/2891}} or
@@ -161,7 +161,7 @@ in ebooks}\footnote{\url{http://tex.stackexchange.com/a/213165/2891}} or
\Configure{UniqueIdentifier}{identifier}
\end{verbatim}
-Every epub file should have unique identifier, like ISBN, DOI, URI etc.
+Every EPUB file should have unique identifier, like ISBN, DOI, URI etc.
Default identifier is URI, with value
\texttt{http://example.com/\textbackslash{}jobname}.
@@ -179,8 +179,8 @@ to strip away any information which don't belongs here, such as
\Configure{OpfScheme}{URI}
\end{verbatim}
-Type of unique identifier, default type is URI. It is used only in
-\texttt{epub}, it is deprecated for \texttt{epub3}
+Type of unique identifier, default type is URI. It is used only in the
+EPUB format, it is deprecated for EPUB 3.
\begin{verbatim}
\Configure{resettoclevels}{list of section types in descending order}
@@ -194,7 +194,7 @@ file. Default value is the whole document hierarchy, from
\Configure{DocumentLanguage}{language code}
\end{verbatim}
-Each ePub file must declare the document language. It is inferred from
+Each EPUB file must declare the document language. It is inferred from
\texttt{babel} main language by default, but you can configure it when
it doesn't work correctly. The \texttt{language\ code} should be in
\href{https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes}{ISO 639-1}
@@ -243,11 +243,12 @@ Add item to \texttt{\textless{}manifest\textgreater{}} section in the
\Configure{xmlns}{prefix}{uri}
\end{verbatim}
-Add xml name space to \texttt{xhtml} files. Useful in \texttt{EPUB\ 3}
+Add \texttt{XML} name space to the generated \texttt{XHTML} files.
+Useful in \texttt{EPUB\ 3}.
-\hypertarget{commands-available-in-config-files}{%
-\subsection{Commands available in config
-files}\label{commands-available-in-config-files}}
+\hypertarget{commands-available-in-the-config-file}{%
+\subsection{Commands available in the config
+file}\label{commands-available-in-the-config-file}}
\begin{description}
\item[\texttt{\textbackslash{}OpfRegisterFile{[}filename{]}}]
@@ -293,8 +294,44 @@ information.
\hypertarget{troubleshooting}{%
\section{Troubleshooting}\label{troubleshooting}}
+\hypertarget{fixed-layout-epub}{%
+\subsection{Fixed layout EPUB}\label{fixed-layout-epub}}
+
+The basic support for the Fixed layout EPUB 3 can be enabled using the
+following configurations:
+
+\begin{verbatim}
+\Configure{OpfMetadata}{\HCode{<meta property="rendition:layout">pre-paginated</meta>}}
+\Configure{OpfMetadata}{\HCode{<meta property="rendition:orientation">landscape</meta>}}
+\Configure{OpfMetadata}{\HCode{<meta property="rendition:spread">none</meta>}}
+\Configure{@HEAD}{\HCode{<meta name="viewport" content="width=1920, height=1080"/>\Hnewline}}
+\end{verbatim}
+
+Modify the dimensions in the
+\texttt{\textless{}meta\ name="viewport\textgreater{}} element according
+to your needs.
+
+\hypertarget{math-issues}{%
+\subsection{Math issues}\label{math-issues}}
+
+Note that while \texttt{mobi} is supported by Amazon Kindle, most
+widespread ebook reader, it doesn't support \texttt{MathML}. This means
+that math must be represented as images. The same issue is true for the
+EPUB format as well. This is problematic especially for the inline math,
+as you may experience wrong vertical alignment of the math content and
+surrounding text. If your ebook contains math, a better solution is to
+produce the \texttt{epub3} format, as it supports \texttt{MathML}. The
+issue with EPUB 3 is that majority of \texttt{e-ink} ebook readers don't
+support it. Reader applications exists mainly for Android and Apple
+devices. For books which contains mainly prose, all formats should be
+suitable, but EPUB 3 supports most features from web standards, such as
+\texttt{CSS}.
+
+\hypertarget{compilation-errors}{%
+\subsection{Compilation errors}\label{compilation-errors}}
+
When compilation of the document breaks with error during \texttt{LaTeX}
-run, it may be caused by some problem in \texttt{tex4ht} configuration.
+run, it may be caused by some problem in \texttt{TeX4ht} configuration.
Comment out line \texttt{\textbackslash{}usepackage\{tex4ebook\}} in
your source file and run command:
@@ -303,9 +340,9 @@ htlatex filename
\end{verbatim}
if same error as in \texttt{tex4ebook} run arises, the problem is in
-some \texttt{tex4ht} configuration. Try to identify the source of
+some \texttt{TeX4ht} configuration. Try to identify the source of
problem and if you cannot find the solution, make minimal example
-showing the error and ask for help either on \emph{tex4ht mailing
+showing the error and ask for help either on \emph{TeX4ht mailing
list}\footnote{\url{http://tug.org/mailman/listinfo/tex4ht}} or on
\emph{TeX.sx}\footnote{\url{http://tex.stackexchange.com/}}.