Zulip Chat Archive

Stream: general

Topic: Geometry diagram in blueprint


Weiyi Wang (Dec 28 2025 at 14:20):

Is it possible to include diagram for e.g. Euclidean geometry? I tried \usepackage{tkz-euclide} at the beginning, but it gives the following error

Error log

Patrick Massot (Dec 29 2025 at 10:22):

Sure, you simply need to tell plasTeX how to deal with this package (plasTeX will try to read TeX sources of packages when desperate but there is no hope of success for complicated ones). As far as I can see from a super quick glance,tkz-euclide seems to mostly add commands to be used in TikZ pictures. TikZ itself is not directly supported by plasTeX which uses your local TeX installation to render the picture. So you can simply tell plasTeX that tkz-euclide depends on TikZ and hope for the best. The documentation explains various ways to do this depending on how global you want this to become. For a simple test you can create a file tkz-euclide.py containing

from plasTeX.Packages.tikz import *

put it next to your source file test.tex and run plastex --packages-dirs=. test.tex.

Patrick Massot (Dec 29 2025 at 10:23):

I just tried this on test.tex containaing

\documentclass{article}
\usepackage{tkz-euclide}
\colorlet{input}{red!80!black}
\colorlet{output}{red!70!black}
\colorlet{triangle}{green!50!black!40}
\begin{document}
\begin{tikzpicture}[scale=1.25,thick,help lines/.style={thin,draw=black!50}]
\tkzDefPoint(0,0){A}
\tkzDefPoint(1.25+rand(),0.25+rand()){B}
\tkzInterCC(A,B)(B,A) \tkzGetPoints{C}{X}
\tkzFillPolygon[triangle,opacity=.5](A,B,C)
\tkzDrawSegment[input](A,B)
\tkzDrawSegments[red](A,C B,C)
\tkzDrawCircles[help lines](A,B B,A)
\tkzDrawPoints[fill=gray,opacity=.5](A,B,C)
\tkzLabelPoints(A,B)
\tkzLabelCircle[below=12pt](A,B)(180){$\mathcal{D}$}
\tkzLabelCircle[above=12pt](B,A)(180){$\mathcal{E}$}
\tkzLabelPoint[above,red](C){$C$}
\end{tikzpicture}
\end{document}

from the documentation of tkz-euclide

Patrick Massot (Dec 29 2025 at 10:23):

In a leanblueprint context, you probably have a config file for plastex, so you can put the packages-dirs option there.

Patrick Massot (Dec 29 2025 at 10:25):

It goes in the general section of the config file, see https://plastex.github.io/plastex/plastex/sec-general-options.html


Last updated: Feb 28 2026 at 14:05 UTC