0

I want to change á é í ó ú and ñ to \'a \'e \'{\i} \'o \'u and \~n in all my .tex files. I´ve used the code

find . -name “*.tex” -type f -exec sed -i “s/á/\'a/g” {} \;

but it doesn't work. Somebody has any sugestion?

  • 4
    you want to use ascii double quotes for the sed argument " not – David Carlisle Jan 19 '18 at 20:30
  • 4
    why do you need to do this? tex can handle the accented characters without this replacement. – David Carlisle Jan 19 '18 at 20:31
  • I don't know why, but there are a couple of machines that aren't my property, where just making this change makes everything compile well. In these machines TexMaker says that there are characters that cannot change from one encoding to another, and it has to do with accents. – wmora2 Jan 19 '18 at 21:03
  • 1
    if the file is badly encoded, sed will be no more able to recognise accents than texmaker. You need to save the file in a known encoding, preferably utf-8 and make sure texmaker is using that encoding – David Carlisle Jan 20 '18 at 2:24
  • You also need ascii double quotes for the find argument. – cfr Jan 20 '18 at 2:41

Your Answer

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

Browse other questions tagged or ask your own question.