# Rendering tikz graphics using Tikzit and MacOS

I wanted to try using "Tikzit" for MacOS to create some simple diagrams without too much hassle. Running the below code:

\documentclass{article}
\usepackage{tikzit}
\usepackage{tikz}
\input{mystyle.tikzstyles}
\begin{document}
\tikzfig{density.tikz}
\end{document}


using the following mystyle.tikzstyles

% TiKZ style file generated by TikZiT. You may edit this file manually,
% but some things (e.g. comments) may be overwritten. To be readable in
% TikZiT, the only non-comment lines must be of the form:
% \tikzstyle{NAME}=[PROPERTY LIST]

% Node styles
\tikzstyle{red dot}=[fill={rgb,255: red,45; green,100; blue,189}, draw=black, shape=circle]
\tikzstyle{new style 0}=[fill=white, draw=black, shape=circle]

% Edge styles
\tikzstyle{new edge style 0}=[->]
\tikzstyle{dashed}=[-, dashed]


And using the following density.tikz:

\begin{tikzpicture}
\begin{pgfonlayer}{nodelayer}
\node [style=none] (0) at (-2, 0) {};
\node [style=none] (1) at (2, 0) {};
\node [style=red dot] (2) at (0.5, 3.25) {};
\node [style=new style 0] (3) at (0.5, 0.75) {};
\node [style=none] (4) at (-2, -0.5) {};
\node [style=none] (5) at (2, -0.5) {};
\end{pgfonlayer}
\begin{pgfonlayer}{edgelayer}
\draw [bend left=60, looseness=1.25] (0.center) to (1.center);
\draw [style=new edge style 0] (3) to (2);
\draw [style=dashed, in=120, out=60, looseness=1.25] (4.center) to (5.center);
\end{pgfonlayer}
\end{tikzpicture}


Everything seems to work fine, except when rendering PDF/the image, I'm only seeing a red "box" containing the text "density.tikz" inside the document. I'm not very MacOS savvy and thus I'm not sure how to proceed with this kind of problem.

I'm running the latest MacOS Mojave build, 18G95 and the tex distribution for this year.

The extension is automatically added to the argument for \tikzfig, so when you try \tikzfig{density.tikz} then the package gets confused. When you remove the extension it works ok:

\documentclass{article}
\usepackage{tikzit}
\input{mystyle.tikzstyles}
\begin{document}
\tikzfig{density}
\end{document}


However, in the style file there is a definition \tikzstyle{dashed}=[-, dashed], which is recursive (dashed is called in the definition of dashed) and leads to a memory error. So don't use that definition. Instead use a different name or write it in full (i.e., \draw [-, dashed, in=120, out=60, looseness=1.25] (4.center) to (5.center);).

Result after this correction: