TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 17 down vote accepted

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

share|improve this answer

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

share|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 at 15:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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