22

I'm looking for a nice font to use for my \url{...}s that goes well with Palatino. Courier does not look good at all. It's much too light. Helvetica (scaled .92) looks pretty good, but the ~ looks bad, raised so high.

None of these fonts looked very good to me, but I'm no designer so I'm sure my opinion could be changed if others think one of those looks good.

lockstep
  • 250,273
TH.
  • 62,639
  • How do you specify a font just for the \url? – Johan Aug 29 '10 at 19:50
  • Look at http://stackoverflow.com/questions/256457/how-does-one-insert-a-backslash-or-a-tilde-into-latex/2037332#2037332 – Charles Stewart Aug 30 '10 at 00:24
  • @Johan: In this document, I'm happy to just set either the san serif or typewriter font to whatever I want the url font to be and then use \urlstyle. I'm sure there's a better way than that, but then I'd have to look into what \urlstyle actually does. – TH. Aug 30 '10 at 03:46

2 Answers2

16

A sans serif font that blends well with Palatino (and is freely available) is Bera Sans:

\usepackage[scaled=0.86]{berasans}

URLs are often typeset in a monospaced font. Probably anything is better than Courier; I recommend Inconsolata:

\usepackage[scaled=1.03]{inconsolata}

(The specified scale factors will adapt the x-height of the respective font to that of the Palatino.)

EDIT: The Myriad font and its Open Type incarnation Myriad Pro, which are not freely available, are even better sans serif matches for Palatino. The files (excluding the actual font files) necessary to use Myriad with LaTeX can be found here.

lockstep
  • 250,273
  • Bera Sans looks great once it's scaled down like that. – TH. Aug 30 '10 at 04:22
  • Inconsolata is one of my favorite monospaced fonts out there. Anonymous Pro just recently came out that might give it a run for its money though. – JoshFinnie Sep 01 '10 at 19:08
  • @JoshFinnie, I looked at Anonymous Pro when it came out a few days ago. Looks very clean on the screen, but has two downsides from a LaTeX perspective -- it's TTF and (to my eye) the hinting isn't great. Not absolute showstoppers, just roadblocks. That, and in this case, it makes a lousy match with Palatino. I might try setting it up in my code editor for a while to see if I can get used to it. You know, I think I could really like it there. – Geoffrey Jones Sep 01 '10 at 22:56
  • like Minion Pro, Adobe bundles the basic set of Myriad Pro OTFs with its free Acrobat Reader. The Acrobat Reader EULA states 'You may install and Use a copy of the Software on your compatible computer, up to the Permitted Number of computers', and '"Use" or "Using" means to access, install, download, copy or otherwise benefit from using the functionality of the Software in accordance with the Documentation.' My reading would be that these fonts can be used for at least personal document production, but that might just be wishful thinking. (*) I'm very definitely not a lawyer. – Geoffrey Jones Sep 01 '10 at 23:26
  • 1
    Using the scaled option without a factor looks even better. Optically, the scaling factor does not seem to differ, but the headings - espicially in TOC - fit nicer to the Palatino font. – schlamar Apr 26 '12 at 12:41
  • Thanks for the hint on Bera Sans – I was not having much luck finding something in the LaTeX Font Catalogue. I'm not a huge fan of the font itself, but it does match well, and I'm using the sans-serif sparingly.

    I disagree with schlamar – leaving out the factor does not scale it down to match Palatino's height, such that the transition between serif and sans is jarring. If you're only using it for headings or a TOC, that might be fine, but if you need to mix it with running text as for my use case, or for the OP's, to include URLs in text, it definitely looks better with the scaling factor.

    – scorchgeek Apr 15 '15 at 01:19
9

If you're happy with ttfamily for typesetting \url's, you might like LuxiMono. It is, dare I say it, Palatino's identical twin cast in tt typeface.

\usepackage[scaled]{luximono}   % equivalent to [scaled=0.87]
  • Odd, that font doesn't seem to be in TeX Live 2009. – TH. Aug 30 '10 at 03:50
  • I'm always so clueless about TeX Live. I installed my copy some time ago through MikTeX's Package Manager. I guess TeX Live users could grab a copy from ctan.org. – Geoffrey Jones Aug 30 '10 at 07:15
  • I tried that. I followed the readme for installing fonts, but I believe I missed a step or something because it fails when trying to generate the fonts with METAFONT, even though they are Type 1 fonts. – TH. Aug 30 '10 at 08:40