I would like to be able to have some kind of logging command that is able to log text to the default pdflatex logfile (<input-base-filename>.log). Is this possible, and if so, how?

In particular, I'd like to be able to use this command inside the document (i.e. between \begin{document} and \end{document}).

  • welcome to tex.sx. Note that you can use back-ticks ` to mark inline code. Then you don't need to handle < > any special as well. Feb 28, 2011 at 13:21

2 Answers 2


You can use \wlog{<log text line>} to write a text line to the log. It will not appear in the console output but only in the log file.

If you want to write text to the log file and the console output you can use
\typeout{<log text line>}.



\typeout{===This appears in the log and the terminal===}%
\wlog{===This only in the log file===}%


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .