\usepackage[scaled]{helvet} 在 Mac 上使用 BasicTeX 失败

\usepackage[scaled]{helvet} 在 Mac 上使用 BasicTeX 失败

我有一个简短的乳胶程序,当我使用以下命令时编译失败:

\usepackage[scaled]{helvet}

我怀疑这是在 Mac 上使用 BasicTeX 的问题,因为我已经在很多地方看到过这种构造,所以我相信它应该在正常条件下工作。

以下是该程序。

\documentclass{article}
%
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[scaled]{helvet}
%
% change the default font to sans-serif
%
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
Hello World!
\end{document}

这是错误输出。

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
(./hello.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 21 languages loaded.
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/base/t1enc.def))
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/base/textcomp.sty
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/psnfss/helvet.sty
(/usr/local/texlive/2013basic/texmf-dist/tex/latex/graphics/keyval.sty))
(./hello.aux) (/usr/local/texlive/2013basic/texmf-dist/tex/latex/base/ts1cmr.fd
) (/usr/local/texlive/2013basic/texmf-dist/tex/latex/psnfss/t1phv.fd)
kpathsea: Running mktextfm phvr8t
/usr/local/texlive/2013basic/texmf-dist/web2c/mktexnam: Could not map source abbreviation  for phvr8t.
/usr/local/texlive/2013basic/texmf-dist/web2c/mktexnam: Need to update ?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input phvr8t
This is METAFONT, Version 2.718281 (TeX Live 2013)


kpathsea: Running mktexmf phvr8t
! I can't find file `phvr8t'.
<*> ...:=ljfour; mag:=1; nonstopmode; input phvr8t

Please type another input file name
! Emergency stop.
<*> ...:=ljfour; mag:=1; nonstopmode; input phvr8t

Transcript written on mfput.log.
grep: phvr8t.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input phvr8t' failed to make phvr8t.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font T1/phv/m/n/10=phvr8t at 9.49997pt not loadable: Metric (TFM) file not found.
<to be read again> 
                   relax 
l.10 \begin{document}

以下要点建议安装 texlive-fonts-extra 或 urw-base35,但不确定如何在 Mac 上执行此操作。

https://gist.github.com/fernandomantoan/3751190

谢谢。

答案1

TeX Live 提供tlmgr更新、维护和管理安装。如果您最初没有安装完整的 TeX 安装,则可以使用它升级到更大的版本scheme或安装特定的collectionspackages

TeX Live 软件包名称通常与 eg 发行版打包 TL 时使用的名称不一致。因此您需要做一些侦查工作来弄清楚要tlmgr安装什么。

tlmgr help

详细介绍了该设施的所有优点。您可以说

tlmgr info

获取 的列表packages。但是,这会很大。相反,尝试

tlmgr info collections

collections获取(相关软件包组)列表。在我的系统上,我获取

tlmgr: package repository http://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet
i collection-basic: Essential programs and files
i collection-bibtexextra: BibTeX additional styles
i collection-binextra: TeX auxiliary programs
i collection-context: ConTeXt and packages
i collection-fontsextra: Additional fonts
i collection-fontsrecommended: Recommended fonts
i collection-fontutils: Graphics and font utilities
i collection-formatsextra: Additional formats
i collection-games: Games typesetting
i collection-genericextra: Generic additional packages
i collection-genericrecommended: Generic recommended packages
i collection-htmlxml: HTML/SGML/XML support
i collection-humanities: Humanities packages
i collection-langafrican: African scripts
i collection-langarabic: Arabic
i collection-langcjk: Chinese/Japanese/Korean
i collection-langcyrillic: Cyrillic
i collection-langczechslovak: Czech/Slovak
i collection-langenglish: US and UK English
i collection-langeuropean: Other European languages
i collection-langfrench: French
i collection-langgerman: German
i collection-langgreek: Greek
i collection-langindic: Indic scripts
i collection-langitalian: Italian
i collection-langother: Other languages
i collection-langpolish: Polish
i collection-langportuguese: Portuguese
i collection-langspanish: Spanish
i collection-latex: LaTeX fundamental packages
i collection-latexextra: LaTeX additional packages
i collection-latexrecommended: LaTeX recommended packages
i collection-luatex: LuaTeX packages
i collection-mathextra: Mathematics packages
i collection-metapost: MetaPost and Metafont packages
i collection-music: Music packages
i collection-omega: Omega packages
i collection-pictures: Graphics, pictures, diagrams
i collection-plainextra: Plain TeX packages
i collection-pstricks: PSTricks
i collection-publishers: Publisher styles, theses, etc.
i collection-science: Natural and computer sciences
i collection-texworks: TeXworks editor
  collection-wintools: Windows-only support programs
