20

I'd like to write a document with the Libertine font (using the libertine package). I have a couple of code snippets in the text, and to me it seems like the Libertine Mono font that is used by the package is too large compared to the rest of the text (notice the 'x'-height):

compared to the same snippet using Computer Modern:

Is there something wrong with my setup, or is that just the way Libertine Mono is supposed to look? If that's the case, is there a way to automatically use a slightly smaller text size for all monospaced output (\texttt, \verb, listings...)?

\documentclass[border=5mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{libertine}

\begin{document}
abc \texttt{abc}
\end{document}
Jake
  • 232,450
  • 6
    You can scale it using a package option: \usepackage[ttscale=.875]{libertine} – cgnieder Mar 08 '13 at 11:57
  • 6
    Personally, I don't like this this monospace (in my opinion it looks bad), it is not like other teletypes, it has serifs and more. I think your document will look better with other monospaced font (i.e., luximono package or txtt font). Just a suggestion, the answer is in cgnieder comment. – Manuel Mar 08 '13 at 12:01
  • 3
    @Manuel It's not distinguishable from the Roman type, particularly if scaled down, so it doesn't do its job. And I agree it's not the best member of the Libertine family. ;-) – egreg Mar 08 '13 at 12:03
  • @cgnieder: Thanks, that works (should have read the documentation, sorry). Could you post that as an answer? – Jake Mar 08 '13 at 12:06
  • @Manuel and egreg: Good point, it's really not a very monospaced font. LuxiMono and TXTT both seem nice, thanks for the suggestion. It seems like LuxiMono is not in TeXLive? – Jake Mar 08 '13 at 12:08
  • 3
    No, it isn't. You can install luximono trough getnonfreefonts script. By the way, you can look at the font catalogue to choose one. inconsolata is also good (at this moment I can't try if it looks good with libertine). – Manuel Mar 08 '13 at 12:10
  • @Manuel: Sweet, that worked like a charm. Thanks! – Jake Mar 08 '13 at 12:14
  • 1
    @Jake well, it is monospaced but doesn't look very teletype-like... I don't like it either. – cgnieder Mar 08 '13 at 12:34
  • @cgnieder: Sorry, I meant "not a very good monospaced font"... – Jake Mar 08 '13 at 12:37
  • 2
    I settled for Xe/LuaLaTeX and \setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono} (provided by the dejavu package) to complement Linux Libertine. – doncherry Mar 08 '13 at 14:10
  • 1
    For everyone else who doesn’t like the standard libertine monospace font much, a couple of options (not needing Xe/LuaLaTeX) are given at the question Which typewriter font fits to Linux Libertine and supports bold letters? – Peter LeFanu Lumsdaine Feb 29 '16 at 16:07

1 Answers1

26

It can be scaled using a package option \usepackage[ttscale=.875]{libertine} (you need to play with the value a bit, this is just an initial guess):

\documentclass[border=5mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage[ttscale=.875]{libertine}

\begin{document}
some text \texttt{monospaced} and normal text
\end{document}

enter image description here

cgnieder
  • 66,645
  • 1
    If you were using XeLaTeX, Scale=MatchLowercase might be an option, too. (It would probably have to go somewhere else though, not in an option to the package.) – doncherry Mar 08 '13 at 14:08
  • @doncherry yes, that should do (via a fontspec command) I would think – cgnieder Mar 10 '13 at 18:34