7

\write16 sends to terminal, \message also does this. Why there are two commands for this and in which cases each one must be used?

  • on can see \message like \immediate\write but there is an other difference that's each write start a new line and \message don't – touhami Aug 10 '16 at 5:53
  • TeX by topics page 250 – touhami Aug 10 '16 at 6:01
  • See The TeXbook, bottom of page 227–top of page 228. – GuM Aug 10 '16 at 9:25
8

Here's in D. Knuth's words

An ‘\immediate\write16’ differs from \message in that \write prints the text on a line by itself; the results of several \message commands might appear on the same line, separated by spaces.

Sample.tex

First page
\write16{** one **}  \message{** two **}

\vfill\eject
Second page
\immediate\write16{** one W **}\immediate\write16{** two W **} 
\message{** one M **}\message{** two M **}
\bye

sample.log shows

(sample.tex ** two ** [1{[....]/texmfs/data/pdftex/config/pdftex.map}
** one **
]
** one W **
** two W **
** one M ** ** two M ** [2] )
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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