以下 MWE 说明了该问题:
\documentclass[11pt,a4paper]{report}
\usepackage{stix2}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{verse}
\usepackage{tex4ebook}
\begin{document}
\begin{verse}
Some first verse \\
some second line
This second verse\\
lacks a space between
first, second and third verse\\
in the epub via tex4ebook
when viewed both with\\
ADE and Calibre
\end{verse}
\end{document}
该如何解决?谢谢。
答案1
该问题是由于每节开头缺少段落标记引起的。可以使用以下配置文件修复:
\Preamble{xhtml}
\catcode`\:=11
\Configure{verseline}
{\ifvmode \IgnorePar\fi \EndP \end:verseln
\HCode{<div class="verseline">}\def\end:verseln{\HCode{</div>}}\par\ShowPar}
{\ifvmode \IgnorePar\fi \EndP \end:verseln
\HCode{<div class="skip-verseline">}%
\def\end:verseln{\HCode{</div>}}\par\ShowPar}
\catcode`\:=12
\begin{document}
\EndPreamble
我还将更新 TeX4ht 源,因此配置文件很快就不再需要了。