After spending way too much time I figured out how to create triangles with tikz like the following!
-
Install MikTex and Texstudio
-
Navigate to Texstudio’s folder and open up the texstudio.ini
-
Add the following line under the
[texmaker]
blockTools\Commands\dvi2svg-no-fonts="txs:///latex | dvisvgm --no-fonts --page=1- --output=3p %.dvi"
- Use this to embed (web safe) fonts instead of paths:
Tools\Commands\dvi2svg="txs:///latex | dvisvgm --font-format=woff --page=1- --output=3p %.dvi"
-
Now open up texstudio and create a .tex file with the property standalone
\documentclass[12pt, tikz, border=5mm]{standalone}
at the top of the file
-
Now go to Tools→User→dvi2svg
-
Now open the folder with your .tex file and you’ll find your .svg file!
-
I further went in and edited the width and height to be 500px since its tiny by default
The latex code for this triangle:
I also made a python script to automatically resize the SVGs (must be placed in the same folder as your latex files):
and finally a .bat file to run everything all at once!