chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
29 stars 4 forks source link

TikZ from within \newcommand causes makecourse to call packages it doesn't need to #72

Open prowlett opened 3 years ago

prowlett commented 3 years ago

This does not run.

\documentclass{article}
\usepackage{tikz}
\usepackage{multirow}

\begin{document}
    \begin{tabular}{cc}
        \multirow{2}{*}{a} & 1\\
        & 2
    \end{tabular}
\end{document}

makecourse stops with error ValueError: "{" is not a valid relation. I guess multirow is not supported. Fine.

This runs fine. I have the multirow inside a tikzpicture, meaning it should render as an image and then be passed to the HTML, which is what appears to happen.

\documentclass{article}
\usepackage{tikz}
\usepackage{multirow}

\begin{document}
    \begin{tikzpicture}
    \node at (0,0) {\begin{tabular}{cc}
        \multirow{2}{*}{a} & 1\\
        & 2
        \end{tabular}};
    \end{tikzpicture}
\end{document}

This, which I think should be the same thing, however does not run. It stops with error ValueError: "{" is not a valid relation. So it looks to me as though calling TikZ from within a \newcommand causes makecourse to try to run the multirow (same error as when it was used directly), whereas including this tikzpicture in the code directly doesn't.

\documentclass{article}
\usepackage{tikz}
\usepackage{multirow}
\newcommand{\multirowthing}{\begin{tikzpicture}
    \node at (0,0) {\begin{tabular}{cc}
        \multirow{2}{*}{a} & 1\\
        & 2
        \end{tabular}};
    \end{tikzpicture}}

\begin{document}
\multirowthing
\end{document}

Might be related to #71?