尝试以下 MWE 并运行 tex4ebook,你会发现此 epub 中忽略了小写字母。1. 为什么?2. 如何实现?
\documentclass[11pt,a4paper]{report}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\begin{document}
\textsc{A sentence with small caps of lmodern font, which is not showed in epub}
\end{document}
更新 1
当我使用.htf
第一个答案中显示的文件时,使用 calibre 电子书阅读器查看时,小写字母是可以识别的。但是尺寸设置似乎被忽略了。例如,使用 calibre 查看时,epub 文件中的\textsc{\Huge Huge Text}
或 之类的内容{\scshape\Huge Huge Text}
似乎被忽略了。感谢您提出如何解决此问题的建议。此检测的 MWE 为:
\documentclass[11pt,a4paper]{report}
\usepackage{lmodern}
%\usepackage[cmintegrals,cmbraces]{newtxmath}
%\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\begin{document}
\textsc{A sentence with small caps text of lmodern font, which is shown in epub when using the fonts option}
\Huge\textsc{Huge text in small caps is ignored when viewed in callibre with lmodern}
\begin{center}
\normalsize\scshape Another sentence with scshape command where sc is ignored in callibre\\
\LARGE LARGE text in small caps is respected but sc is ignored when viewed in callibre with lmodern
\end{center}
\end{document}
一直奔跑tex4ebook sample.tex "fonts"
。
更新 1 的问题是:为什么相对的文件中显示的尺寸设置顺序,在使用 calibre 查看时.tex
未通过tex4ebook
文件显示.epub
?准确地说:它应该是一个可解决的任务,以尊重相对顺序和\footnotesize
和\normalsize
和(在文件中使用\large
)在文件中应得到尊重。我的问题超出范围了吗?或者可以解决吗?\Huge
.tex
.epub
答案1
拉丁现代字体的字体配置文件似乎存在错误,因此有关小型大写字母的信息未传输到 CSS 文件中。正确的文件是这个ec-lm.htf
:
.lm-ec
htfcss: ec-lmbo font-style: oblique;
htfcss: ec-lmbx font-weight: bold;
htfcss: ec-lmbxi font-style:italic; font-weight: bold;
htfcss: ec-lmbxo font-style: oblique; font-weight: bold;
htfcss: ec-lmcsco font-style: oblique;
htfcss: ec-lmcs font-variant: small-caps;
htfcss: ec-lmcsc font-variant: small-caps;
htfcss: ec-lmri font-style:italic;
htfcss: ec-lmro font-style: oblique;
htfcss: ec-lmss font-family: sans-serif;
htfcss: ec-lmssbo font-family: sans-serif; font-style: oblique; font-weight: bold;
htfcss: ec-lmssbx font-family: sans-serif; font-weight: bold;
htfcss: ec-lmssdc font-family: sans-serif;
htfcss: ec-lmssdo font-family: sans-serif; font-style: oblique;
htfcss: ec-lmsso font-family: sans-serif; font-style: oblique;
htfcss: ec-lmssq font-family: sans-serif;
htfcss: ec-lmssqbo font-family: sans-serif; font-style: oblique; font-weight: bold;
htfcss: ec-lmssqbx font-family: sans-serif; font-weight: bold;
htfcss: ec-lmssqo font-family: sans-serif; font-style: oblique;
htfcss: ec-lmtcsc font-family: monospace,monospace;
htfcss: ec-lmtcso font-style: oblique; font-family: monospace,monospace;
htfcss: ec-lmtk font-family: monospace,monospace;
htfcss: ec-lmtko font-style: oblique; font-family: monospace,monospace;
htfcss: ec-lmtl font-weight: light; font-family: monospace,monospace;
htfcss: ec-lmtlc font-weight: light; font-family: monospace,monospace;
htfcss: ec-lmtlco font-weight: light; font-style: oblique; font-family: monospace,monospace;
htfcss: ec-lmtlo font-weight: light; font-style: oblique; font-family: monospace,monospace;
htfcss: ec-lmtt font-family: monospace,monospace;
htfcss: ec-lmtti font-family: monospace,monospace; font-style:italic;
htfcss: ec-lmtto font-style: oblique; font-family: monospace,monospace;
htfcss: ec-lmvtk font-family: monospace,monospace;
htfcss: ec-lmvtko font-style: oblique; font-family: monospace,monospace;
htfcss: ec-lmvtl font-weight: light; font-family: monospace,monospace;
htfcss: ec-lmvtlo font-weight: light; font-style: oblique; font-family: monospace,monospace;
htfcss: ec-lmvtt font-family: monospace,monospace;
htfcss: ec-lmvtto font-style: oblique; font-family: monospace,monospace;
或者,您可以使用“字体”选项,它将使用 HTML 标记作为字体:
$ tex4ebook sample.tex "fonts"
结果如下: