40

When papers are written in the academic world, URLs are often set in monospace. The reason for this seems to be historic and is described in this Q&A at TexSE. It may be summarized as a leftover from when URLs were uncommon. They were perceived as some form of computer code, which used to be printed in monospace.

Using a monospace font is not pleasing to the eye, particularly when used in combination with a proportional font. This is the case even when proportional and unproportional fonts of the same typeface are combined (here: Linux Libertine and Linux Libertine Mono).

enter image description here

So the question is: should monospacing URLs still be the de facto standard, or should another method be favoured, or should highlighting URLs be disadvised in general?

12
  • 1
    Does the organisation you work for have a style guide? Have you checked it? If it does, then just go with that.
    – Billy Kerr
    Aug 24, 2017 at 9:54
  • 1
    @BillyKerr My university does not have a single style guide for all departments, and my field does not have a style guide at all. Basically, I can choose whichever style I prefer as long as I use it consistently. Therefore, my decision is purely aesthetic.
    – Philipp
    Aug 24, 2017 at 11:30
  • 6
    "Do you honestly expect me to be able to keep all these floats where you want them without seriously harming the flow of the text or resorting to god-awful, fragile TeX hacks?" "No, Mr. Bond, I expect you to die."
    – Tristan
    Aug 24, 2017 at 14:54
  • 2
    “Using a monospace font is not pleasing to the eye” [citation needed] Also: what other way to differentiate the URL were you thinking? Color? Italics? Aug 25, 2017 at 20:49
  • 1
    I think it is pleasing to the eye Aug 26, 2017 at 20:19

5 Answers 5

55

URLs are not regular text

Using a monospace font is not pleasing to the eye, […]

Yes, but then reading URLs isn’t very pleasing anyway. So, think about for a second why you typeset a URL in the first place. Nowadays, you often do not need to do this at all, because in almost any digital medium you can equip some human-readable text with a hyperlink, which is more comfortable for everybody involved. If you actually need to typeset an URL, it is usually for a printed medium and then it’s not for being read like regular text, but for being translated to digital information, usually by a reading and typing human, sometimes by an OCR software.

With this in mind, the criteria for typesetting URLs are a bit different than for normal text. Regular text contains a lot of redundancy that enables us to quickly read it – even if we get some detail wrong, our brain can easily auto-correct it¹. This doesn’t apply for URLs: The reader has to get every character right. As always with readability, the concern is not that the reader makes unfixable mistakes, but rather that they do not waste a few seconds re-reading to locate their mistake and that they are not annoyed.

Another relevant consideration when typesetting URLs is that some characters are used differently than in normal text and thus fonts designed for normal texts are usually suboptimal when applied as they are. For example, the baseline dot (.) is usually used to mark an important separation in both, normal texts and URLs. However, when used as a full stop in normal texts, it is followed by a space, which optically supports this function. This does not apply to URLs and in particular kerning may lead to the dot being much less prominent than it deserves to be. In another example, uppercase characters are much less common in URLs.

¹ To strt wth, u cn stl dcphr ths sntnc. Tihs sencetne is eevn eisear to raed. Almost all punctuation marks, capitalisation, and articles can be guessed from context.

Example

The same URL set in Ubuntu and Ubuntu Mono

  • If you look at the top example, the first thing that will probably catch your eye is the all-caps 47ATX, which is bad as it is not particularly important and if you want to type that URL, you usually want to start at the beginning. This problem is at least alleviated on the bottom due to capital letters being relatively smaller in height as well as in width.

  • The main structure of the URL is much easier to parse in the bottom example as the dots, hyphen, and slashes are given more space, in terms of glyph width and kerning.

  • The m is not particular beautiful in the bottom example: It looks rather squeezed and the shortened middle stem is out of place. However, it is clearly an m and cannot be mistaken for rn. While this is a problem for every kind of text, misreading such aspects is considerably more annoying with URLs as you won’t notice it instantly but have to go back and spot your mistake after you got a 404 error or landed on a pom site (credit ChrisH for the pun).

What does all of this have to do with monospacing?

While none of the above criteria is strictly tied to a font being proportional or monospace, your average monospace typeface scores much better than your average proportional typeface. However, if you are aware of the disadvantages of regular proportional fonts, you can also address most of them without changing the font, in particular by adapting the spacing.

So, at the end of the day, you have to find a compromise considering the following factors:

  • How well does your monospace font match the regular font?

  • How many URLs do you have to typeset?

  • How long and complicated are your URLs? For example, www.example.com is more benign in terms of readability with a regular font than the above example.

  • How much time and effort do you want to invest?

3
  • 9
    That said, a well-selected monospace font can make all the difference. Ubuntu-mono is a great monospace font, as it's not in-your-face, unlike courier-new.
    – Tyzoid
    Aug 24, 2017 at 14:30
  • If that is the reason, why don't browsers use monospace to show the URL in the address bar? This would maybe even be a very simple solution to avoid phishing…?
    – rugk
    Aug 27, 2017 at 18:40
  • 1
    why don't browsers use monospace to show the URL in the address bar? – Because the situation is not the same as for printed URLs. Ask yourself when you last typed (or wrote) an URL from the address bar, or read it in full. I am no expert on Browser UX, but I think a main factor is that you want to get as much content into the address bar as possible and thus monospace fonts (which are wider) are not preferred. As for phishing, I don’t think this would change a lot, as it still mostly relies on the stupidity of the victim.
    – Wrzlprmft
    Aug 27, 2017 at 19:02
31

