
如果我從答案中理解正確的話這個問題,預設的 OT1 編碼不會為我提供足夠的“字體空間”來容納正確的\l
字元。另一方面,如果啟用此選項,我似乎無法使連字(如 Th 或 Qu)正常工作。不過,我需要顯示\l
角色,並且想知道是否有辦法同時獲得兩者(使用普通LaTeX 或PDFLaTeX 作為編譯器,不想要XeLaTeX,因為它的總佈局更糟糕,恕我直言,或者至少與普通LaTeX 不同,這無論如何讓我懷疑)。
MNWE:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\title{This is Quantifiably finally ligatured text}
\begin{document}
\maketitle
I need the character \l too though.
\end{document}
對於 T1,並非所有連字都顯示:
如果沒有 T1,\l
角色不會顯示:
註解掉該fontenc
行,我得到連字,但沒有正確的\l
(預期行為,cfr.這個問題)。但我真的兩個都想要。我怎樣才能做到這一點?我會接受改變我對\l
角色的理解方式的解決方案,因為它只在非必要的文本中出現少量次。
答案1
在 OT1 之前載入 T1,取消宣告\l
為 OT1 指令並聲明其預設為 T1:
\documentclass{article}
\usepackage[T1,OT1]{fontenc}
\usepackage{libertine}
\UndeclareTextCommand{\l}{OT1}
\DeclareTextSymbolDefault{\l}{T1}
\title{This is Quantifiably finally ligatured text}
\begin{document}
\maketitle
I need the character \l{} too though.
\end{document}
當然,在包含 的單字中,您會丟失一些字距調整對和連字符\l
,但我認為這不是一個大問題。
這是從 PDF 檢視器視窗複製字形並將其貼上到 Unicode Checker 後得到的結果
更新
libertine
截至2017/03/20 發布的版本,\l
和\L
命令在 OT1 編碼下也能做正確的事情。
\documentclass{article}
\usepackage{libertine}
\title{This is Quantifiably finally ligatured text}
\begin{document}
\maketitle
I need the characters \l{} and \L{} too though.
\end{document}
答案2
另一種方法,透過重新聲明\l
為T1
字體編碼:
\documentclass{article}
\usepackage[OT1]{fontenc}
\usepackage{libertine}
\let\oldl\l
\renewcommand{\l}{\begingroup\fontencoding{T1}\selectfont\oldl\endgroup}
\title{This is Quantifiably finally ligatured text}
\begin{document}
\maketitle
I need the character \l{} too though.
\end{document}
輸出: