0

Is there a list or overview of character codes that can be used within \message or \typeout to format the printed string in pdfTeX, Version 3.14159265-… (TeX Live 2017)?

I know of ^^J which does a line break. Are there more?

\documentclass{minimal}\makeatletter
\message{^^J==> Hello^^JWorld! <==^^J}
\typeout{^^J==> Hello^^JWorld! <==^^J}
\@@end
3

\message does full expansion on its argument. Unexpandable tokens will be represented as themselves; control sequences will be preceded by the \escapechar (if nonnegative) and followed by a space if they are control words. If \newlinechar is nonnegative, the corresponding character will produce a line break.

The following plain TeX file lupino.tex shows the features.

\def\Now#1{Now#1}

\message{^^J\Now\space you can^^J\relax^^J}

\newlinechar=`^^J

\message{^^J\Now\space you can^^J\relax^^J}

\escapechar=-1

\message{^^J\Now\space you can^^J\relax^^J}

\end

The console output will be

This is TeX, Version 3.14159265 (TeX Live 2018) (preloaded format=tex)
(./lupino.tex ^^JNow you can^^J\relax ^^J 
Now you can
\relax 

Now you can
relax 
 )
No pages of output.
Transcript written on lupino.log.

There's no difference if you run pdftex instead of tex.

Plain TeX doesn't set \newlinechar, LaTeX sets it to 10 with

\newlinechar=`^^J
3

essentially \message has no other formatting, ^^J is not built in, any character with code the value of \newlinechar is not printed but instead forces a newline. The latex sources have:

\newlinechar`\^^J
  • Say, i wanted ^^T to do a line break and four spaces (tab). Would it be possible to "teach" this to \message? I know that I could define a macro that does that. And i noted by experimenting that ^^k for unstance produces a + while other letters produce different symbols, others (like ^^T) throw errors. Is there something i can read to understand whats happening with ^^-char? – Lupino Feb 8 '19 at 12:42
  • you could make it active but why not just use a local definition of say \def\\\{^^J\space\space\space\space} and use \\ ? – David Carlisle Feb 8 '19 at 12:54
  • This question was less about "how do i use X to achieve Y" but rather "i want to understand what X is and how X works; Y is an example." – Lupino Feb 11 '19 at 8:07

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.