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
WARNING: No Python version of tkz-euclide.sty was found
WARNING: Will now try to load a LaTeX implementation of tkz-euclide.sty
( /usr/local/texlive/2021/texmf-dist/tex/latex/tkz-euclide/tkz-euclide.sty
.
INFO: 2022/02/25 4.051b tkz-euclide.sty
.
WARNING: unrecognized command/environment: @ifpackageloaded
(loading package /home/wwylele/.local/lib/python3.12/site-
packages/plasTeX/Packages/tikz.py
)
WARNING: No Python version of xfp.sty was found
WARNING: Will now try to load a LaTeX implementation of xfp.sty
( /usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xfp/xfp.sty
WARNING: No Python version of expl3.sty was found
WARNING: Will now try to load a LaTeX implementation of expl3.sty
( /usr/local/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
WARNING: unrecognized command/environment: protected
WARNING: unrecognized command/environment: string
ERROR: Error while expanding "expandafter" in
/usr/local/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty on line 53
(sequence item 3: expected str instance, string found)
WARNING: Error opening package "expl3.sty" ( sequence item 3: expected str
instance, string found )
)
ERROR: Loading package "xfp" raised exception ValueError : I/O operation on
closed file.
ERROR: Loading package "tkz-euclide" raised exception ValueError : I/O
operation on closed file.
ERROR: An error occurred while building the document object in
/usr/local/texlive/2021/texmf-dist/tex/latex/tkz-euclide/tkz-euclide.sty on
line 54 (I/O operation on closed file.)
Traceback (most recent call last):
File "/home/wwylele/.local/bin/plastex", line 8, in <module>
sys.exit(plastex())
^^^^^^^^^
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/client.py", line 72, in plastex
main(sys.argv[1:])
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/client.py", line 52, in main
run(filename, config)
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/Compile.py", line 90, in run
tex = parse(filename, config)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/Compile.py", line 85, in parse
tex.parse()
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/TeX.py", line 416, in parse
item.digest(tokens)
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/__init__.py", line 913, in digest
for item in tokens:
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/TeX.py", line 44, in __next__
return self._next()
^^^^^^^^^^^^
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/TeX.py", line 299, in __iter__
token = next()
^^^^^^
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/TeX.py", line 267, in itertokens
t = next(inputs[-1][-1])
^^^^^^^^^^^^^^^^^^^^
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/Tokenizer.py", line 372, in __iter__
(code, char) = next(charIter)
^^^^^^^^^^^^^^
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/Tokenizer.py", line 264, in iterchars
token = _read1()
^^^^^^^^
File "/home/wwylele/.local/lib/python3.12/site-packages/plasTeX/Tokenizer.py", line 261, in _read1
return read(1)
^^^^^^^
ValueError: I/O operation on closed file.
Command 'plastex -c plastex.cfg web.tex' returned non-zero exit status 1.
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
fromplasTeX.Packages.tikzimport*
put it next to your source file test.tex and run plastex --packages-dirs=. test.tex.