2

I've included a .tex file by using \input macro, but the problem comes when I use special characters (because I'm writing in Spanish, I use á, é, and characters like that).

I can use those caracters without any problem in the parent file (I have the spanish package declared), but not in the included file.

For that reason I get "Missing $ inserted" error.

7
  • Normally there should be no problem - if the tex-file you input use the same encoding as the parent file. Commented Dec 28, 2011 at 13:21
  • 3
    No. Whatever your problem is, it is related to your actual document(s). Try to make a complete example that demonstrates your problem, put the file in a zip-file and upload them somewhere. Commented Dec 28, 2011 at 13:31
  • 3
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. Check if both files are saved using the same encoding. Most likely the sub-file is in a different one. Commented Dec 28, 2011 at 14:42
  • 2
    Try to use the package grffile. Commented Dec 28, 2011 at 15:07
  • 1
    Yes @MartinScharrer it was a file encodings issue. I included several files, and some of them had different encodings. It is working now with all file encodings set to UTF-8. Thanks for all the answers Commented Dec 28, 2011 at 19:54

1 Answer 1

3

This is most likely be caused by different file encodings. Check if all files use the same encoding and use \usepackage[<encoding>]{inputenc}, where the <encoding> can be e.g. utf8.

You must log in to answer this question.

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