Metadata-Version: 2.4
Name: tikzpics
Version: 0.1.2
Summary: Python interface to generate (readable) Tikz figures.
Author: Max
Project-URL: Source, https://github.com/max-models/tikzpics
Keywords: python
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pymupdf
Provides-Extra: dev
Requires-Dist: black[jupyter]; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pyproject-fmt; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: tikzpics[docs]; extra == "dev"
Requires-Dist: tikzpics[test]; extra == "dev"
Requires-Dist: tikzpics[vis]; extra == "dev"
Provides-Extra: vis
Requires-Dist: matplotlib; extra == "vis"
Requires-Dist: jupyterlab; extra == "vis"
Provides-Extra: docs
Requires-Dist: ipykernel; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: nbconvert; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: numpy; extra == "docs"
Requires-Dist: scipy; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-book-theme; extra == "docs"
Requires-Dist: sphinx-design; extra == "docs"
Requires-Dist: sphinxcontrib-mermaid; extra == "docs"
Requires-Dist: tikzpics[vis]; extra == "docs"
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest; extra == "test"

# tikzpics

Python interface to generate (readable) Tikz figures.

# Install

Create and activate python environment, then install `tikzpics` with

```
pip install tikzpics
```

# Examples

## Generate tikz-figures with Python API

```python
fig = TikzFigure()

n1 = fig.add_node(0, 0, shape="circle", color="white", fill="blue", content="Hello!")
n2 = fig.add_node(5, 0, shape="circle", color="white", fill="red", content="Hi!")

fig.draw([n1, n2], options=["->", "line width=2"], color="gray")

fig.show()
```

Note that to visualize the plots in a popup or in jupyterlab, install with `pip install tikzpics[vis]`

## IPython Magic Commands

tikzpics includes IPython magic commands for compiling TikZ figures directly in Jupyter notebooks!

Load the extension:
```python
%load_ext tikzpics.ipython
```

Then use the `%%tikz` cell magic:
```python
%%tikz
\begin{tikzpicture}
\draw[thick, blue] (0,0) circle (2cm);
\node at (0,0) {Hello TikZ!};
\end{tikzpicture}
```

See [tutorials](https://max-models.github.io/tikzpics/tutorials) for more examples!
