Skip to content

Commit 1997186

Browse files
authored
Implemented support for tikzjax (cotes2020#1990)
Implemented cotes2020#1976. Signed-off-by: George Araújo <[email protected]>
1 parent 6130018 commit 1997186

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

_includes/head.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
<link href="{{ '/assets/css/bootstrap-toc.min.css' | relative_url | bust_file_cache }}" rel="stylesheet" />
2222
{% endif %}
2323

24+
{% if page.tikzjax %}
25+
<link defer rel="stylesheet" type="text/css" href="https://tikzjax.com/v1/fonts.css">
26+
<script defer src="https://tikzjax.com/v1/tikzjax.js"></script>
27+
{% endif %}
28+
2429
<!-- Styles -->
2530
{% if site.icon.size <= 4 %}
2631
<link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{{ site.icon }}</text></svg>">

_posts/2023-12-12-tikzjax.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: post
3+
title: a post with TikZJax
4+
date: 2023-12-12 22:25:00
5+
description: this is what included TikZ code could look like
6+
tags: formatting diagrams
7+
categories: sample-posts
8+
tikzjax: true
9+
---
10+
This is an example post with TikZ code. TikZJax converts script tags (containing TikZ code) into SVGs.
11+
12+
<script type="text/tikz">
13+
\begin{tikzpicture}
14+
\draw[red,fill=black!60!red] (0,0) circle [radius=1.5];
15+
\draw[green,fill=black!60!green] (0,0) circle [x radius=1.5cm, y radius=10mm];
16+
\draw[blue,fill=black!60!blue] (0,0) circle [x radius=1cm, y radius=5mm, rotate=30];
17+
\end{tikzpicture}
18+
</script>

0 commit comments

Comments
 (0)