How to use TikZ-libraries in TikZJax?

136 Views Asked by At

(1a) TikZJax-Website: https://tikzjax.com/
(1b) Github: https://github.com/kisonecat/tikzjax
(2) Demo: https://tikzjax-demo.glitch.me/

How can I use TikZ-libraries in TikZJax?

For example \usetikzlibrary{shapes} and then

\node[regular polygon, regular polygon sides=7, draw] at (2,0) {my polygon};

(or whatever).

I tried to put in "library-stuff" at the demo-page (2), without success.

1

There are 1 best solutions below

0
bill_ion On

Original TikZJax can't do this. drgrice1's fork may do this, but I'd still recommend trying benrbray's fork, which solved the build issues and provides a Dockerfile for a useful build guide.

So maybe you can try to put your code like this:

\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\node[regular polygon, regular polygon sides=7, draw] at (2,0) {my polygon};
\end{tikzpicture}
\end{document}

into my live demo: https://bill-ion.github.io/tikzjax-live/ , which is mainly based on benrbray's fork that allow you to use tikz-libraries (\usetikzlibrary{*}) and some packages (\usepackage{*}).