7

Possible Duplicate:
Is there a way to avoid repetitive compiler warning messages?

When debugging some stuff I sometimes have empty mdframes and I get the log file littered with tons of

"Package mdframed Warning: You got a bad break"

How can I disable this message for mdframed only? (I still need warnings/errors from other packages)

2 Answers2

4

The mdframed package uses

\newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}}

to report warning messages. So, to disable all warning messages from mdframed, you could redefine this in your preamble (after loading the mdframed package) to ignore the message:

\makeatletter
    \renewcommand*\mdf@PackageWarning[1]{}
\makeatother

Notes:

  • As Marco Daniel commented, this kind of solution is generally not a good idea as it will eliminate all warning message form the mdframed package. So if you want to eliminate just one message it is better to use the silence package as per the other answer.

References:

Peter Grill
  • 223,288
4

As Scott H. suggests in a comment you can use the silence package for this purpose. Minimal example:

\documentclass{article}

\usepackage{silence}

\usepackage{mdframed}

\WarningFilter{mdframed}{You got a bad break}

\makeatletter

\mdf@PackageWarning{You got a bad break\MessageBreak
  because the last split box is empty\MessageBreak
  You have to change the settings}

\makeatother

\begin{document}

\end{document}
mhp
  • 8,692