Many TrueType and OpenType fonts have been packaged, chiefly to bring those using latex
and pdflatex
some of the variety enjoyed by those using xelatex
and lualatex
. Many, if not all, of the packages can be used with xelatex
and lualatex
as well as latex
and pdflatex
, and that’s convenient for anyone who hasn’t yet decided on an engine or who plans to share the source file with others and doesn’t know which engine they use. It’s also convenient for users of xelatex
or lualatex
who haven’t the time or the inclination to read the fontspec
manual or to study the features of a font — but I don’t imagine that very many people fall into that group, because the most obvious attraction of xelatex
and lualatex
is their handling of fonts.
Not all packages provide options for all features. Fonts like EB Garamond are so rich in features that an adequate discussion would be too long here, so let’s consider a small and relatively simple font, Quattrocento. Its features, as reported by otfinfo
, are:
aalt Access All Alternates
frac Fractions
kern Kerning
liga Standard Ligatures
ordn Ordinals
salt Stylistic Alternates
sups Superscript
The package provides several options, among them rm
, sf
, sfdefault
, and scaling. There is no option for using the superiors, like the footnotefigures
option of MinionPro
, but that’s probably good because the font has superiors only for 1–3 (if compatibility with pdflatex
is unnecessary, you can load realscripts
, but expect trouble with more than three footnotes). Also, there’s no option for using the stylistic alternates, which affect M, W, and Q.
Now, it’s possible to get the alternates anyway, like this:
\documentclass{article}
\usepackage{quattrocento}
\begin{document}
My Wee Quokka
\addfontfeatures{Style=Alternate}
My Wee Quokka
\end{document}
That works because quattrocento.sty
loads fontspec
when used with xelatex
or lualatex
. (As cfr noted, not all packages do this.) For the same reason, you can also write \defaultfontfeatures{Style=Alternate}
after \usepackage{quattrocento}
, but it will have no effect precisely because it’s loaded afterward.
Of course, using \addfontfeatures{...}
in your document means losing the advantage of compatibility with other engines. As for the other advantage of the packages, namely, not having to read the fontspec
manual and examine the fonts, if you haven’t done those things, you won’t know that these features exist and that you can get them with \addfontfeatures{...}
. Personally, I’d rather read the fontspec
documentation and examine the fonts I like than spend time reading the documentation for many font packages.
It’s worth noting that some packages are based on Google’s web fonts rather than the originals, and that web fonts are optimized for the web, not for printing. For example, some or all alternates may be removed to speed up the downloading of a web font; in such cases, packages built from the web fonts will also lack the alternates. And sometimes web fonts add artificial italics or bold weights, good enough for the web but not for print.
Even if a packager wants to make every feature of an OpenType font available through package options, some features may be difficult or impossible to implement for pdflatex
. An example is randomization; I’m no programmer, but I can’t imagine how that would be done in pdflatex
. If the packager doesn’t want to add an option that works only for some engines, users of xelatex
or lualatex
who assume that the package does whatever can be done will miss out.
So if you’re in a hurry and happen to remember the name of a package but not the fontspec
invocation, use the package; but if you use xelatex
or lualatex
and care about typefaces, either use fontspec
or examine the fonts and the package closely before trusting the package to equal the performance of fontspec
.
If you're having this problem then the solution can be found in Atom's settings pane.
I have two LaTeX packages installed so I can only comment for these, not others: latextools
and latex
.
On OS X/macOS:
Atom > Preferences > Packages > latex > Settings
ensure that the Engine is xelatex
, and also that:
Atom > Preferences > Packages > latextools > Settings > Builder Settings > Builder Settings Program
is set to xelatex
It may be necessary to flush (delete) logs etc. to enable a clean typeset.
Best Answer
The log will show
as
fontspec
sets up\mathit
to expect Unicode encoding but\Sigma
(unless you loadunicode-math
) will expect to find Sigma in the legacy 7-bit TeX encoding position.You can use
so that
fontspec
leaves the math setup untouched, or you could useunicode-math
and\symit{\Sigma}
to use Unicode fonts throughout.