I am trying to define my own node style in a separate \tikzset and as far as I understood the only way to pass them to TikzPictures is to use the preamble= argument.
TikzPicture(L"[all exes=unit length=20cm]
\draw (0,0) -- (1,1);
\draw (1,0) -- (0,1);
\node at (0.5,0.5) {tikz $\sqrt{\pi}$};
", "scale=1", L"$\tikzset{
pics/mynode/.style args={#1,#2,#3}{
code={
\draw (0,0) -- (1,-1) -- (2,0) -- (2,2) -- (0,2) -- (0,0);
\node[#3] (#1) at (1,1) {#2};
}
}
}
$", true)
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 $
\tikzset{
So wondering how the preamble is to be used? I played around but could not figure out.
Also I think it would be nice to provide the path to a preamble file using a environment variable, just like in PGFPlotsX.jl. I'll try to follow up with an MR.
I am trying to define my own node style in a separate
\tikzset
and as far as I understood the only way to pass them toTikzPictures
is to use thepreamble=
argument.This is what I am trying to set:
I set the
preamble
using:and then tried
However, I got
So wondering how the
preamble
is to be used? I played around but could not figure out.Also I think it would be nice to provide the path to a preamble file using a environment variable, just like in
PGFPlotsX.jl
. I'll try to follow up with an MR.