This library allows one to create PGF/TikZ pictures and save in various formats.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mykel Kochenderfer 37b9d71da3 TikzPictures v0.3.0 [37b9d71da3] 6 years ago
src Fixed deprecated String and Uint64 warnings 6 years ago
test TikzPictures.jl generated files. 8 years ago
.travis.yml Update .travis.yml 6 years ago
LICENSE.md TikzPictures.jl generated files. 8 years ago
README.md Update README.md 6 years ago
REQUIRE TikzPictures v0.3.0 [37b9d71da3] 6 years ago

README.md

TikzPictures

Build Status

This library allows one to create Tikz pictures and save in various formats. It integrates with IJulia, outputting SVG images to the notebook.

In order to use this library, lualatex must be installed. The texlive and miktex distributions include lualatex. You must also have dvisvgm installed. On Ubuntu, you can get these, if not already present, by running sudo apt-get install texlive-latex-base and sudo apt-get install texlive-binaries.

You also need pdf2svg. On Ubuntu, you can get this by running sudo apt-get install pdf2svg. On Windows, you can download the binaries from http://www.cityinthesky.co.uk/opensource/pdf2svg/. Be sure to add pdf2svg to your path (and restart).

Note: this package will attempt to turn off interpolation in the generated SVG, but this currently only works in Chrome.

Example

using TikzPictures
tp = TikzPicture("\\draw (0,0) -- (10,10);\n\\draw (10,0) -- (0,10);\n\\node at (5,5) {tikz \$\\sqrt{\\pi}\$};", options="scale=0.25", preamble="")
save(PDF("test"), tp)
save(SVG("test"), tp)
save(TEX("test"), tp)

As you can see above, you have to escape backslashes and dollar signs in LaTeX. To simplify things, this package provides the LaTeXString type, which can be constructed via L"...." without escaping backslashes or dollar signs.

tp = TikzPicture(L"""
\draw (0,0) -- (10,10);
\draw (10,0) -- (0,10);
\node at (5,5) {tikz $\sqrt{\pi}$};"""
, options="scale=0.25", preamble="")