1

Debian appears to load tex4ebook and tex4ht as part of TeXLive. I can run the packages, but they are not found by Synaptic. tex4ebook creates an EPUB document, but the SHOW METADATA function of calibre shows the work as untitled and the author as anonymous. So I am hoping to find a way to add these data items in the configuration file. Of course, the author always is the same, but each document has a unique title, so I hope to avoid modification of the LaTeX files for EPUB, because they also produce PDF.

2
  • These metadata should be imported from \title and \author. Do you use them in your document?
    – michal.h21
    Jul 7, 2021 at 7:02
  • No. That was the problem.
    – russ
    Jul 7, 2021 at 14:13

1 Answer 1

0

tex4ebook takes the author and title metadata from your document, so the easiest way how to add them is to use normal \title and \author commands:

\documentclass{article}
\begin{document}
\title{Hello World}
\author{Russ}
\maketitle
hello
\end{document}

This produces the following metadata:

<dc:title>Hello World</dc:title> 
<dc:language>en-US</dc:language> 
<dc:identifier id="dcidid"  opf:scheme="URI">http://example.com/sample</dc:identifier> 
<dc:creator>Russ</dc:creator> 

If you don't use these commands, you can set metadata from a custom config file:

\Preamble{xhtml}
\begin{document}
\def\Author{Russ}
\def\Title{Hello from the config file}
\EndPreamble

Compile using:

tex4ebook -c mycfg.cfg sample.tex
1
  • I thank you. A contractor wrote for me a customized .CLS file to produce a PDF header. I did not think to check that until I went to bed; that surely is the source of the problem.
    – russ
    Jul 7, 2021 at 14:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .