2

According to this answer, TeX's standard end-of-line character is ASCII 13 (Carriage Return) with catcode 5.

How does TeX recognize the end of a line on systems with a different end-of-line character, e.g. on Unix systems, whose end-of-line character is ASCII 10 (Line Feed), which on my Mac has catcode 12 like the letters of the alphabet?


* I'm interested in pdfTeX, LuaTeX and XeTex.

3
  • 1
    The record terminator is implementation dependent; TeX will remove it together with whatever remains on the line, also removes trailing blank spaces (character code 32) and tabs (character code 9) and puts in the character having the current value of \endlinechar as character code. Commented Jun 20, 2017 at 17:36
  • I added the info to my answer. Commented Jun 20, 2017 at 17:42
  • @egreg: There's a point in your addendum to that answer that baffles me. I wrote a comment explaining my misgivings. Commented Jun 20, 2017 at 19:11

1 Answer 1

3

As explained in the addendum to my answer, the exact record terminator is completely irrelevant because it is thrown away when the line is read in.

So whether the OS thinks records are terminated with CR, LF or CR+LF is of no importance whatsoever as far as TeX is concerned. The current \endlinechar with its category code can be assumed to terminate a line, from a TeX programmer’s point of view.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.