29

My document uses the txfonts package, which provides Times Roman, Helvetica and what appears to be a facsimile of Courier.

However, I dislike the monospace font and find it to be particularly ugly. I am therefore interested in alternatives that ship as part of texlive. Bera mono is nice however I am more in the market for a serif monospace font as opposed to sans serif.

Any ideas/suggestions?

7 Answers 7

27

From the Latex Font Catalogue: typewriter fonts, which are not all typewriter fonts, but I think they are all monospaced.

1
29

I like Inconsolata like Khaled does. It's monospaced and it supports several encodings including T1, OT1 and LY1.

Just load inconsolata.sty, you could additionally specify a scaling option [scaled=factor].

Here's an example how the font looks like, taken from my blog:

alt text

Links:

2
  • I really like inconsolata and I use it in all my editors. The problem however, is that the version from google fonts has the italic/slanted but the latex version lacks slanted. Am I wrong?
    – Pouya
    Jun 5, 2014 at 10:18
  • 1
    inconsolata can break some Unicode characters, at least in math mode, for instance if \DeclareUnicodeCharacter{00D7}{\ensuremath{\times}} has been used earlier. A workaround is to put \usepackage{inconsolata} before the other packages related to font encoding.
    – vinc17
    Feb 22, 2017 at 16:47
5

I think most of the easily available monospaced serif (as you asked) typefaces have already been mentioned. One worthy typeface that hasn't yet is Gyre Cursor. Although it doesn't ship with TeX Live, it's very easy to obtain and install. I find lots of use for it in small blocks of running text, especially \url's. It's a nicely reworked courier drop-in (however, on that front, I'm guessing you might find it "particularly ugly" :)).

I know you asked for typefaces from the TeX Live distro, but as I have a minor love affair going right now with Adobe's ITC American Typewriter, I can't resist mentioning this very attractive font set (see sample below), if only to provide a look at a tt typeface that is not, to my eyes, "particularly ugly." Only for running text, however; I certainly wouldn't use it for listings.

alt text

3
  • 4
    While certainly nice, this is not a monospace font - just check the width of the "m" and the "i" in "economic".
    – lockstep
    Aug 24, 2010 at 13:53
  • 1
    Yes, yes, it's a tt typeface, not a true monospace font. I appended it to my response because a) I find lots of use for it, and b) it might help out/inspire others who might one day be reading through this posting. Perhaps not "technically" on-topic, but nevertheless maybe "aesthetically" useful given the nature of all of us drawn to producing beautiful TeX/LaTeX created print. I sure hope that's OK by all :)) Aug 24, 2010 at 14:27
  • 2
    TeX Gyre Is included in recent tex live distributions. Aug 24, 2010 at 23:49
4

I personally prefer either Inconsolata or CM typewriter (usually using LM's).

1
  • Could you expand your answer a bit, e.g. with a MWE on how to use these fonts?
    – doncherry
    May 1, 2012 at 16:44
3

Have a look at the luximono font. (Note that it is part of MiKTeX, but not of TeX Live.)

6
  • 1
    In TeX Live luximono can easily be installed by getnonfreefonts luximono at the command prompt. Use getnonfreefonts-sys to install it to $TEXMFLOCAL instead of $TEXMFHOME. Use the option -a to install all available fonts (arial-urw, classico, dayroman, eurofont, garamond, lettergothic, luximono, vntex-nonfree, webomints at the moment).
    – Stefan Kottwitz
    Aug 24, 2010 at 12:55
  • @StefanKottwitz Any suggestions on how to do that on Windows?
    – Canageek
    Oct 20, 2011 at 20:30
  • @Canageek really late answer... but here we go: tex.stackexchange.com/a/22162/74499
    – aronadaal
    Jul 13, 2016 at 8:27
  • @aronadaal No kidding, I was working on my undergrad thesis then, and I'm well into my Ph.D. now.
    – Canageek
    Jul 14, 2016 at 20:46
  • Yeah, I already thought something like that ;) But maybe it's useful for other people that come to this question.
    – aronadaal
    Jul 15, 2016 at 7:16
3

\usepackage[scaled=0.8]{FiraMono}

( Put the above line in the preamble of your document, i.e. immediately after \documentclass. )

I use the typewriter font for program code. As such, it is important to clearly distinguish between 1 and l, the former being the digit one and the latter being the lower case letter L.

I strongly advise against beramono because when I copy for example echo $OS_PASSWORD_INPUT from the compiled PDF into a terminal it shows up as echo $OS _ PASSWORD _ INPUT. Not helpful.

Other good alternatives include \usepackage[scaled=0.8]{GoMono}, \usepackage[scaled=0.8]{DejaVuSansMono}, but I prefer FiraMono.

Reference:
https://tug.org/FontCatalogue/typewriterfonts.html

1
  • Hope Firamono doesn't have italic version, Dejavusansmono is one of a good choice...
    – MadyYuvi
    Oct 13, 2020 at 15:18
2

My favourite one is ubuntu mono. You can easily use with XeLaTeX or LuaLaTeX and fontspec!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .