3

I updated the packages in my TexLive distribution earlier today and noticed that one line of code in my project no longer worked properly, namely the one I used to set the fake options for my monospaced font in xelatex.

In the previous version I was able to write

\setmonofont[AutoFakeBold=1.4, AutoFakeSlant=0.2]{Inconsolata}

But now I get the error

LaTeX error: "keyval/misplaced-equals-sign"
Misplaced equals sign in key-value input 9
Latex attempted to parse some key-value input but found two equals signs not separated by a comma.

So what is the correct syntax now?

Here's a MWE:

%!TEX TS-program = XeLaTeX
%!TEX encoding = UTF-8 Unicode

\documentclass{article}

\usepackage{polyglossia}
\setmainlanguage{swedish}

\setmonofont[AutoFakeBold=1.4, AutoFakeSlant=0.2]{Inconsolata}

\usepackage{listings}
\lstset{
basicstyle=\ttfamily,
language=python
}


\begin{document}

Hello world

\begin{lstlisting}
print("print should be in bold")
# this should be slanted
\end{lstlisting}

\end{document}

1 Answer 1

2

It seems like a bug in fontspec, since the simple key AutoFakeSlant raises an error, while AutoFakeBold doesn't.

However, a more complicated specification seems to work:

\setmonofont[BoldFont=*,BoldFeatures={FakeBold=1.4},
  ItalicFont=*,ItalicFeatures={FakeSlant=0.2},
  BoldItalicFont=*,BoldItalicFeatures={FakeBold=1.4,FakeSlant=0.2}
  ]{Inconsolata}

You must log in to answer this question.

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