I don't know which LaTeX packages I recently updated caused this issue, but I suddenly noticed today that my single quotes in \texttt{}
and verbatim
environments were not scaled correctly. I'm using xelatex with \setmonofont[Scale=0.7]{Source Code Pro}
. Here is what single quotes look like before (in \texttt{}
):
And here is what they look like now:
They are not scaled correctly in verbatim environments, either:
Here is my minimal example:
\documentclass[12pt]{article}
\usepackage{fontspec}
\setmonofont[Scale=0.7]{Source Code Pro}
\usepackage{upquote}
\usepackage{textcomp}
\begin{document}
\texttt{'hello world'}
\texttt{\textquotesingle{}hello world\textquotesingle{}}
\begin{verbatim}
x = 'hello world'
\end{verbatim}
\end{document}
Output (with xelatex
and the latest versions of all packages tlmgr update --self --all
, and Source Code Pro downloaded from Google fonts):
So literal single quotes are scaled correctly in \texttt{}
(first line), but \textquotesingle{}
and single quotes in verbatim
are problematic.
If I don't use the upquote
package, the issue with single quotes in verbatim
will be fixed (but I hope I can keep upquote
):
Now I have run out of ideas, and I don't know if this issue was caused by a certain recent update of a certain package, or changes in the Source Code Pro font on Google fonts. I hope \textquotesingle{}
and single quotes in verbatim
can be displayed correctly (if possible, with the upquote
package).
upquote
on CTAN: >The package switches the typewriter font to Computer Modern Typewriter in OT1 encoding, and modifies the behaviour of verbatim, verbatim*, \verb, and \verb* to print in the “` and ' way”.< Your problem is that for any non-cm-fonttextcomp
(an obsolete package) is loaded which also does not match your font.