3

I often use the letter "ë". I shortly define it in LaTeX as \newcommand{\e}{\"{e}}. However, frequently a space is needed right after the letter and I put \; right after the \e. I wanted to define it as a new command: \newcommand{\e_}{\"{e} \;}, but LaTeX gives an error after I run the program.

Is there any finer solution how I can define "ë " with a unique command?

Emo
  • 135
  • 5
    The proper solution is to use \e{}, but why aren't you just writing ë directly? These shortcuts should not be necessary these days. – daleif Oct 27 '22 at 08:01
  • 3
    is \e really easier than \"e or ë neither of which have a problem with following space? Why do you need \e ? – David Carlisle Oct 27 '22 at 08:35
  • I need a shortcut instead of typing alt+0235 all the time. – Emo Oct 27 '22 at 09:01
  • 3
    \"e is only three characters – David Carlisle Oct 27 '22 at 09:09
  • 3
    In which system? You can use compose keys almost in everyone --- in Linux is just a matter of enabling it (search for your distribution), in Windows I suggest using https://github.com/samhocevar/wincompose --- I just type compose,",e – Rmano Oct 27 '22 at 11:10

3 Answers3

5

Well, it's 2022 and Unicode rules... . Why not:

\documentclass[12pt,]{article}
\usepackage[T1]{fontenc}
\begin{document}

Without spaces, an embëddëd ë (now with space). Also Ë, clearly.

\end{document}

ë galore...

If the problem is typing the symbol, I suggest you google for "Compose Key".

If you insist on having a macro here, look at Space after LaTeX commands

Rmano
  • 40,848
  • 3
  • 64
  • 125
5

According to Wikipedia, ë and Ë are available in several input encodings and a query to the input encoding support files in the LaTeX distribution reveals that they are defined in

ansinew
applemac
cp1250
cp1252
cp437
cp437de
cp850
cp852
cp858
cp865
decmulti
latin1
latin2
latin3
latin4
latin5
latin9
latin10
next
utf8

So chances are high that you can type directly ë and Ë in your typescript and you don't need special commands.

Besides, \"e is not much longer than \e and is much clearer input (if you don't want or can't input the characters themselves).

If you want to live dangerously, load xspace and define

\newcommand{\e}{\"e\xspace}

but this should be avoided.

Remember to use also

\usepackage[T1]{fontenc}

so you get the precomposed character in output.

egreg
  • 1,121,712
0

You didn't say what error you are getting. But it seems like the problem you have is that when you write \newcommand{\e_}{\"{e} \;} you are using the underscore, and TeX expects to see underscores in math mode.

If instead I try \newcommand{\ee}{\"{e} \;}, or any other name without underscore, it seems to work without issue.

On a separate note, I cannot say about other systems, but in Windows the United States International keyboard (and others, too) let you input ë by typing "e.