I am trying to suppress messages of the form:
************************************************* * LaTeX warning: "xparse/redefine-command" * * Redefining document command \MyMacro with arg. spec. 'm' on line 29. *************************************************
I tried to use the silence package, but can't determine how to correctly use that package for such errors.
Code:
\documentclass{article}
\usepackage{xparse}
\usepackage{silence}
%% All these attempts do not solve this problem.
\WarningsOff[latex]
\WarningsOff[xparse]
\WarningFilter{latex}{LaTeX warning}
\WarningFilter{xparse}{LaTeX warning}
\WarningFilter{latex}{Redefining document command}
\WarningFilter{xparse}{Redefining document command}
\NewDocumentCommand{\MyMacro}{m}{\textbf{#1}}
\begin{document}
\MyMacro{some text}
\RenewDocumentCommand{\MyMacro}{m}{\emph{#1}}%
\MyMacro{some more text}
\end{document}
silencewill only silence output if it matches exactly and if it's produced by a specific command. – Werner Dec 11 '12 at 0:08