I have a latex file that have been written using:


In this file, there are few external files also written using this package. Now I need to put a external file that was written using:


Well, when i use the command:


Shows many errors because of latin1. How can i fix it?

  • 3
    I would recommend to recode external-file. Most editors are able to recode files. Please make a backup of the file before recoding. Without recoding you can try \inputencoding{latin1}\input{external-file}\inputencoding{utf8}. Mar 31, 2017 at 16:09
  • I've tried to do this, but shows errors at lines that were working well. Mar 31, 2017 at 17:22
  • 3
    JuniorSoares, @Schweinebacke's comment is the correct answer so if you get errors you should show the errors in the question. Note you can not input a complete document, only the body of the other documennt. Mar 31, 2017 at 18:20

1 Answer 1


I would recommend to recode the file. Before you convert the file you should make a backup!

There are several programs to do so, e.g., iconv. Some editors can also be used, e.g., Texmaker:

  • Start Texmaker and select ToolsConvert to unicode Tool selectin

  • Select the file to be converted either by typing in the filename or better by clicking to the select icon in the top right corner and selecting it in the file selection dialog: File selection

  • Click to the Convert to unicode button: Convert button

  • Click to the save icon in the top left corner of the result window: Save button I would suggest to use a new name e.g. test-utf8.tex and then change \input{test.tex} into \input{test-utf8.tex}.

If you really don't want to convert the file, you can try:


to input the latin1 file into a utf8 document. But IMHO things are more easy if all files have the same encoding.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .