I would like to use JetBrains Mono font in my document, in order to write some code. I’m using TeX Live 2020 on Windows 10, and I’m using lualatex and memoir class.
Is it possible to use JetBrains Mono’s ligatures? Thank you!
I would like to use JetBrains Mono font in my document, in order to write some code. I’m using TeX Live 2020 on Windows 10, and I’m using lualatex and memoir class.
Is it possible to use JetBrains Mono’s ligatures? Thank you!
This font defines its ligatures in the calt feature, so \setmonofont{JetBrains Mono}[Contextuals=Alternate] will give you what you want. E.g,
\documentclass[12pt]{article}
\usepackage{fontspec}
\setmonofont{JetBrains Mono}[Contextuals=Alternate]
\begin{document}
\texttt{</ \#? ]\#}
\end{document}
Note that TeX ligatures are not on by default for typewriter fonts. So if you want TeX’s ligature for, say, em dashes rather than the ligature defined by JetBrains, use \setmonofont{JetBrains Mono}[Contextuals=Alternate,Ligatures=TeX].
lstlisting environment. Is there a solution?
– Marco87
Jun 02 '20 at 01:27
codeanatomy package? I’ve never used it, but give me a day (it’s time for bed here), and I’ll try to figure it out.
– Thérèse
Jun 02 '20 at 01:32
fontspec, but with the inner workings of either codeanatomy or listings, neither of which I’ve used before. I suggest you ask a new question, referring to this one and asking how to make the solution here work with the lstlisting environment. Include a small, compilable example of your use of the environment — an example where the expected ligatures are missing —, and someone who knows those packages well will probably be able to help you.
– Thérèse
Jun 02 '20 at 03:40