1

In my mwe I change the font size for \title and \author to HUGH. I can see the change in my generated PDF but when I convert the tex to epub using tex4ebook -l main.tex only the size of \author changes. The size of \title is much smaller and seems fixed--it stays the same regardless of what I enter for a font size?

How can I specify the font size for \title that will be recognized in my .epub after I convert the tex to epub using tex4ebook?

EDIT: Never mind. I saw the issue when I loaded the epub in Mac Books. When I load the epub in ReadEra, I see NONE of the font sizes for \maketitle are observed. I think I'm learning the ebook readers are a bit of the wild west and that we have to format for the least common denominator. I.e., keep the formatting very simple. Does that ring true?

\documentclass{memoir}
\usepackage{tex4ebook}
\title{{\HUGE The Really Big Book}}
\author{{\HUGE Roger Smith}}
\date{}

\begin{document} \maketitle The doc contents. \end{document}

enter image description here

1 Answers1

1

You can use CSS to style your title. If you take a look at the HTML code generated by the \maketitle command, it looks like this:

<div class='maketitle'>

<h2 class='titleHead'>The Really Big Book</h2> <div class='author'><span class='cmr-17x-x-143'>Roger Smith</span></div><br /> <div class='date'></div> </div>

So you need to style the titleHead class that is child element of <div> with the maketitle class. You can style it using the following configuration file:

\Preamble{xhtml}
\Css{.maketitle  .titleHead{font-size:3rem;}}
\begin{document}
\EndPreamble

The \Css command can be used to pass CSS information. You can change the font-size value to your liking. Compile it using:

$ tex4ebook -c config.cfg filename.tex

This is the result:

enter image description here

michal.h21
  • 50,697