3

I'm using Helvetica Neue Light as the default in my document (working off a template), but when I specify /emph, it simply gives me a warning in

LaTeX Font Warning: Font shape 'EU2/HelveticaNeueLight(0)/m/it' undefined

Using 'EU2/HelveticaNeueLight(0)/m/n instead on input line

and the output is simply normal, un-italicized text.

The style sheet looks as follows:

\RequirePackage[quiet]{fontspec}
\RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math}

\newfontfamily\bodyfont[]{Helvetica Neue}
\newfontfamily\thinfont[]{Helvetica Neue UltraLight}
\newfontfamily\headingfont[]{Helvetica Neue Condensed Bold}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor]{Helvetica Neue Light}

Any idea how I get around this? I do have the Helvetica Neue Light Italic font installed on my system, if that helps.

1
  • 2
    You must provide the name of the italic font to fontspec, like this (note the new options-after-font syntax): \setmainfont{Helvetica Neue Light}[Mapping=tex-text, ItalicFont=Helvetica Neue Light Italic] Apr 11, 2015 at 22:22

1 Answer 1

5

Provide the italic font to fontspec with its key-value option syntax. Note the reversed order of font-then-options and the fact that TeX ligatures (--/---/curly typographers' quotes) are set up automatically in the latest version of fontspec:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Helvetica Neue Light}[
  ItalicFont=Helvetica Neue Light Italic,
]

\begin{document}
Test \emph{test}.
\end{document}

enter image description here

6
  • Hi Paul! Thanks for the reply, it seems to be exactly what I need to do. However, my document now won't compile at all. It gives me the error '! LaTeX Error: Missing \begin{document}' Any idea what to do there? I haven't changed anything else, just replaced the code you provided over my \setmainfont command.
    – Martin
    Apr 12, 2015 at 7:53
  • 1
    @Martin You probably have an older version of fontspec; please, update your TeX system. In the meantime you can use \setmainfont[<options>]{<font>} instead of \setmainfont{<font>}[<options>] like in Paul's answer.
    – egreg
    Apr 12, 2015 at 9:03
  • 1
    Mapping=tex-text should be either left out (newer versions of fontspec apply it automatically) or called Ligatures=TeX.
    – egreg
    Apr 12, 2015 at 9:04
  • @egreg thanks so much, that fixed it for me! It's weird though, I checked my MikTeX packages, and according to it, fontspec is up-to-date (it is an old package, from 2013, but it seems to be the newest one in the repos I checked)
    – Martin
    Apr 12, 2015 at 10:31
  • Is there any way to do this only in a selected part of the document? My specific problem is that I use the libertine circled numbers extensively, but these only exist in the main font. So when I am in italics I have to set normal font for each and every number. Apr 12, 2015 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .