this way all images get a left-hand border, even when cropped.
However, the latex package standalone has a dedicated [tikz] option that gives much cleaner results and renders images without a left-hand border. So the above template should be replaced with
--- LaTeX template used to compile TikZ images. Takes additional
--- packages as the first, and the actual TikZ code as the second
--- argument.
local tikz_template = pandoc.template.compile [[
\documentclass[tikz]{standalone}
$for(header-includes)$
$it$
$endfor$
$additional-packages$
\begin{document}
$body$
\end{document}
]]
As of today the standalone document template for tikz diagrams looks like:
this way all images get a left-hand border, even when cropped.
However, the latex package standalone has a dedicated
[tikz]
option that gives much cleaner results and renders images without a left-hand border. So the above template should be replaced with