6

The complexity package uses the \typeout command to print a banner when the package is loaded.

What is the correct way to disable the banner (other than editing the source code of the package)?


MWE:

\documentclass{article}
\usepackage{complexity}
\begin{document}$\P = \NP$\end{document}

Compile with "pdflatex". During the compilation, you will see something like this:

  +----------------------------------------------+
    complexity LaTeX package 
    version: 
    author: Chris Bourke (cbourke@cse.unl.edu) 
  +----------------------------------------------+
lockstep
  • 250,273
Jukka Suomela
  • 20,795
  • 13
  • 74
  • 91

2 Answers2

8

There's no correct way, I'm afraid:

%  Changes made (.76 -> .80)
%   -Added a cool message using \typeout!

You can suppress the message with the following trick

\let\latextypeout\typeout
\def\typeout#1{\let\typeout\latextypeout}
\usepackage{complexity}

Since \typeout is almost the first instruction in complexity.sty, this will disable printing the "cool message" and redefine \typeout to the original meaning.

egreg
  • 1,121,712
4
\let\savedtypeout\typeout
\def\typeout#1{}
\usepackage{complexity}
\let\typeout\savedtypeout
David Carlisle
  • 757,742
  • Is this kind of approach "safe"? Do I lose any warnings and/or errors this way? – Jukka Suomela Sep 30 '12 at 20:32
  • No it only affects \typeout that are actually executed during the package load, any \typeout that are embedded in commands defined by the package will execute the restored normal definition when they are run. It would be possible for a package to save the definition of \typeout active when it was loaded and use that saved definition (rather than \typeout itself) in commands, but that is unlikely in general and does not happen in the case of this package (I just looked:-) – David Carlisle Sep 30 '12 at 20:47