yishn / tikzcd-editor

A simple visual editor for creating commutative diagrams.
https://tikzcd.yichuanshen.de/
MIT License
1.88k stars 99 forks source link

Add node style #22

Open LudwikJaniuk opened 6 years ago

LudwikJaniuk commented 6 years ago

For example, margin, circle, et.c.

yishn commented 6 years ago

What are node styles? Can you elaborate with some code examples or direct to some documentation?

LudwikJaniuk commented 6 years ago

Sure! I was surprised not to see that much of it in the tikzcd documentation (first time I hear of tikzcd, only used tikz), but for example, this code would produce nodes with boxes around them. The boxes are what I refer to as "node style".

\begin{tikzcd}[cells={nodes={draw=gray}}]
s_1 \arrow[rr] &  & s_2 \arrow[rr] &  & s_3 \\
\end{tikzcd}

Or red circles:

\begin{tikzcd}[cells={nodes={draw=red, circle}}]
s_1 \arrow[rr] &  & s_2 \arrow[rr] &  & s_3 \\
\end{tikzcd}

Ideally I would like to be able to specify different styles for the nodes separately, but I'm not sure what the syntax is in tikzcd. In tikz, you would write something like:

\node[circle] at (0,0) {text}; \node[draw=blue] at (2,0) {other text};

By the way, thank you so much for creating this tool, it's a small thing but it's really useful!