2

I would like to typeset some listings in Libertine/Libertinus Mono, but I've set the listings package to typeset the (octave/spice) language keywords in boldface, and these fonts (otherwise excellent, by the way) lack a Mono Bold face.

My question is: Is there any way to "fake" a bold version of Libertine/Libertinus Mono? I am thinking, for instance, on picking the Regular Bold types and printing them equally spaced, but perhaps this is too crude and won't work. Also, I don't know how to do that.

If it's too difficult, no problem: I can use DejaVu Mono or other monospaced font. I was being curious, simply.

2

I assume you're using XeLaTeX or LuaLaTeX:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Libertinus Serif}
\setsansfont{Libertinus Sans}
\setmonofont{Libertinus Mono}[
  BoldFont={Libertinus Mono},
  BoldFeatures={FakeBold=4},
]

\begin{document}

Main: Test \textbf{test}

Sans: {\sffamily Test \textbf{test}}

Mono: {\ttfamily Test \textbf{test}}

\end{document}

enter image description here

|improve this answer|||||
  • Really the two answers proposed suit me, but I voted for this one because it showed me that it's possible to "fake" a bold font, which is what I had in mind. – Orestes Mas Dec 8 '16 at 19:34
0

Use libertineMono.sty. It provides a bold monospaced variant.

|improve this answer|||||
  • Interesting. I didn't know that the libertine package includes a bold monospaced. The fact is that, being a non-expert tex user, I tended to use \fontspec and \setmainfont when compiling with XeLaTeX, because I thought (erroneously) that those font packages are solely for pdfTeX. I still have doubts on which font packages can I use with XeLaTeX, but this is perhaps another question. – Orestes Mas Dec 8 '16 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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