
我剛剛意識到我的書稿的正文中缺少所有斜體(使用\textit{}
)。
我將問題範圍縮小到使用 Roboto Condensed 作為字體。
\documentclass{scrbook}
\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}
\usepackage{fbb}
%If I unclude the next line, the “text” will no longer be in italiscs
%\usepackage[condensed]{roboto}
\begin{document}
Test \textit{text}.
\end{document}
當我取消註解 Roboto 行(或只是刪除「壓縮」)時,「文字」將不再是斜體。
我查看了舊版本,並從 2019 年中期重新編譯了一個,當時斜體仍在其中。重新編譯後,斜體也消失了。我認為這與 TeX Live 2019 的變化有關。
如果有幫助,這裡是日誌的一部分,其中使用 roboto condensed 時出現問題:
(/usr/local/texlive/2020/texmf-dist/tex/latex/fbb/T1fbb-TLF.fd)
LaTeX Font Warning: Font shape `T1/fbb-TLF/c/n' undefined
(Font) using `T1/fbb-TLF/m/n' instead on input line 112.
)) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
) (./Test.aux) (/usr/local/texlive/2020/texmf-dist/tex/latex/ly1/ly1ptm.fd)
LaTeX Font Warning: Font shape `T1/fbb-TLF/c/it' undefined
(Font) using `T1/fbb-TLF/c/n' instead on input line 10.
LaTeX Font Warning: Font shape `T1/fbb-TLF/c/sl' undefined
(Font) using `T1/fbb-TLF/c/it' instead on input line 12.
[1{/usr/local/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./Test.aux)
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
答案1
由於未知原因,roboto.sty
重新定義\mddefault
為\mddefault@sf
which,選項condensed
為c
。
由於fbb
不提供壓縮系列,因此您可以進行字體替換。
這是一個也可以避免虛假警告的修復程序。
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\DeclareFontShape{T1}{cmr}{c}{n}{<->ssub*cmr/m/n}{} % avoid a spurious warning
% first roboto to avoid other spurious warnings
\usepackage[condensed]{roboto}
\usepackage{fbb}
% fix the bad declaration made by roboto
\renewcommand{\seriesdefault}{m}
\begin{document}
Test \textit{text}.
\textsf{Condensed}
\end{document}
答案2
roboto 強制該系列預設為壓縮格式 - 恕我直言,如果 roboto 僅用於無襯線字體,這是一個奇怪的選擇 - 但 fbb 不支援該系列。
\documentclass{scrbook}
%\usepackage[utf8]{inputenc} % unneeded in new systems
\usepackage[T1]{fontenc}
\usepackage{fbb}
\usepackage[condensed]{roboto}
\makeatletter
\renewcommand\seriesdefault{\mddefault\@empty}
\makeatother
\begin{document}
Test \textit{text} \sffamily Text \textit{text}
\end{document}