# W3cubDocs

/LaTeX

### \typeout

Synopsis:

```\typeout{msg}
```

Print `msg` on the terminal and in the `log` file.

This

```\newcommand{\student}{John Dee}
\typeout{Recommendation for \student .}
```


LaTeX’s usual rules for treating multiple spaces as a single space and ignoring spaces after a command name apply to `msg`. As above, use the command `\space` to get a single space, independent of surrounding spaces. Use `^^J` to get a newline. Get a percent character with `\csname @percentchar\endcsname`.

This command can be useful for simple debugging, as here:

```\newlength{\jhlength}
\setlength{\jhlength}{5pt}
\typeout{The length is \the\jhlength.}
```

produces on the command line ‘The length is 5.0pt’.