TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}).

share|improve this question
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. – Martin Scharrer Feb 28 '11 at 13:21
up vote 10 down vote accepted

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>}.

share|improve this answer


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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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