Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 1.04 KB

42-pandoc-tikz.md

File metadata and controls

47 lines (38 loc) · 1.04 KB
title date tags keywords summary
Using Tikz with Pandoc
2022-02-18 20:03:31 -0600
pandoc
tikz, latex, pandoc, lua, filter
Showcase of using integrating Tikz with Pandoc lua filters

I thought it would be nice to integrate Tikz as part of my blog using Pandoc lua filters.

So the following:

```tikz
\begin{tikzpicture}

\def \n {5}
\def \radius {3cm}
\def \margin {8} % margin in angles, depends on the radius

\foreach \s in {1,...,\n}
{
  \node[draw, circle] at ({360/\n * (\s - 1)}:\radius) {$\s$};
  \draw[->, >=latex] ({360/\n * (\s - 1)+\margin}:\radius)
    arc ({360/\n * (\s - 1)+\margin}:{360/\n * (\s)-\margin}:\radius);
}
\end{tikzpicture}
```

would be rendered as:

\begin{tikzpicture}

\def \n {5}
\def \radius {3cm}
\def \margin {8} % margin in angles, depends on the radius

\foreach \s in {1,...,\n}
{
  \node[draw, circle] at ({360/\n * (\s - 1)}:\radius) {$\s$};
  \draw[->, >=latex] ({360/\n * (\s - 1)+\margin}:\radius)
    arc ({360/\n * (\s - 1)+\margin}:{360/\n * (\s)-\margin}:\radius);
}
\end{tikzpicture}