i collection-xetex: XeTeX and packages

这将向我显示我正在使用的存储库、collections可用的存储库以及已安装的存储库(标记为i)。由于我安装了完整版的 TeX,因此几乎所有存储库都安装在这里。如果您安装了较小的版本,则会有较少的is。有几个collections提到了字体:

i collection-fontsextra: Additional fonts
i collection-fontsrecommended: Recommended fonts
i collection-fontutils: Graphics and font utilities

最后一个听起来不太可能。前两个是可能的。Helvetica 相当标准,因此很可能会推荐它。所以从那里开始是有意义的。要获取有关的信息collection和列表,packages它包括:

tlmgr info --list collection-fontsrecommended

这让我

package:     collection-fontsrecommended
category:    Collection
shortdesc:   Recommended fonts
longdesc:    Recommended fonts, including the base 35 PostScript fonts, Latin Modern, TeX Gyre, and T1 and other encoding support for Computer Modern, in outline form.
installed:   Yes
revision:    32620
sizes:       
relocatable: No
depends:
        collection-basic
        avantgar
        bookman
        charter
        cm-super
        cmextra
        courier
        ec
        euro
        euro-ce
        eurosym
        fpl
        helvetic
        lm
        lm-math
        marvosym
        mathpazo
        ncntrsbk
        palatino
        pxfonts
        rsfs
        symbol
        tex-gyre
        tex-gyre-math
        times
        tipa
        txfonts
        utopia
        wasy
        wasysym
        zapfchan
        zapfding
Included files, by type:

现在您可以决定是安装整个集合还是安装选定的包。或者,您当然可以请求有关特定包的更多信息:

tlmgr info helvetic

这告诉我:

package:     helvetic
category:    Package
shortdesc:   URW "Base 35" font pack for LaTeX.
longdesc:    A set of fonts for use as "drop-in" replacements for Adobe's basic set, comprising: - Century Schoolbook (substituting for Adobe's New Century Schoolbook); - Dingbats (substituting for Adobe's Zapf Dingbats); - Nimbus Mono L (substituting for Abobe's Courier); - Nimbus Roman No9 L (substituting for Adobe's Times); - Nimbus Sans L (substituting for Adobe's Helvetica); - Standard Symbols L (substituting for Adobe's Symbol); - URW Bookman; - URW Chancery L Medium Italic (substituting for Adobe's Zapf Chancery); - URW Gothic L Book (substituting for Adobe's Avant Garde); and - URW Palladio L (substituting for Adobe's Palatino).
installed:   Yes
revision:    31835
sizes:       run: 2377k
relocatable: No
cat-date:    2012-06-06 22:57:48 +0200
cat-license: gpl
collection:  collection-fontsrecommended

答案2

在字体方面,我也很难找到合适的软件包。在 Mac 上,我建议使用 GUI 程序“TeX Live Utility”(TLU):

在此处输入图片描述

搜索字段使该过程(通常)非常简单。此处建议的其他答案tlmgr确实提供了比 TLU 更多的选项/可能性,因此最好了解两者。

相关内容