1

I am using the skak package in Overleaf to draw some chess boards. All works fine in the document, however upon compiling I receive the following warning:

Warning

This code gives the Warning:

\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{verbatim}
\usepackage{skak}
\usepackage{diagram}

\newcommand\showboardsize[1][1]{\resizebox{#1 \textwidth}{!}{\showboard}}

\begin{document}

\begin{figure} \centering \newgame \fenboard{r4r1k/p5Rp/1p3pb1/2P4N/2B5/P7/6PP/B2n2K1 w - - 0 1} \showboardsize[.3] \caption{\textbf{Mate in Three, White to move}\ Solution: {\wT}g8+, Rxg8, Bxf6+, Rg7, Bxg7#} \label{fig:ch1} \end{figure}

\end{document}

I have tried the following, but both did not work.

\RequirePackage{silence}
\WarningsOff[chessfss]

Also with loading chessfss before did not work.

\RequirePackage{chessfss}
\RequirePackage{silence}
\WarningsOff[chessfss]

Any idea if it is possible to deal with this warning, or how to hide warnings that cannot be dealt with, due to inaccessibility of the distribution in Overleaf?

Thanks!

Joost
  • 87
  • If you could post a short example document that reproduces the warning (a so-called MWE: https://tex.meta.stackexchange.com/q/228/35864) you have a much better chance of getting a good answer more quickly, since people won't have to guess what your setup looks like (simply loading \usepackage{chessfss} in a \documentclass{article} document does not appear to trigger the warning). The warning isn't issued just for fun, so before you suppress it, you should make sure you understand the implications of the warning. – moewe Aug 16 '20 at 12:10
  • Indeed in a very simple setup, \usepackage{silence} \WarningsOff[chessfss] \usepackage{chessfss} seemed to work for me: https://gist.github.com/moewew/dfb6242a93c6710dac7571a9c7615eb7, so something more exciting seems to be going on in your document – moewe Aug 16 '20 at 12:16

2 Answers2

1

It turned out the culprit was the order in which the packages were loaded in the .cls file. I checked the .dtx file for the chessfss package, and the error would be triggered if the command \comment was already defined.

I will try to figure out later the package which triggers the conflict and causes this warning.

Edit: It turns out to be the verbatim package. If loaded before the skak package you will get the warning.

This code does not give the Warning:

\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{skak}
\usepackage{verbatim}
\usepackage{diagram}

\newcommand\showboardsize[1][1]{\resizebox{#1 \textwidth}{!}{\showboard}}

\begin{document}

\begin{figure} \centering \newgame \fenboard{r4r1k/p5Rp/1p3pb1/2P4N/2B5/P7/6PP/B2n2K1 w - - 0 1} \showboardsize[.3] \caption{\textbf{Mate in Three, White to move}\ Solution: {\wT}g8+, Rxg8, Bxf6+, Rg7, Bxg7#} \label{fig:ch1} \end{figure}

\end{document}

Joost
  • 87
1

How to deal with warnings is to read them! :-)

So this says that chessfss was going to define a command \comment but there already was command with the same name, that is some other package had also defined such a command (namely verbatim as you found out).

In the documentation for chessfss it turns out that already in 2006 a new command \chesscomment was created doing the same as the command \comment in the class. The reason was exactly to avoid a clash with other commands with the same name.

So for chess comments you should use \chesscomment and then the warning is harmless. There has been no new version of chessfss since then. (If there was a new version maybe \command there would be obsoleted and all users would be expected to have gone over to writing \chesscommand by now.)

If you load the packages in the other order then chessfss will actually define \command but then it will be overwritten by that other package. Then there will be no warnings. If there are other reasons why the other package should be loaded first a way to avoid warnings is to remove the situation that chessfss warns about, that is to undefine \comment before loading it:

\let\comment\undefined
\usepackage{skak}

(Using answers here for undefined a command.)

pst
  • 4,674
  • I wrote about the comment definitions of the chessfss.dtx file in the first sentence of my answer, and know that is it harmless. I just cannot stand that orange warning indicator above the pdf viewer in Overleaf. – Joost Aug 17 '20 at 16:49
  • 1
    @JoostKruis I'm trying to cover various options that can be useful for people who have problems with "comment" command clash in chessfss in the future. I've edited it with another way to avoid warnings now that might be of interest to you. – pst Aug 17 '20 at 17:56