3

I am having trouble using silence and authblk together. I have this MWE:

\documentclass{article}
\usepackage{silence}
\usepackage{authblk}

\begin{document}
Hi
\end{document}

Running pdflatex temp_mwe.tex gives me this:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./temp.tex
LaTeX2e <2019-10-01> patch level 3
(/home/zach/.local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/10/25 v1.4k Standard LaTeX document class
(/home/zach/.local/texlive/2019/texmf-dist/tex/latex/base/size10.clo))
(/home/zach/.local/texlive/2019/texmf-dist/tex/latex/silence/silence.sty)
(/home/zach/.local/texlive/2019/texmf-dist/tex/latex/preprint/authblk.sty
! Undefined control sequence.
\sl@StoreMessage ...expand \string \def \sl@Tempa 
                                                  {#1}\sl@RemoveGobble #1\sl...
l.113 \xdef\AB@author{\noexpand\AB@blk@and\@author
                                                  }

So the issue is happening when authblk is processed but seems to involve a line in silence, as evidenced by the macros beginning with \sl@. This is as far as my tex/latex knowledge goes. Any help would be much appreciated.

8
  • On a more basic level, it says that "The control sequence at the end of the top line of your error message was never \def'ed," which I already knew, although I am not sure what counts as the top line here. Is it saying the "\slTempa" or "\author" is not defined? – Zach Boyd Jan 14 '20 at 1:13
  • Maybe it is "\author," since putting an \author{Me} before I load \authblk removes the error – Zach Boyd Jan 14 '20 at 1:14
  • How about reversing the load order? That seems to compile without problem. – Werner Jan 14 '20 at 1:25
  • 1
    the undefined command in the error message is \sl@Tempa but the code it is showing is \def\sl@Tempa{.. so it is trying to define that but has already gone wrong earlier – David Carlisle Jan 14 '20 at 8:11
  • 1
    I would recommend not using it all, any message that is made by a package doesn't happen by accident or automatically. It is the explicit choice of the package author to catch some anomalous situation and warn about it. Silencing warning messages has, as you see here, a non zero chance of breaking the system with poor patches and an almost certain chance that you miss document errors by not seeing warnings. – David Carlisle Jan 14 '20 at 9:28
4

You can work around the problem in this way:

\documentclass{article}
\usepackage{etoolbox}
\usepackage{silence}
\makeatletter
\robustify\@latex@warning@no@line
\makeatother
\usepackage{authblk}


\begin{document}
Hi
\end{document}

The error happens during the loading of authblk, where the version of \@latex@warning@noline modified by silence needs to pass through \xdef. Disaster follows. With \robustify the macro isn't expanded by \xdef and the run can proceed well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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