Closed markomanninen closed 6 years ago
Sorry for the somewhat late reply. Your example is faulty. The TikZ magic doesn't work like that. What you want is rather something like
%%tikz -l shapes,backgrounds
\begin{scope}[shift={(3cm,-5cm)}, fill opacity=0.5]
\fill[red] \firstcircle;
\fill[green] \secondcircle;
\fill[blue] \thirdcircle;
\draw \firstcircle node[below] {$A$};
\draw \secondcircle node [above] {$B$};
\draw \thirdcircle node [below] {$C$};
\end{scope}
In addition you would like to have a LaTeX preamble containing
\def\firstcircle{(0,0) circle (1.5cm)}
\def\secondcircle{(60:2cm) circle (1.5cm)}
\def\thirdcircle{(0:2cm) circle (1.5cm)}
This is currently not supported, but not hard to add to the magic.
I added an option for specifying a preamble. The correct example should look something like the following. First, in an Python code cell, define
preamble = """
\def\firstcircle{(0,0) circle (1.5cm)}
\def\secondcircle{(60:2cm) circle (1.5cm)}
\def\thirdcircle{(0:2cm) circle (1.5cm)}
"""
This should be followed by a TikZ cell,
%%tikz -l shapes,backgrounds -x $preamble
\begin{scope}[shift={(3cm,-5cm)}, fill opacity=0.5]
\fill[red] \firstcircle;
\fill[green] \secondcircle;
\fill[blue] \thirdcircle;
\draw \firstcircle node[below] {$A$};
\draw \secondcircle node [above] {$B$};
\draw \thirdcircle node [below] {$C$};
\end{scope}
Is there something I could do to overcome this error when trying to execute some tikz latex code in Jupyter notebook cell magic %%tikz?
Script I'm executing is:
Also other examples say "No image generated.". I have installed basic-miktex-2.9.6219-x64 and it didn't show any special errors on installation process.