20

I'm thinking about using the Linux Libertine font (\usepackage{libertine}) in my next TeX documents. For listings with syntax highlighting I will need a typewriter font that supports boldface.

I used to use Courier (\usepackage{courier}), but a big disadvantage is, that the Courier font clashes with Linux Libertine.

So my question is: Is there typewriter font, supporting boldface, that does not clash with the Linux Libertine font?

| improve this question | | | | |
19

The Open Type Version of Libertine has also a typewriter version. However, for pdflatex you can use the Bera Mono:

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[scaled=0.83]{beramono}

\begin{document}
This is a test with \texttt{some \textbf{bold} typewriter text}.

\end{document}

enter image description here

If you want Bera Mono for LuaTeX or XeTeX then use

\setmonofont[Scale=0.83]{Bitstream Vera Sans Mono}

The TrueType font is available from http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ A survey of monotype fonts is here: http://www.codeproject.com/Articles/30040/Font-Survey-42-of-the-Best-Monospaced-Programming

| improve this answer | | | | |
14

Inconsolata fits well with Linux Libertine, and has a bold face:

\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage{xunicode}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Linux Libertine O}
\setmonofont{Inconsolata}

\begin{document}

This is a test with \texttt{some \textbf{bold} typewriter text}.

\end{document}

enter image description here

| improve this answer | | | | |
  • This can also (as of TeXLive 2015) be evoked by loading \usepackage[scaled=0.96]{zi4}, following \usepackage{libertine}. (Disclaimer: the scale factor there is my own best attempt to match their x-heights; I’m not an expert.) – Peter LeFanu Lumsdaine Feb 29 '16 at 15:57

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.