How to convert characters of type á ê õ ção to \'a \^e \~o \c{c} \~a automatically?
|
|
||||
| show 3 more comments |
|
You probably want to keep a version of your document with the unreplaced characters as it is much easier to read. If you use makefiles to process your documents, you might write something along these lines
Actually all my makefiles copy doc.tex to temp_doc.tex before doing anything. This way, I can easily clean up any machine generated files via However, are you really sure you want to do this? Replacing these characters with their respective macros doesn't really give you any advantage. (At least none I could readily see.) But it comes at the cost of poor kerning. (See also section 2.2.6 of l2tabuen.) Best |
|||
|
|
|
Here is a quick python script that does the trick, it handles both combining accents as well as pre-composed characters, however it takes only a string of text and some extra work is needed to handle complete TeX files:
and invoked as:
which outputs |
|||
|
|
|
If you use emacs, use the |
|||
|
|
\usepackage[utf8]{inputenc}you can keep them in your source. – Alan Munn Jul 18 '11 at 17:24