I want to create an environment that would convert all á
to \=a
, all é
to \=e
and so on... (short-hand for macrons) Something that should have been a five-minutes easy-to-write tool became a real nightmare, mainly because I cannot activate the character á. TeX thinks it is actually two characters, creating an error with \catcode.
The following approach also does no work:
\defá{\=a}
\defé{\=e}
...
Because the ''accent character'' comes before the ''letter character''. In this way, only ú works, while the rest yields an error.
Also, trying to isolate the ''accent character'' in a control sequence creates an inpuntec error (not including inputenc creates another error). But since inputenc itself does a similar trick quite well, I wonder: what is the nice way of doing it? And, what is better: a TeX solution or an inputenc contraption?
EDIT: The idea needs to be able to be executed in the body of a LaTeX. Global changes would mess up with my normal text, which uses quite a few diacritics (though no macrons).
inputenc
: is that the case? If so, could you tell us which encoding too!\def
or\newcommand
(etc.)? It is not difficult to do this using non-*TeX tools...\'{e}
what other definitions do you want other than the ones inputenc is making?