From 8cd3bed99a3581a336526a347f925d9925ddc0d8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 1 Nov 2019 21:03:38 +0000 Subject: tex4ebook (1nov19) git-svn-id: svn://tug.org/texlive/trunk@52604 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/support/tex4ebook/README | 139 ++++++++++----------- .../texmf-dist/doc/support/tex4ebook/changelog.tex | 100 +++++++++++++++ Master/texmf-dist/doc/support/tex4ebook/readme.tex | 137 ++++++++++++-------- .../doc/support/tex4ebook/tex4ebook-doc.pdf | Bin 73368 -> 78095 bytes 4 files changed, 255 insertions(+), 121 deletions(-) (limited to 'Master/texmf-dist/doc/support') diff --git a/Master/texmf-dist/doc/support/tex4ebook/README b/Master/texmf-dist/doc/support/tex4ebook/README index 951dad5a573..796445674a2 100644 --- a/Master/texmf-dist/doc/support/tex4ebook/README +++ b/Master/texmf-dist/doc/support/tex4ebook/README @@ -2,24 +2,22 @@ # Introduction -`TeX4ebook` is bundle of Lua scripts and `LaTeX` packages for conversion of -LaTeX files to ebook formats, for example `epub`, `mobi` and `epub3`. `tex4ht` -is used as conversion engine. +`TeX4ebook` is a tool for conversion from \LaTeX\ to +ebook formats, such as EPUB, MOBI and EPUB 3. +It is based on `TeX4ht`^[https://tug.org/tex4ht/], +which provides instructions for the actual \LaTeX\ to HTML conversion, +and on `make4ht`^[https://ctan.org/pkg/make4ht?lang=en]. -Note that while `mobi` is supported by Amazon Kindle, most widespread ebook -reader, it doesn't support `mathml` and this means that math must re represented -as images. The same is true for `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 `epub3`, as it supports `mathml`. -The issue with `epub3` is, that majority of `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 `epub3` supports most features from web standards, such as `CSS`. -As with `tex4ht`, the emphasis is on conversion of document's logical structure -and metadata, basic visual appearance is preserved as well, but you should use +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 `CSS` or fonts in configuration files. +You can include custom `CSS` or fonts in a configuration file. + +`TeX4ebook` supports the same features as `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 `make4ht` documentation to see the supported features. + ## License @@ -38,6 +36,7 @@ You don't have to modify your source files unless you want to use commands defined by `tex4ebook` in the document, or when your document uses a package which causes a compilation error. + If you want to use `tex4ebook` commands, add this line to your document preamble: @@ -51,9 +50,13 @@ But it is optional. You shouldn't need to modify your \TeX\ files # Command line options +`-a,--loglevel` + +: Set message log level. Possible values: debug, info, status, warning, error, fatal. Default: status. + `-c,--config` -: specify custom config file for `tex4ht` +: specify custom config file for `TeX4ht` **example config file**: File `sample.cfg` @@ -78,7 +81,11 @@ But it is optional. You shouldn't need to modify your \TeX\ files `-f,--format (default epub)` -: Output format. Epub, Epub3 and Mobi formats are supported. +: Output format. Possible values are `epub`, `epub3` and `mobi`. + +`-j,--jobname` + +: Specify the output file name, without file extension. `-l,--lua` @@ -97,7 +104,7 @@ But it is optional. You shouldn't need to modify your \TeX\ files `-s,--shell-escape` -: Enable shell escape in htlatex run. This may be needed if you run external +: Enable shell escape in the `htlatex` run. This is necessary for the execution of the external commands from your source files. `-t,--tidy` @@ -112,12 +119,11 @@ But it is optional. You shouldn't need to modify your \TeX\ files `-v,--version` : Print the version number. - # Configuration -`tex4ebook` uses `tex4ht`^[http://www.tug.org/tex4ht/] for conversion from LaTeX -to html. `tex4ht` is highly configurable using config files. Basic config file +`TeX4ebook` uses `TeX4ht`^[http://www.tug.org/tex4ht/] for conversion from LaTeX +to html. `TeX4ht` is highly configurable using config files. Basic config file structure is \Preamble{xhtml, comma separated list of options} @@ -127,16 +133,16 @@ structure is \EndPreamble Basic info about command configurations can be found in a -work-in-progres *tex4ht tutorial*^[https://github.com/michal-h21/helpers4ht/wiki/tex4ht-tutorial], -*tex4ht documentation*^[http://www.tug.org/applications/tex4ht/mn11.html], +work-in-progres *TeX4ht tutorial*^[https://github.com/michal-h21/helpers4ht/wiki/tex4ht-tutorial], +*TeX4ht documentation*^[http://www.tug.org/applications/tex4ht/mn11.html], and in series of blogposts on CV Radhakrishnan's blog: -*Configure part 1*^[http://www.cvr.cc/?p=323], -*Configure part 2*^[http://www.cvr.cc/?p=362], -*Low level commands*^[http://www.cvr.cc/?p=482]. +*Configure part 1*^[https://web.archive.org/web/20180908234227/http://www.cvr.cc/?p=323], +*Configure part 2*^[https://web.archive.org/web/20180908201057/http://www.cvr.cc/?p=362], +*Low level commands*^[https://web.archive.org/web/20180909101325/http://cvr.cc/?p=482]. Available options for `\Preamble` command are listed in the article -*TeX4ht: options*^[http://www.cvr.cc/?p=504]. *Comparison of tex4ebook and Pandoc output*^[https://github.com/richelbilderbeek/travis_tex_to_epub_example_1] +*TeX4ht: options*^[https://web.archive.org/web/20180813043722/http://cvr.cc/?p=504]. *Comparison of tex4ebook and Pandoc output*^[https://github.com/richelbilderbeek/travis_tex_to_epub_example_1] -Great source of tips for `tex4ht` configuring is *tex4ht tag on TeX.sx*^[http://tex.stackexchange.com/questions/tagged/tex4ht], there is also a *tag for tex4ebook*^[http://tex.stackexchange.com/questions/tagged/tex4ebook]. +A great source of tips for `TeX4ht` configuration is *tex4ht tag on TeX.sx*^[http://tex.stackexchange.com/questions/tagged/tex4ht]. There is also a *tag for tex4ebook*^[http://tex.stackexchange.com/questions/tagged/tex4ebook]. Examples of interesting questions are *including images and fonts in ebooks*^[http://tex.stackexchange.com/a/213165/2891] @@ -149,7 +155,7 @@ or *setting image size in em units instead of pt*^[http://tex.stackexchange.com/ \Configure{UniqueIdentifier}{identifier} -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 `http://example.com/\jobname`. \Configure{@author}{\let\footnote\@gobble} @@ -161,7 +167,7 @@ which don't belongs here, such as `\footnote`. \Configure{OpfScheme}{URI} Type of unique identifier, default type is URI. It is -used only in `epub`, it is deprecated for `epub3` +used only in the EPUB format, it is deprecated for EPUB 3. \Configure{resettoclevels}{list of section types in descending order} @@ -170,7 +176,7 @@ value is the whole document hierarchy, from `\part` to `\paragraph`. \Configure{DocumentLanguage}{language code} -Each ePub file must declare the document language. It is inferred from `babel` main +Each EPUB file must declare the document language. It is inferred from `babel` main language by default, but you can configure it when it doesn't work correctly. The `language code` should be in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) form. @@ -203,11 +209,11 @@ Add item to `` section in the `OPF` file. \Configure{xmlns}{prefix}{uri} -Add xml name space to `xhtml` files. Useful in `EPUB 3` +Add `XML` name space to the generated `XHTML` files. Useful in `EPUB 3`. -## Commands available in config files +## Commands available in the config file `\OpfRegisterFile[filename]` @@ -244,53 +250,44 @@ See the `make4ht` documentation for an example and more information. # Troubleshooting +## Fixed layout EPUB + +The basic support for the Fixed layout EPUB 3 can be enabled using the following configurations: + + \Configure{OpfMetadata}{\HCode{pre-paginated}} + \Configure{OpfMetadata}{\HCode{landscape}} + \Configure{OpfMetadata}{\HCode{none}} + \Configure{@HEAD}{\HCode{\Hnewline}} + +Modify the dimensions in the `pre-paginated}} +\Configure{OpfMetadata}{\HCode{landscape}} +\Configure{OpfMetadata}{\HCode{none}} +\Configure{@HEAD}{\HCode{\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/}}. diff --git a/Master/texmf-dist/doc/support/tex4ebook/tex4ebook-doc.pdf b/Master/texmf-dist/doc/support/tex4ebook/tex4ebook-doc.pdf index 6c7fd83af08..8372406fd9d 100644 Binary files a/Master/texmf-dist/doc/support/tex4ebook/tex4ebook-doc.pdf and b/Master/texmf-dist/doc/support/tex4ebook/tex4ebook-doc.pdf differ -- cgit v1.2.3