In many of the editors and tools I use, I'm given the option to choose an "encoding" as well as a choice among "new lines". For example, in BBEdit, I am given the following for encoding

enter image description here

and this

enter image description here

for new lines.

Are there settings for these that are more likely to ensure portability across platforms and tools? Are there corresponding settings or options in LaTeX code that need to match the choices made here?

1 Answer 1


For the file format, you can probably ignore the Classic Mac (CR) option as these days, Mac use the Unix (LF) line ending. The picky one will be windows on this one as although some editors will support Unix line ending, be default, users will probably have issues with such files. So for that reason I would use the Windows (CRLF) option as Unix/Linux/OS X will also be able to handle these files without any problems. (I am a unix user with very few dealings with windows so my preconceptions may be wrong regarding this OS and maybe things have changed in this regard.)

This I think will be an issue only for viewing the source or editing. Compilation should not be a problem whichever option you choose.

Regarding the file encoding, I think UTF-8 is pretty standard these days and probably the recommended option. Make sure you either use the correct inputenc when using latex/pdflatex or use XeLaTeX or LuaLaTeX which assume that the input file is encoded in UTF-8.

  • 2
    Good editors under Windows should be able to interpret files with LF line ending (and in the past I've had problems with CRLF line endings). I'd go with LF, but your advice is just as good, I believe.
    – egreg
    Commented Mar 22, 2012 at 21:10
  • @egreg: And it sounds like, if I avoid Windows altogether LF should be fine.
    – orome
    Commented Mar 22, 2012 at 22:05
  • I think what @egreg is saying is that unless you use notepad to edit your files, LF will also be fine on Windows. If you use BBEdit under OS X, UltraEdit under Windows should be very familiar.
    – ArTourter
    Commented Mar 23, 2012 at 1:44

You must log in to answer this question.

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