I was checking this: Automatically replace open quote with accent, and it is actually similar to what I want. Since I'm starting with Emacs, and everything seems admissible to be automatized. Because I write spanish text, I type accents like for example á
, é
or í
.
I would like to have the instant automatic translation between the characters with an accent and their equivalent version using the slash form.
So for instance, if I type á
then it'll be translated to \'a
and so on.
1 Answer
I'll echo what the commenters suggest and say that you would be better off writing the accents as you normally would and encoding the document in UTF-8:
\documentclass{article}
% Tells all the other packages that the document language is Spanish. It also changes hyphenation rules and quotation marks. The choose the mexico or spain option depending on whether you want a period or a comma as a decimal separator in numbers.
\def\spanishoptions{mexico}
\usepackage[spanish]{babel}
% Encodes the input as UTF-8.
\usepackage[utf8]{inputenc}
% Encodes the fonts as T1
\usepackage[T1]{fontenc}
\begin{document}
ÁÉÍÓÚÜÑ áéíóúñ
\end{document}
See also the answers to the questions How to write directly French characters in Emacs and print them in LaTeX? and Why should I use \usepackage[T1]{fontenc}? for more information.
utf8
encoding. All modern systems know aboututf8
. I've been typing accented letters without any problem for more than twenty years, and it makes the code much more readable..tex
file is not tricky if it should ever become necessary.M-x replace-string
to change every accent after typeset.