Closed Holiverse closed 4 months ago
Hi @Holiverse, thanks for the report and for using commutative-diagrams
!
The bug you found is annoying, but fortunately it's also completely harmless.
TL;DR: until the next release, you can avoid the warnings by including the package as follows:
\usepackage{commutative-diagrams}
\let\kDMitraMaybeDumpCell\relax
\pgfextra
is a TikZ
directive to insert extra commands in the middle of a path. I used it to produce debug logs during development.
\kDMitraMaybeDumpCell
is the problematic macro
https://github.com/paolobrasolin/commutative-diagrams/blob/e68570b97d59446ef78e943b29d47c79fddb9ba4/src/tikzlibrarycommutative-diagrams.mitra.code.tex#L184-L187
and it's used in the routine handling the matrix sintax for objects
https://github.com/paolobrasolin/commutative-diagrams/blob/e68570b97d59446ef78e943b29d47c79fddb9ba4/src/tikzlibrarycommutative-diagrams.mitra.code.tex#L177
so it gets called once for every cell.
Unfortunately, \kDMitraMaybeDumpCell
is broken because it's calling \pgfextra
outside of a path. There is no visible output in the document (nullfont
is used in that context and it's not visible) but LaTeX still warns about the missing characters.
The problematic macro can be fixed with a simple override after the package is included (note the added \path ... ;
):
\documentclass{article}
\usepackage{commutative-diagrams}
\def\kDMitraMaybeDumpCell{\noexpand\path\noexpand\pgfextra{%
\noexpand\kDDump{'\noexpand\the\noexpand\pgfmatrixcurrentrow-\noexpand\the\noexpand\pgfmatrixcurrentcolumn':}%
\noexpand\kDDump{\space\space options: '\the\kDMitraCelOptTok'}%
\noexpand\kDDump{\space\space content: '\the\kDMitraCelCntTok'}};}
\kDDumpingtrue
\begin{document}
\begin{codi}[prompter]
\obj {A & B \\};
\end{codi}
\end{document}
Then, if the development debugging feature is activated with \kDDumpingtrue
as in the code above, the following output is produced in the log:
'1-1':
options: ''
content: 'A'
'1-2':
options: ''
content: 'B'
Arguably, that's useless for the end user.
Since the broken development debug feature is useless for the end user we can simply excise it:
\documentclass{article}
\usepackage{commutative-diagrams}
\let\kDMitraMaybeDumpCell\relax
\begin{document}
\begin{codi}[prompter]
\obj {A & B \\};
\end{codi}
\end{document}
Just released version 1.1.1
to fix this. :rocket:
Thanks @Holiverse!
Is there an existing issue for this?
Current behaviour
Recentely, when I use CoDi package in vscode as before, I found there are a lot of warning report that does not happen in the early version.
Expected behaviour
I hope we can find a reason for these numerous inexplicable warnings, and can find a way to fix it.
Steps to reproduce
When using latexmk in vscode to compile the following code
There are 16 warnings such as copies of the follow eight
It seems like that these characters are "pgfextra" which I do not understand what does this means. And the number of these warnings might be n*8 where n is the number of the object.
But if we input only one object, there is no warning.
Additional context
No response