2

I want to compile my document with tex4ebook texlive. But it found a few errors, first of them is "!Undefined control sequence. \cw:TITLE+ ->\titlefont Title 1.104 \begin{document}"

In my document I have that lines:

\font\titlefont=cmr12 at 40pt
\title {\titlefont Title}

It compile nicely in pdf format. How I can to fix that errors with tex4ebook?

My document (with a few editing (name, title, etc.)

\documentclass[12pt, twodise]{book}
\usepackage[polish, russian, english]{babel}
\usepackage[babel,autostyle=true]{csquotes}
\MakeOuterQuote{"}
\selectlanguage{english}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage{indentfirst}
\usepackage{needspace}
\usepackage{comment}
\usepackage[inner=0.75in, outer=0.75in, top=0.75in, bottom=0.75in, paperwidth=6in, paperheight=9in]{geometry}% inner=0.875in
%\usepackage{changepage}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{anyfontsize}
\usepackage{xargs}
\usepackage{epigraph}
\usepackage{afterpage}
\usepackage[figuresright]{rotating}
\usepackage{lettrine}
\usepackage{yfonts}
\usepackage{dpfloat}
\usepackage{nopageno}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[font=Large,labelfont=Large]{caption}
\graphicspath{{"graphics/"}}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\setlength{\parskip}{1em}

\newcommandx{\spic}[3][1=0,2]{
    \clearpage
    \noindent\begin{minipage}[t][\dimexpr\textheight-6pt\relax][c]{\textwidth}
    \centering\includegraphics[angle=#1, width=\textwidth]{#3}
    %\caption*{#2}
    \end{minipage}
    \clearpage
}
\newcommandx{\pic}[3][1=0,2]{
    \begingroup
    \clearpage
    \newpage
    \vspace*{3in}  
    \centering{\Large #2}
    \newpage
    \begin{minipage}[t][\dimexpr\textheight-6pt\relax][c]{\textwidth}
    \center{\includegraphics[angle=#1, width=\textwidth]{#3}}
    %\caption*{#2}
    \end{minipage}
    \clearpage
    \endgroup
}
\newcommandx{\lpic}[3][1=0, 2=]{
    \newpage
%   \clearpage
%   \thispagestyle{empty}
    \begin{sidewaysfigure}[ht]
    \center{\includegraphics[angle=#1, width=0.8\textheight]{#3}}
    \caption*{#2}
    \end{sidewaysfigure}
}
\newcommand\blankpage{
    \null
    %\thispagestyle{empty}
    %\addtocounter{page}{-1}
    \newpage
}
\newcommand{\tmpx}{}
\newcommand\tmp[1]{\renewcommand{\tmpx}{#1}}
\fancypagestyle{capt}{\fancyfoot[R]{\tmpx}}
\newcommandx{\twosidepic}[2][2]{
    \clearpage
    \begingroup
    \sbox0{\includegraphics{#1}}
    %\tmp{#2}\thispagestyle{capt}
    \begin{figure}[p]% will be the left-side figure
    \begin{leftfullpage}
    \noindent\begin{minipage}[t][\textheight][c]{\paperwidth}
    \hspace*{-2\leftmargin}
    \includegraphics[trim=0 0 {.5\wd0} 0,width=\dimexpr\paperwidth\relax,clip]{#1}
    \captionsetup{font = Large, labelfont=Large, singlelinecheck = false, format= hang, justification=raggedleft, labelsep=space}
    \caption*{}
    \end{minipage}
    \end{leftfullpage}
    \end{figure}
    \begin{figure}[p]
    \begin{fullpage}
    \noindent\begin{minipage}[t][\textheight][c]{\paperwidth}
    \hspace*{-2\leftmargin}
    \includegraphics[trim={.5\wd0} 0 0 0,width=\dimexpr\paperwidth\relax,clip]{#1}
    \captionsetup{font = Large, labelfont=Large, singlelinecheck = false, format= hang, labelsep=space, justification=centering} %justification=justified
    \caption*{#2}
    \end{minipage}
    \end{fullpage}
    \end{figure}
    \endgroup
}
% \pagestyle{fancy}
 \fancyhf{}
 \fancypagestyle{alim}{\fancyhf{}\renewcommand{\headrulewidth}{0pt}\fancyfoot[C]{\arabic{page}}}

\addto\captionsenglish{\renewcommand{\figurename}{}}

\begin{document}

%\def\pageformatTexOdd{}
\font\titlefont=cmr12 at 40pt
\font\authorfont=cmr12 at 24pt
%\fontsize{20}{20pt}\selectfont
\date{}
\title {\titlefont .........}
\author {\authorfont .........}
\maketitle
\blankpage
\epigraph {``............''} {\textit{.........}}
\blankpage
\pic{_SDC2222}
\twosidepic{_SDC3333}
\spic{_SDC4444}
\spic{_SDC5555}

\blankpage
\chapter*{sec1}
\addcontentsline{toc}{section}{sec1}
\thispagestyle{alim}
asdfgafsdgasdfvasdfvadf

\textbf{dsfsdfsd.}
\textit{DSFasdfsdfasdfgsdfgsdfgsdgfsdfgsdfgdsfgs.}\\
dfgadfgadfgadfgadfgadfgadfgadfg


%\end{comment}
\end{document}
3
  • can you please make a complete MWE? I cannot reproduce your issue, but it may be caused by a interaction between packages.
    – michal.h21
    Commented May 21, 2020 at 12:09
  • Thanks for the answer. I do not know what MWE is, but I am editing my post by adding a short version of my document.
    – Vladimir
    Commented May 21, 2020 at 12:30
  • @Vladimir: book doesn't provide a twodise option.
    – Werner
    Commented May 21, 2020 at 18:50

1 Answer 1

1

You can neutralize macros that cause issues in the \title command using \Configure{@TITLE}. The problem is that it's contents are reused in the <title> element in the HTML header, which shouldn't contain any child elements.

Save the following code as myconfig.cfg:

\Preamble{xhtml}
\Configure{@TITLE}{\let\titlefont\relax}
\begin{document}
\EndPreamble

Compile your file using

tex4ebook -c myconfig.cfg filename.tex

This is the result:

enter image description here

You must log in to answer this question.

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