Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 2 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.