I am trying to deal with an issue with rendering unicode characters (including combining characters) inside a verbatim environment. I am using xetex as my compilation engine. (For more context see this github issue).
I have found that the default lmtt
does not seem to support β
, â
, or β̂
if they are encoded literally in a verbatim block.
I have discovered that Source Code Pro has support for these characters, but it seems to only be accessible from certain manners of loading it.
In particular, if I try to use
\usepackage{sourcecodepro}
it successfully displays the characters, though the combining circumflex above the β fails to align properly.
Because I'm already using fontspec to get access to other unicode supporting fonts elsewhere, I'd prefer to use fontspec's utilities directly. But I find that when instead I use:
\usepackage{fontspec}
\setmonofont{Source Code Pro}
β's do not display (though the combining circumflexes do display).
MWEs:
SourcecodePro
\documentclass[11pt]{article}
\usepackage{sourcecodepro}
\begin{document}
\begin{verbatim}
β
â
β̂
\end{verbatim}
\end{document}
fontspec + setmonofont
\documentclass[11pt]{article}
\usepackage{fontspec}
\setmonofont{Source Code Pro}
\begin{document}
\begin{verbatim}
β
â
β̂
\end{verbatim}
\end{document}
Any insight as to why this occurs would be greatly appreciated.
Image for illustration purposes:
Per request: List files from testme1.tex (on the left)
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
fontspec.sty 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX
expl3.sty 2016/05/18 v6512 L3 programming layer (loader)
expl3-code.tex 2016/05/18 v6512 L3 programming layer
l3xdvipdfmx.def
List files from testme2.tex (on the right)
xparse.sty 2016/05/18 v6512 L3 Experimental document command parser
fontspec-xetex.sty 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
eu1enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
eu1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty 2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
eu1lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
graphics.sty 2016/05/09 v1.0r Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/01/02 v1.10 sample graphics configuration
xetex.def 2016/04/06 v4.08 LaTeX color/graphics driver for XeTeX (TeX Liv
e/RRM/JK)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
fontspec.cfg
t3cmr.fd 2001/12/31 TIPA font definitions
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
sourcecodepro.sty 2015/10/09 v2.6 Adobe's Source Code Pro typeface
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
fontspec.sty 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX
expl3.sty 2016/05/18 v6512 L3 programming layer (loader)
expl3-code.tex 2016/05/18 v6512 L3 programming layer
l3xdvipdfmx.def
xparse.sty 2016/05/18 v6512 L3 Experimental document command parser
fontspec-xetex.sty 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
eu1enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
eu1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty 2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
eu1lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2016/05/09 v1.0r Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/01/02 v1.10 sample graphics configuration
xetex.def 2016/04/06 v4.08 LaTeX color/graphics driver for XeTeX (TeX Liv
e/RRM/JK)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
fontspec.cfg
t3cmr.fd 2001/12/31 TIPA font definitions
fontspec
either way. Just you get a tailored configuration with the package.\XeTeXtracingfonts=1
and then check in the log-file which fonts are actually used. Regarding the displaced accent: Be aware that verbatim shows a "verbatim" output and so this look is expected.