我已经在 安装了 texlive ~/texlive
。
我已经使用 进行了collection-fontsrecommended
安装tlmgr
。
现在,~/texlive/2014/texmf-dist/fonts/
有几个文件夹:afm
,,,,…… 。cmap
enc
vf
以下是输出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
但是当我尝试编译时:
\documentclass{article}
\usepackage{helvetic}
\begin{document}
Hello World!
\end{document}
它给出了一个错误:
! LaTeX Error: File `helvetic.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
我原本期望文档使用 Helvetica 字体排版。显然,我做错了。
我该如何纠正这种情况?
答案1
由于您希望使用 TeX Live 而不是系统字体,因此最好查找有关字体的信息包您可以使用的字体文件列表。这是因为大多数软件包将包含许多不同的文件,texmf-dist/fonts
并且这些文件与软件包名称的关系并不总是很明显。(目录名称可能是一个更好的指南,但仍然不是很好。)
要了解原因,有必要思考一下 下包含的不同类型的文件texmf-dist/fonts
。在我的计算机上,我有以下文件:
afm/ cid/ cmap/ enc/ fea/ lig/ map/ misc/ ofm/ opentype/ ovf/ ovp/ pfm/ pk/ sfd/ source/ tfm/ truetype/ type1/ vf/
afm
文件是 Adobe Font Metrics。据我所知,TeX 并不直接使用这些文件,但它们可用于创建其他文件。cmap
文件用于支持搜索。例如,它们有助于将 PDF 中的字符映射到可搜索的字符。(它们可能还有其他我不知道的用途。)enc
文件指定字体的各种编码,TeX 需要确定哪个“插槽”包含哪个字符。fea
我认为,和lig
是用于 的特征和连字符文件。fontspec
map
帮助 TeX 找出哪个字体文件对应哪种字体,以及字体编码是否已被改变。opentype
不言自明。pfm
字体规格的格式与afm
文件不同。两者可以互相转换。pk
根据元字体源预先准备的字体。sfd
??(FontForge 字体来源?)source
用于生成pk
文件的元字体源(根据需要在上方或在排版过程中即时生成)tfm
TeX 字体度量标准是从afm
或pfm
文件生成的,并与其他信息一起生成。就 TeX 而言,这些是字体。但是,它们不包括字形。也就是说,它们不包括字符的“图片”。相反,它们包含有关容纳这些字符所需的框的信息,如何调整框对之间的间距,何时用不同的框替换两个框,框尺寸等。(TeX 排版框。像其他一切一样,字符是一个框。)就 pdfTeX 而言,这些不是字体 - 它还需要图片。truetype
不言自明。type1
有点不言自明。这些文件包含只不过字符图片。如果没有度量信息,它们就毫无用处。(Postscript 字体随 type1 字体文件(.pfb
或.pfa
)和度量文件(.afm
或pfm
)一起发布。与 opentype 和 truetype 字体不同,没有单个文件是 postscript type1 字体。vf
复杂。这些是“虚拟字体”。它们告诉 TeX 如何从其他字体创建新字体。例如,如果您想将补充字体中的旧式数字和连字与主字体中的字符组合在一起,您可以创建一个虚拟字体,从每个字体中取出适当的字符并将它们组合起来。然后 TeX 可以将此字体视为用于排版目的的单一字体。虚拟字体文件告诉 TeX 在哪里可以找到构建虚拟字体所需的各种信息和字形。(传统上,旧式数字、小型大写字母和连字通常在单独的.pfb
或.pfa
文件中提供。要将它们与 TeX 一起使用,您需要使用附加文件中的字符以及主文件中的字符创建组合字体。)这些文件还可用于“伪造”实际字体中不存在的字形,以近似小型大写字母或倾斜形状,并提供各种其他功能。
与其从这些目录的内容中找出你有哪些字体,不如先查找字体包它为文件组提供了一个一致的界面,共同支持整个字体和它们的系列。
由于您使用的是 TeX Live,因此您可以使用 获取有关可用字体包的一些信息tlmgr
。
这里有几种不同的选择。tlmgr
使用“分类法”的概念,可用于根据各种分类(例如characterization
或)搜索包keyword
。让我们举keyword
个例子。
我们首先需要知道有哪些关键字可用:
tlmgr search --list --keyword
会给我们一个列表:
Keywords:
Computer Science
DVI file manipulation
Humanities
Mathematics (the subject)
MetaFont, Metapost
Physics, Chemistry, Biology
Social Science
URLs, hyperlinks
abbreviations, acronyms
abstract
alignment
appendix
arrays, matrices
arrows
article style
author
bibliography, formatting
bibliography, management
book style
boxed text, frames
calendar, schedule
caption
changebars
chapters, sectioning
collections, proceedings, conferences
color
columns, multiple columns
commutative diagrams
computer code, verbatim text
cross references
dates and times
distributions, whole systems
document style
dropped letter, often initial letter
editing, graphical work environment
encodings, Unicode
equations, subequations
exams, exercises, answers
external programs, interfacing
figures, floating matter
foils, overhead slides
font selection
fonts, mathematics
fonts, text
footnotes, end notes
front matter, end matter
glossary, dictionary
graphics created inside TeX (pictures, PSTricks, PGF, etc.)
graphics from outside TeX
headers, footers
help, documentation, FAQ
hyphenation
include file
index, indexing
justification
languages other than English
letters, envelopes, labels
lists, bullets
literate programming
macro programming
make, compilation systems
marginal material
minipage
music
output format PDF, PostScript
output format other than PDF (HTML, etc.)
output viewer
page breaks
page geometry (margins, etc.)
page numbering
page styles
paper size, orientation
paragraph
presentations (powerpoint-like, using a beamer)
proof sheets (typographical)
proofs
publisher's style
punctuation
quotation, poetry
report style
scientific units
spacing, horizontal or vertical
symbols, mathematical
symbols, text
table of contents
tables
text decoration (underline, etc.)
theorems
thesis style
title, maketitle
vita, CV, resume
watermark, draftmark
word processor conversion
wrap around a figure
这里有几个与字体有关:font selection
和。最后两个听起来特别有希望,所以让我们尝试一下fonts, text
。fonts, mathematics
首先,对于文本:
tlmgr search --keyword "fonts, text"
amiri - A classical Arabic typeface, Naskh style.
berenisadf - Berenis ADF fonts and TeX/LaTeX support.
calligra-type1 - Type 1 version of Calligra.
cantarell - LaTeX support for the Cantarell font family.
cm-unicode - Computer Modern Unicode font family.
comfortaa - Sans serif font, with LaTeX support.
dejavu - LaTeX support for the DejaVu fonts.
droid - LaTeX support for the Droid font families.
fntproof - A programmable font test pattern generator.
fontbook - Generate a font book.
fonts-tlwg - Thai fonts for LaTeX from TLWG.
fundus-calligra - Support for the calligra font in LaTeX documents.
fundus-sueterlin - Sutterlin
gillcm - Alternative unslanted italic Computer Modern fonts.
gnu-freefont - A Unicode font, with rather wide coverage.
hacm - Font support for the Arka language.
ipaex - IPA and IPAex fonts from Information-technology Promotion Agency, Japan.
latex-fonts - A collection of fonts used in LaTeX distributions.
lato - Lato font family and LaTeX support.
lcyw - Make Classic Cyrillic CM fonts accessible in LaTeX.
lfb - A Greek font with normal and bold variants.
lh - Cyrillic fonts that support LaTeX standard encodings.
libris - Libris ADF fonts, with LaTeX support.
linearA - Linear A script fonts.
lm - Latin modern fonts in outline formats.
marvosym - Martin Vogel's Symbols (marvosym) font.
mathcomp - Text symbols in maths mode.
mdsymbol - Symbol fonts to match Adobe Myriad Pro.
mex - Polish formats for TeX.
mf2pt1 - Produce PostScript Type 1 fonts from Metafont source.
mxedruli - A pair of fonts for different Georgian alphabets.
nkarta - A "new" version of the karta cartographic fonts.
ocherokee - LaTeX Support for the Cherokee language.
ocr-b - Fonts for OCR-B.
ogham - Fonts for typesetting Ogham script.
oldstandard - Old Standard: A Unicode Font for Classical and Medieval Studies.
opensans - The Open Sans font family, and LaTeX support.
orkhun - A font for orkhun script.
pacioli - Fonts designed by Fra Luca de Pacioli in 1497.
paratype - LaTeX support for free fonts by ParaType.
phaistos - Disk of Phaistos font.
phonetic - Metafont Phonetic fonts, based on Computer Modern.
pigpen - A font for the pigpen (or masonic) cipher.
poltawski - Antykwa Poltawskiego Family of Fonts.
psnfss - Font support for common PostScript fonts.
punk - Donald Knuth's punk font.
punknova - OpenType version of Knuth's Punk font.
pxfonts - Palatino-like fonts in support of mathematics.
pxgreeks - Shape selection for PX fonts Greek letters.
recycle - A font providing the "recyclable" logo.
sanskrit - Sanskrit support.
sauter - Wide range of design sizes for CM fonts.
staves - Typeset Icelandic staves and runic letters.
stix - OpenType Unicode maths fonts.
superiors - Attach superior figures to a font family.
tabfigures - Maintain vertical alignment of figures.
tapir - A simple geometrical font.
tipa - Fonts and macros for IPA phonetics characters.
trajan - Fonts from the Trajan column in Rome.
txgreeks - Shape selection for TX fonts Greek letters.
typeface - Select a balanced set of fonts.
uhc - Fonts for the Korean language.
umtypewriter - Fonts to typeset with the xgreek package.
universa - Herbert Bayer's 'universal' font.
utopia - Adobe Utopia fonts.
wadalab - Wadalab (Japanese) font packages.
wnri - Ridgeway's fonts.
wsuipa - International Phonetic Alphabet fonts.
xecjk - Support for CJK documents in XeLaTeX.
xepersian - Persian for LaTeX, using XeTeX.
xits - A Scientific Times-like font with support for mathematical typesetting.
yannisgr - Greek fonts by Yannis Haralambous.
对于数学来说:
tlmgr search --keyword "fonts, mathematics"
a0poster - Support for designing posters on large paper.
accfonts - Utilities to derive new fonts from existing ones.
ae - Virtual fonts for T1 encoded CMR-fonts.
aeguill - Add several kinds of guillemets to the ae fonts.
allrunes - Fonts and LaTeX package for almost all runes.
amsfonts - TeX fonts from the American Mathematical Society.
antt - Antykwa Torunska: a Type 1 family of a Polish traditional type.
arabtex - Macros and fonts for typesetting Arabic.
aramaic-serto - Fonts and LaTeX for Syriac written in Serto.
archaic - A collection of archaic fonts.
arev - Fonts and LaTeX support files for Arev Sans.
arphic - Arphic (Chinese) font packages.
augie - Calligraphic font for typesetting handwriting.
auncial-new - Artificial Uncial font and LaTeX support macros.
aurical - Calligraphic fonts for use with LaTeX in T1 encoding.
b1encoding - LaTeX encoding tools for Bookhands fonts.
bbding - A symbol (dingbat) font and LaTeX macros for its use.
bbm - "Blackboard-style" cm fonts.
bbm-macros - LaTeX support for "blackboard-style" cm fonts.
bbold - Sans serif blackboard bold.
bbold-type1 - An Adobe Type 1 format version of the bbold font.
belleek - Free replacement for basic MathTime fonts.
bera - Bera fonts.
beton - Use Concrete fonts.
blacklettert1 - T1-encoded versions of Haralambous old German fonts.
boisik - A font inspired by Baskerville design.
bold-extra - Use bold small caps and typewriter fonts.
boondox - Mathematical alphabets derived from the STIX fonts.
brushscr - A handwriting script font.
calligra - Calligraphic font.
calrsfs - Copperplate calligraphic letters in LaTeX.
casyl - Typeset Cree/Inuktitut in Canadian Aboriginal Syllabics.
cbcoptic - Coptic fonts and LaTeX macros for general usage and for philology.
cc-pl - Polish extension of Computer Concrete fonts.
charter - Charter fonts.
cherokee - A font for the Cherokee script.
cm - Computer Modern fonts.
cm-lgc - Type 1 CM-based fonts for Latin, Greek and Cyrillic.
cm-super - CM-Super family of fonts
cm-unicode - Computer Modern Unicode font family.
cmbright - Computer Modern Bright fonts.
cmcyr - Computer Modern fonts with cyrillic extensions.
cmpica - A Computer Modern Pica variant.
cmsd - Interfaces to the CM Sans Serif Bold fonts.
cmtiup - Upright punctuation with CM italic.
concmath - Concrete Math fonts.
concmath-fonts - Concrete mathematics fonts.
concrete - Concrete Roman fonts.
cryst - Font for graphical symbols used in crystallography.
cyklop - The Cyclop typeface.
dancers - Font for Conan Doyle's "The Dancing Men".
doublestroke - Typeset mathematical double stroke symbols.
duerer - Computer Duerer fonts.
dutchcal - A reworking of ESSTIX13, adding a bold version.
ec - Computer modern fonts in T1 and TS1 encodings.
ecc - Sources for the European Concrete fonts.
eiad - Traditional style Irish fonts.
elmath - Mathematics in Greek texts.
epiolmec - Typesetting the Epi-Olmec Language.
esint - Extended set of integrals for Computer Modern.
esint-type1 - Font esint10 in Type 1 format
esstix - PostScript versions of the ESSTIX, with macro support.
ethiop - LaTeX macros and fonts for typesetting Amharic.
ethiop-t1 - Type 1 versions of Amharic fonts.
eulervm - Euler virtual math fonts.
euro-ce - Euro and CE sign font.
eurosym - Metafont and macros for Euro sign.
fc - Fonts for African languages.
fdsymbol - A maths symbol font.
fntproof - A programmable font test pattern generator.
foekfont - The title font of the Mads Fok magazine.
fontbook - Generate a font book.
fourier - Using Utopia fonts in LaTeX documents.
fpl - SC and OsF fonts for URW Palladio L
frcursive - French cursive hand fonts.
gothic - A collection of old German-style fonts.
greektex - Fonts for typesetting Greek/English documents.
hfbright - The hfbright fonts.
hyphenat - Disable/enable hypenation.
ibygrk - Fonts and macros to typeset ancient Greek.
ifsym - A collection of symbols.
inconsolata - A monospaced font, with support files for use with TeX.
initials - Adobe Type 1 decorative initial fonts.
iwona - A two-element sans-serif font.
junicode - A TrueType font for mediaevalists.
kerkis - Kerkis (Greek) font family.
kpfonts - A complete set of fonts for text and mathematics.
kurier - A two-element sans-serif typeface.
latex-fonts - A collection of fonts used in LaTeX distributions.
libgreek - Use Libertine or Biolinum Greek glyphs in mathematics.
lm - Latin modern fonts in outline formats.
lm-math - OpenType maths fonts for Latin Modern.
mathabx - Three series of mathematical symbols.
mathabx-type1 - Outline version of the mathabx fonts.
mathdesign - Mathematical fonts to fit with particular text fonts.
mathpazo - Fonts to typeset mathematics to match Palatino.
mathspec - Specify arbitrary fonts for mathematics in XeTeX.
mdputu - Upright digits in Adobe Utopia Italic.
mdsymbol - Symbol fonts to match Adobe Myriad Pro.
mex - Polish formats for TeX.
mf2pt1 - Produce PostScript Type 1 fonts from Metafont source.
mnsymbol - Mathematical symbol font for Adobe MinionPro.
prodint - A font that provides the product integral symbol.
pxfonts - Palatino-like fonts in support of mathematics.
pxtxalfa - Virtual maths alphabets based on pxfonts and txfonts.
rsfs - Ralph Smith's Formal Script font.
sansmathaccent - Correct placement of accents in sans-serif maths.
sauter - Wide range of design sizes for CM fonts.
shuffle - A symbol for the shuffle product.
stmaryrd - St Mary Road symbols for theoretical computer science.
tex-gyre-math - Maths fonts to match tex-gyre text fonts.
trsym - Symbols for transformations.
txfonts - Times-like fonts in support of mathematics.
typeface - Select a balanced set of fonts.
urwchancal - Use URW's clone of Zapf Chancery as a maths alphabet.
xits - A Scientific Times-like font with support for mathematical typesetting.
yhmath - Extended maths fonts for LaTeX.
从此列表中,您可以选择要进一步调查的软件包。可以通过多种方式获取有关任何特定软件包的更多信息。首先,tlmgr
它本身可以提供有关软件包的基本信息:
tlmgr info urwchancal
package: urwchancal
category: Package
shortdesc: Use URW's clone of Zapf Chancery as a maths alphabet.
longdesc: The package allows (the URW clone of) Zapf Chancery to function as a maths alphabet, the target of \mathcal or \mathscr, with accents appearing where they should, and other spacing parameters set to reasonable (not very tight) values. This package supersedes the pzccal package.
installed: Yes
revision: 21701
sizes: doc: 37k, run: 17k
relocatable: Yes
cat-version: 1
cat-date: 2014-02-26 23:03:13 +0100
cat-license: lppl
collection: collection-fontsextra
第二,texdoc
可以用来检查本地安装的文档:
texdoc urwchancal
有时,texdoc
它不会为您提供最有用的文档。在这种情况下,您也可以查看texmf-dist/doc/fonts/<packagename>
是否有其他可用内容。
最后,正如其他人所说,如果你想以更直观的方式选择字体,字体目录允许您浏览各种可能性。但请注意,并非所有列出的字体都会安装在您的机器上,因为并非所有字体都是 TeX Live 的一部分。但是,此信息是作为字体目录记录的一部分提供的。
附录
如果您要使用的字体是基本 PostScript 字体之一,例如 Helvetica,则texdoc psnfss
提供有关使用的信息。手册告诉我们,要使用 Helvetica,我们需要
\usepackage{helvet}% See notes about scaling if using in combination with something like Times
但是,由于 Helvetica 是无衬线字体,因此它本身不会将 Helvetica 用于正文。该软件包的作用是安装 Helvetica(实际上是克隆)作为默认的无衬线字体系列。要使用它,您必须切换到无衬线字体:
\sffamily abc
或者
\textsf{abc}
如果您希望整个文档使用无衬线字体,则可以将默认衬线系列更改为与无衬线字体匹配:
\documentclass{article}
\usepackage{helvet}
\renewcommand*{\rmdefault}{\sfdefault}
\begin{document}
Hello World!
\end{document}