Cell magic for PGF/TikZ-to-SVG rendering in Jupyter
Project description
itikz
Cell magic for PGF/TikZ-to-SVG rendering in Jupyter
Free software: MIT license
Documentation: https://itikz.readthedocs.io.
Usage
Install it:
pip install itikz
Import it:
import itikz
Use it (this example from Austin):
%%itikz
\documentclass[tikz]{standalone}
\newcommand{\tikzAngleOfLine}{\tikz@AngleOfLine}
\def\tikz@AngleOfLine(#1)(#2)#3{%
\pgfmathanglebetweenpoints{%
\pgfpointanchor{#1}{center}}{%
\pgfpointanchor{#2}{center}}
\pgfmathsetmacro{#3}{\pgfmathresult}%
}
\newcommand{\tikzMarkAngle}[3]{
\tikzAngleOfLine#1#2{\AngleStart}
\tikzAngleOfLine#1#3{\AngleEnd}
\draw #1+(\AngleStart:0.4cm) arc (\AngleStart:\AngleEnd:0.4cm);
}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0, 0);
\coordinate (z) at (3, 3);
\coordinate (a) at (3, 0);
\draw [->, thick] (-1, 0) -- (5, 0);
\draw [->, thick] (0, -1) -- (0, 5);
\draw (O) -- (z);
\draw (O) -- (z) node[above, midway]{$r$};
\draw (a) -- (z) node[right, midway]{$a$};
\draw (O) -- (a) node[below, midway]{$b$};
\draw (z) node[circle, fill, inner sep=1pt]{} node[right]{$z$};
\draw (O) node[left, yshift=-0.25cm]{$O$};
\draw (O) node[xshift=0.55cm, yshift=0.2cm]{$\phi$};
\tikzMarkAngle{(O)}{(a)}{(z)}
\end{tikzpicture}
\end{document}
Todo
Add argparse options for optional non-removal of artifacts.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.0.1 (2018-10-12)
First release on PyPI.
0.0.2 (2018-10-13)
Emit error messages.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
itikz-0.0.2.tar.gz
(9.1 kB
view hashes)