1

Tex4ebook seems to ignore the \setsecheadstyle command with the memoir class.

MWE:

\documentclass[ebook,12pt,oneside,openany]{memoir}

\usepackage{lipsum}

\setsecheadstyle{\normalsize\itshape\raggedright}

\title{Book}
\author{Author}
\date{}

\begin{document}

\maketitle

\frontmatter

\tableofcontents \newpage

\mainmatter

\chapter{C1}

\section{S1}

\lipsum[1]

\end{document}

Running normal Latex gives an italic section heading:

Latex output

Running tex4ebook gives the default bold section heading:

Tex4ebook output

Is there any way to fix this?

Thank you.

1 Answer 1

2

You need to specify the section format using custom CSS rule. First of all, you need to find the element which needs to configure in the HTML file:

<h3 class="sectionHead"><span class="titlemark">1.1   </span> <a 
 id="x1-30001.1"></a>S1</h3>

In this case, we need to configure h3 element with sectionHead class. We can then use the following CSS in the .cfg file:

\Preamble{xhtml}
\Css{h3.sectionHead{font-style:italic;font-weight:normal;}}
\begin{document}

\EndPreamble

The result:

enter image description here

2
  • Thanks for the solution. I am still confused about when you have to add custom css code to the config file. Are there any guidelines for this or is it trial and error? Thanks again.
    – user41974
    Feb 11, 2017 at 3:38
  • @user41974 tex4ht tries to preserve the document structure mainly. The styling is done by some default CSS styles, so if you want to change appearance of something, you usually need to figure out how it is encoded in the HTML file and provide your custom CSS.
    – michal.h21
    Feb 11, 2017 at 17:57

You must log in to answer this question.

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