7

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 yesterday
  • 1
    Think 7 bit ASCII (yes, TeX is that old). Commented yesterday
  • 1
    have you any idea how to type è on a UK or US keyboard?? :-) Commented yesterday
  • 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 yesterday
  • 1
    I am sure that all posters here know this, but for the benefit of new users who came here by chance: Modern LaTeX installations understand both the character code (using backslash) and the direct letter input (using UTF-8 encoding). Always best to use UTF-8 unless you cannot. It is the only way to do LuALaTeX. As for direct UTF-8 characters: I use a UTF-8 character map, then copy-paste. If there are only a small number of accented characters I need, I create a UTF-8 plain text file, containing just those characters. Then I copy-paste from there. Commented 20 hours ago

1 Answer 1

9

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.

0

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.