![Cabin 和 \textmu](https://linux22.com/image/352240/Cabin%20%E5%92%8C%20%5Ctextmu.png)
\textmu
使用时出现问题cabin
字体包包含pdflatex
:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[sfdefault]{cabin}
\begin{document}
\textmu{}µm
\end{document}
我已经检查过Font Squirrel 上的 Cabin 字体以及cabin
软件包附带的 OpenType 版本,它们都包含 µ 字形。取消注释前三\usepackage{...}
行并使用lualatex
或进行编译xelatex
即可正常工作。(我知道使用 进行编译时不使用 OpenType 版本pdflatex
。我只是想指出,原则上该字形应该存在于此字体中。)
我是否必须选择其他编码?或者包有问题?
我在 Windows 10 上使用 MikTeX 2.9.6211,所有软件包都应该是最新的。
答案1
编码文件cbn_cgvdav.enc
有错误。它被使用过/mu
,但查看 pdf 后发现字形的名称是/uni00B5
。
这就是 pdflatex 抱怨的原因
pdfTeX warning: pdflatex.exe (file c:/texlive/2016/texmf-dist/fonts/type1/impal
lari/cabin/Cabin-Regular.pfb): glyph `mu' undefined
你应该通知作者。http://www.ctan.org/pkg/cabin
解决方法是,您可以制作本地副本,cbn_cgvdav.enc
并将下面的两行%B0
与此处的这些行进行交换
%B0
/degree /plusminus /uni00B2 /uni00B3 /.notdef /uni00B5 /paragraph /periodcentered
/.notdef /uni00B9 /ordmasculine /.notdef /onequarter /onehalf /threequarters /Euro
答案2
更新
随着 2017-04-02 版本的发布,pfb
Cabin 字体的文件已得到修复,并且
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[sfdefault]{cabin}
\begin{document}
\textmu{}µm
\end{document}
正如预期的那样
原始答案
我尝试nfssfont
使用以下交互式会话进行编译:
> pdflatex nfssfont
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/nfssfont.tex
LaTeX2e <2017/01/01> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size10.clo))
No auxiliary output files.
**********************************************
* NFSS font test program version <v2.2d>
*
* Follow the instructions
**********************************************
Input external font name, e.g., cmr10
(or <enter> for NFSS classification of font):
\currfontname=
*** NFSS classification ***
Font encoding [T1]:
\encoding=TS1
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ts1enc.def)
Font family [cmr]:
\family=Cabin-TLF
Font series [m]:
\series=
Font shape [n]:
\shape=
Font size [10pt]:
\size=
(/usr/local/texlive/2016/texmf-dist/tex/latex/cabin/TS1Cabin-TLF.fd)
Now type a test command (\help for help):)
*\table\bye
[1{/usr/local/texlive/2016/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]{/usr/
local/texlive/2016/texmf-dist/fonts/enc/dvips/cabin/cbn_cgvdav.enc}</usr/local/
texlive/2016/texmf-dist/fonts/type1/impallari/cabin/Cabin-Regular.pfb
pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `mu' undefined
pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `onesuperior' undefined
pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `threesuperior' undefined
pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `twosuperior' undefined
></usr/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb><
/usr/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb></us
r/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></usr
/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb>
Output written on nfssfont.pdf (1 page, 52627 bytes).
Transcript written on nfssfont.log.
如果我尝试相同操作cmr
,则输出中的相关行是
因此 mu 应该在 slot 中"B5
。但是对应的行Cabin-TLF
有
根据处理过程中发出的警告。
节目之CabinCondensed-TLF
争
显然,构建Cabin-Regular.pfb
文件时出了问题。
您应该向 Bob Tennent 提交错误报告。目前,您可以使用精简版本来避免这种情况:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[sfdefault]{cabin}
\makeatletter
\DeclareRobustCommand{\textmu}{%
{\usefont{TS1}{CabinCondensed-TLF}{\f@series}{\f@shape}\symbol{"B5}}%
}
\makeatother
\begin{document}
\textmu{}µm
\end{document}
答案3
作者cabin
软件包的作者 Bob Tennent 向我发送了错误文件的更正版本Cabin-Regular.pfb
。(参见埃格尔的答案)。
我已将更正后的文件上传至此处:http://www.wikiupload.com/HWPLWMIV5RG3QJ5。