A few further points:

  • Many monospaced fonts have good character differentiation. Compare 1Il and 1Il.
  • In a pdf (you're talking about academic papers so this is a likely format) being read on screen, the font indicates that the text might be a clickable link. That's why it's often used for DOIs as well. In fact it's common to have "DOI: <code>10.1063/1.3693427</code>"

(i.e. only the unique identifier monospaced; the label here is in small caps). DOIs are even trickier than URLs as they have a wider range of allowed characters, such as spaces and percent signs.

  • It's all about context.
    • If you're producing a poster/brochure the user will read and retype the address. So clarity comes first, good aesthetics a close second.
    • If it's a website, your users will assume anything that looks like a URL is clickable.
    • If it's a thesis/paper, help your reader. A displayed URL is good for both screen and print readers (but takes up space). Some journals colour the paper title blue in the references of a downloaded pdf when that's a clickable link. This helps a reader on screen, but following up a reference on a paper copy is often slower than retyping a reasonable URL.
3
  • 8
    +1 especially for Many monospaced fonts have good character differentiation.
    – Cat
    Aug 24, 2017 at 17:26
  • Of course, percent signs occur in URLs as well Feb 2, 2020 at 20:17
  • @HagenvonEitzen good point. I think I meant that in DOIs the percent sign is a valid character rather than an escape character . doi.org says: The DOI name is case-insensitive and can incorporate any printable characters from the legal graphic characters of Unicode. with the caveat that the set may be further restricted (since 2008 it has been but DOIs are designed to be persistent so the broadest definition must be supported forever
    – Chris H
    Feb 3, 2020 at 8:42
3

Since, as you have said, you have no single style guide, and have the freedom to choose, then I can't see the need for an ugly monospace font myself. However, that's only a personal opinion. You are correct that whatever you choose should be used consistently

If you want to highlight a web link in some way, there are other options such as italics, or different colours.

I also think that the use of "http://" before a web link is not really necessary these days.

5
  • 6
    I do not agree on that “http://” is not necessary: Firstly, it can be a good indicator if a connection is encrypted (https) and secondly, on some websites, dns forwarding isn’t properly implemented, so omitting parts of the URL might lead to problems. Also, if the sysadmin decides not to implement the www, then your URL would directly start with the domain name, which might be confusing.
    – Philipp
    Aug 24, 2017 at 12:17
  • @Philipp A bare domain name without a protocol is no longer a URL/URI. And the "www.example.com" thing is a (dying) convention. Aug 24, 2017 at 15:32
  • 2
    Consider the phishing potential for domain names like arnazon.com or tvvitter.com with the wrong proportional font. I configure browsers to monospace the address bars to protect against such shenanigans. Aug 24, 2017 at 15:33
  • 3
    protocol is vital. Consider mail.example.com; that could reasonably be running any or all of http, smtp, imap or pop and / or the secure versions thereof. You can't expect the reader to guess.
    – Rodney
    Aug 24, 2017 at 16:55
  • Formerly, an URL should even be additionally preceded by url: before the schema (aka. protocol) Feb 2, 2020 at 20:25
3

should monospacing URLs still be the de facto standard?

No. It adds a level of mess to academic writing.

Having read a ridiculous amount of academic papers, I can say this: the most annoying thing is inconsistency. Personally, I would nuke the stupid idea of a monospace url, but if you for some reason want to, then you have to be supersuper alert that you are consistent.

Consider also automatic citation and reference systems: do you want to go to the hassle of setting Zotero/Endnote up to format your urls, and will this catch all of them? You would be surprised at how often things go a little haywire.

If you copy-paste citations and references, you will hate this.

should another method be favoured, or should highlighting URLs be disadvised in general?

Up to you – my personal opinion is that it is utterly unnecessary to highlight urls unless they are actually clickable.

4
  • 1
    You appear to be writing in something like Word. In that case an appropriate style for URLs can still be used; the URL should be clickable in which case something has to define/format it anyway. OF course if you write your papers in LaTeX using BibTeX or BibLaTeX the formatting is made consistent with for you and URLs are clickable; all is well. I believe the OP may be using LaTeX
    – Chris H
    Aug 24, 2017 at 13:05
  • I don't touch Word. I wrote my thesises in InDesign with Zotero and a little LaTex. I have also seen articles and thesises written in any combination, and there seems to be no guarantee of consistency.
    – benteh
    Aug 24, 2017 at 13:14
  • @Benteh How did you get Zotero to work with InDesign without Word as an intermediary? I've been trying to do that for years, with absolutely no luck. Aug 24, 2017 at 15:38
  • basically with the plugin zot2indd: you need to write LaTex-style citations, but to me that is a minor hassle. It is a bit fiddly to set up, if you are a bit fuzzy like me, regarding formatting and such. github.com/ka1/zot2indd
    – benteh
    Aug 24, 2017 at 15:50
1

I think this is no longer a standard. Up to the desiger to, or not to, highlight these. Personally i would definitely highlight URLs, either by using a monospaced font, or by changing the color of the actual links or even adding a small share icon in front of urls in body text.

Then, make sure you export to PDF with hyperlinks included so they are actually clickable when viewed in Acrobat.

2
  • You wrote “Personally i would definitely highlight either using … or …”: Does that imply that you’d definitely highlight a URL (using one of the methods described)? Or does it mean that it isn’t certain whether you would highlight a URL, but in case you did, you would do so using one of the methods described?
    – Philipp
    Aug 24, 2017 at 11:47
  • I rephrased a bit. I would highlight these, and would do so using on or the other methods listed.
    – Lucian
    Aug 24, 2017 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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