diff --git a/README.md b/README.md index 213a66c..24cf582 100644 --- a/README.md +++ b/README.md @@ -104,4 +104,9 @@ The `katex()` shortcode can be used to render katex without autorender. This can The `image()` shortcode can be used to embed images in markdown as follows: `{{ image(src="/ferris.png", alt="Alternate text", position="left", style="width: 20%; height: 20%;") }}` -Position can be either `left`, `center`, or `right`. Style allows you to embed css for the image. +Position can be either `left`, `center`, or `right`. Style allows you to embed css for the image. + +The `tikz()` shortcode can be used to embed tikzpicture code in latex. For example: +`{{ tikz(style="width: 20%; height: 20%;" position="center" body="\begin{tikzpicture}\draw (0,0) circle (1in);\end{tikzpicture}") }}` + +Position works the same way as `image`. Style allows you to embed css for the `div` holding the tikz svg. diff --git a/content/showcase.md b/content/showcase.md index c47dcaa..71f494e 100644 --- a/content/showcase.md +++ b/content/showcase.md @@ -79,4 +79,4 @@ Images: Tikz: -{{ tikz(body="\begin{tikzpicture}\draw (0,0) circle (1in);\end{tikzpicture}") }} +{{ tikz(style="width: 20%; height: 20%;" position="center" body="\begin{tikzpicture}\draw (0,0) circle (1in);\end{tikzpicture}") }} diff --git a/templates/index.html b/templates/index.html index 5d2a568..2474dd2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -260,6 +260,19 @@ margin-left: auto; } + .post_contents .tikz-left { + margin-right: auto; + } + + .post_contents .tikz-center { + margin-left: auto; + margin-right: auto; + } + + .post_contents .tikz-right { + margin-left: auto; + } + .post_contents blockquote { {%- if config.extra.base09 %} border-left: 3px solid {{ config.extra.base09 }}; diff --git a/templates/shortcodes/tikz.html b/templates/shortcodes/tikz.html index 6583a03..ef5a56a 100644 --- a/templates/shortcodes/tikz.html +++ b/templates/shortcodes/tikz.html @@ -1 +1 @@ - +