Take the 2-minute tour ×
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.

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
add comment

2 Answers 2

up vote 9 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
add comment
\documentclass{article}

\begin{document}

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

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

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.