TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
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 Mar 22 '12 at 21:10
@egreg: And it sounds like, if I avoid Windows altogether LF should be fine. – raxacoricofallapatorius Mar 22 '12 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 Mar 23 '12 at 1:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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