3

I am using UTF8 encoding now and don't need to use LaTeX macros to typeset accented characters.

Would you know an automative process to convert accent characters coded with Tex macros to utf8 characters?

In other words, i would like to convert this kind of sentence :

M\'ethodes directes de r\'esolution de syst\`emes lin\'eaires

into

Méthode directes de résolution de systèmes linéaires

Thank you for your help

P.S: Sorry for my english, don't hesitate to correct my syntax

  • 1
    Your editor can find and replace... – Paul Gaborit Jul 30 '17 at 12:26
  • yes but it is a bit long if you have to do this for all kind of accents, it is not a exhaustive process – Bendesarts Jul 30 '17 at 12:28
  • 1
    The source file is not related to TeX so it must be done via the editor capabilities. Search & Replace All would work properly. – percusse Jul 30 '17 at 12:29
  • 2
    And if you have a lot of files where you want to do replacements, a little script (python for example) would do a good job. – elementzero23 Jul 30 '17 at 12:30
  • 2
    This doesn't really have anything to do with (La)TeX. You'll be able to use any editor for a search-and-replace, or compile your document and then copy-and-paste the UTF8 output back to your source. – Werner Jul 30 '17 at 12:43
5

Just use recode which is perfect for that kind of job like so:

recode -d TeX..u8 file.tex

More information here: https://github.com/pinard/Recode/

  • is it unix command ? Is it possible to use it with windows ? – Bendesarts Jul 30 '17 at 12:47
  • Maybe there: gnuwin32.sourceforge.net/packages/recode.htm – Robert Alessi Jul 30 '17 at 12:53
  • 2
    @Bendesarts keep in mind that recode will overwrite your files. Make a backup first. – Robert Alessi Jul 30 '17 at 14:40
  • 1
    @RobertAlessi A very good advice: Only TeX can really understand TeX code. – Paul Gaborit Jul 30 '17 at 17:25
  • 1
    @PaulGaborit Yes, recode good though it may be at its job, must be used with great caution! – Robert Alessi Jul 30 '17 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.