SpectralSequences / latex

Latex package to print spectral sequence diagrams using pgf/tikz.
9 stars 4 forks source link

Draft Mode + DrawIfValidDifferential fails to compile #5

Closed dalcde closed 4 years ago

dalcde commented 5 years ago

This compiles without draft but fails to compile with draft.

\documentclass{article}
\usepackage[draft]{spectralsequences}

\begin{document}
\begin{sseqpage}
  \class(0, 2)
  \class(1, 0)
  \DrawIfValidDifferential2(1, 0)(0, 2)
\end{sseqpage}
\end{document}

Temporary workaround: Add the line

\DeclareDocumentCommand \sseq@DrawIfValidDifferential@ { mmO{} } {}

to line 1519 of sseqmain.code.tex

hoodmane commented 4 years ago

Fixed by a488819b66832ff0ce1d2481a643298779b32e1f.

I don't really understand why the issue happened, there was too much noise for my usual \tracingall debugging to work. My guess is it's some sort of glitch related to internals of \sseq@DeclareDocumentCommand and \DeclareDocumentCommand.

The solution I used was based on the suggestion of adding also a dummy definition for \sseq@DrawIfValidDifferential@. I modified to make sure that it scoops up the page number and the coordinates and handles the branching if present. If true and or false clauses are present, I chose to always take the clause. Hypothetically someone could write code that breaks if neither the true clause nor the false clause is taken (or if both are taken) so this seems like a reasonable choice to me.

Currently doesn't emit any "no ( character in null font" messages to log. I also added an \expandafter to fix the "\if clause not ended before \endinput" warning in the log. I'm not really sure why that is a warning rather than a horrible crash.