4

Sometimes I see the accented è written in LaTeX sources as a command like this:

\`e

I've always wondered the reason.

On my laptop (a modern machine), I can type è directly using the keyboard, and the document compiles without any issues.

Is the use of "`e" due to a specific keyboard layout (for example on Mac), or is it just a historical LaTeX convention?

6
  • @cfr Sometimes in tex italian file I see the `e. Commented 16 hours ago
  • 1
    Think 7 bit ASCII (yes, TeX is that old). Commented 14 hours ago
  • 1
    have you any idea how to type è on a UK or US keyboard?? :-) Commented 13 hours ago
  • @DavidCarlisle Absolutely not. 😌😌 Commented 13 hours ago
  • 2
    @Sebastiano é is easy with the UK keyboard in windows but è is harder with the standard one (and I doubt many people install the UKX keyboard which akes it easy, but makes it hard to type ` for a tex open quote) Commented 13 hours ago

1 Answer 1

7

TeX was written in the late 70's and early 80's, when there was no common setup for accented letters.

Keyboard might have them, but there was no standard encoding, so a file written on a French keyboard with é or è might be interpreted wrongly on a computer in another part of the world.

Knuth describes a possible idea for coping with characters in the upper half of the ASCII code, but it's complicated and difficult to port. Part of this idea was that fonts tailored for languages using diacritics would have ligatures such as o/ to output “ø”. This idea wasn't followed.

However, since he did need accents in order to typeset names of foreign people (and he's very strict in typesetting them in the correct way) he introduced the \accent primitive. For instance, the macro \` expands to

{\accent 18 #1}

and the fonts have a grave accent in slot 18.

This method has many limitations: for instance it inhibits hyphenation past the accented letter and also kerning between adjacent letters. This is unacceptable for languages such as German, so quite early fonts in a different encoding (decided upon during the 1990 TUG conference in Cork) were laid out. When this became the T1 encoding with NFSS2, more complicated versions of the accent macros were provided in LaTeX: for instance \`e points to the slot containing a precomposed “è”, but \`m still uses the \accent primitive as there's no “m with grave accent” in the Cork encoding.

Later on, inputenc was released, that allowed typing directly è, transforming it internally into \`e.

1
  • Wonderful answer. Thank you so much. Commented 15 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.