zauguin / luapstricks

8 stars 0 forks source link

pst-geometrictools does not compile with LuaLaTeX #76

Closed pstricks-fans closed 2 years ago

pstricks-fans commented 2 years ago

I found the following code does not compile with LuaLaTeX.

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass[beamer,preview,pstricks,border=12pt]{standalone}
\usepackage{pst-geometrictools}

\begin{document}
\begin{standaloneframe}
\begin{pspicture}[showgrid](-5,-5)(5,5)
    \psProtractor{0}(0,0)
\end{pspicture}
\end{standaloneframe}
\end{document}

The error message:

This is LuaHBTeX, Version 1.13.2 (TeX Live 2021/W32TeX) 
 restricted system commands enabled.
(./test.tex
LaTeX2e <2021-06-01> patch level 1
 L3 programming layer <2021-08-27>
(c:/texlive/2021/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-tes
tphase.sty
(c:/texlive/2021/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-tes
tphase.ltx
(c:/texlive/2021/texmf-dist/tex/latex/l3experimental/l3bitset/l3bitset.sty)))
(c:/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-luatex.def))
(c:/texlive/2021/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testpha
se-luatex.def
(c:/texlive/2021/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty))
(c:/texlive/2021/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-fir
staid.sty
(c:/texlive/2021/texmf-dist/tex/latex/pdfmanagement-testphase/output-patches-tm
p-ltx.sty (c:/texlive/2021/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
Patching header in \@outputpage
Patching footer in \@outputpage
Patching \@makecol for tagging
Patching \@makecol for tagging
)) (c:/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(c:/texlive/2021/texmf-dist/tex/latex/base/size10.clo))
(c:/texlive/2021/texmf-dist/tex/latex/pst-eucl/pst-eucl.sty
(c:/texlive/2021/texmf-dist/tex/latex/pstricks/pstricks.sty
(c:/texlive/2021/texmf-dist/tex/generic/iftex/iftex.sty)
(c:/texlive/2021/texmf-dist/tex/latex/xcolor/xcolor.sty
(c:/texlive/2021/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(c:/texlive/2021/texmf-dist/tex/latex/graphics-def/luatex.def))
(c:/texlive/2021/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tm
p-ltx.sty) (c:/texlive/2021/texmf-dist/tex/generic/xkeyval/pst-xkey.tex
(c:/texlive/2021/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(c:/texlive/2021/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(c:/texlive/2021/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(c:/texlive/2021/texmf-dist/tex/generic/xkeyval/keyval.tex)))))
(c:/texlive/2021/texmf-dist/tex/generic/pstricks/pstricks.tex
(c:/texlive/2021/texmf-dist/tex/generic/pstricks/pst-fp.tex
`pst-fp' v0.06, 2020/11/20 (hv))
(c:/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
(c:/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex)
) (c:/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(c:/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex)
) (c:/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
Loading pgffor.code.tex
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.te
x)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric
.code.tex)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.t
ex)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.co
de.tex)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.te
x)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex
)
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithm
etics.code.tex)))
(c:/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)))
`PSTricks' v3.11  <2021/09/27> (tvz,hv)
--- We are running lualatex with luapstricks ---
 (c:/texlive/2021/texmf-dist/tex/generic/pstricks/pstricks-color.tex)
(c:/texlive/2021/texmf-dist/tex/generic/pstricks/pstricks-arrows.tex)
(c:/texlive/2021/texmf-dist/tex/generic/pstricks/pstricks-dots.tex))
(c:/texlive/2021/texmf-dist/tex/generic/pstricks/pst-fp.tex
`pst-fp' v0.06, 2020/11/20 (hv)))
(c:/texlive/2021/texmf-dist/tex/latex/pst-node/pst-node.sty
(c:/texlive/2021/texmf-dist/tex/generic/pst-node/pst-node.tex
 v1.42a, 2020/04/01))
(c:/texlive/2021/texmf-dist/tex/latex/pst-tools/pst-tools.sty
(c:/texlive/2021/texmf-dist/tex/generic/pst-tools/pst-tools.tex
`PST-tools' v0.12, 2021/09/23 (hv)))
(c:/texlive/2021/texmf-dist/tex/latex/pst-calculate/pst-calculate.sty
(c:/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(c:/texlive/2021/texmf-dist/tex/latex/siunitx/siunitx.sty
(c:/texlive/2021/texmf-dist/tex/latex/translations/translations.sty
(c:/texlive/2021/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(c:/texlive/2021/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(c:/texlive/2021/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)))
(c:/texlive/2021/texmf-dist/tex/latex/amsmath/amstext.sty
(c:/texlive/2021/texmf-dist/tex/latex/amsmath/amsgen.sty))
(c:/texlive/2021/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(c:/texlive/2021/texmf-dist/tex/latex/tools/array.sty)))
(c:/texlive/2021/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex
(c:/texlive/2021/texmf-dist/tex/generic/pst-arrow/pst-arrow.tex
`pst-arrow' v0.04, 2021/08/25 (dr,hv))
(c:/texlive/2021/texmf-dist/tex/generic/pst-plot/pst-plot.tex
(c:/texlive/2021/texmf-dist/tex/generic/pst-tools/pst-tools.tex)
(c:/texlive/2021/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
(c:/texlive/2021/texmf-dist/tex/generic/pst-3d/pst-3d.tex
`PST-3d' v1.11, 2010/02/14 (tvz))
(c:/texlive/2021/texmf-dist/tex/generic/multido/multido.tex
 v1.42, 2010/05/14 <tvz>)
(c:/texlive/2021/texmf-dist/tex/generic/pst-math/pst-math.tex
`pst-math' v0.64 , (CJ,hv)) `pstricks-add' v3.91, 2021/09/25 (dr,hv))
(c:/texlive/2021/texmf-dist/tex/generic/multido/multido.tex
 v1.42, 2010/05/14 <tvz>)  v1.93, 2021/09/23 (tvz,hv))
(c:/texlive/2021/texmf-dist/tex/generic/multido/multido.tex
 v1.42, 2010/05/14 <tvz>) `PST-Euclide v1.75, 2020/09/29 (dr,hv)))
(c:/texlive/2021/texmf-dist/tex/latex/pst-geometrictools/pst-geometrictools.sty

(c:/texlive/2021/texmf-dist/tex/generic/pst-geometrictools/pst-geometrictools.t
ex (c:/texlive/2021/texmf-dist/tex/generic/pst-node/pst-node.tex)
`PST' v1.1, 2017/09/16)) (./test.aux)
(c:/texlive/2021/texmf-dist/tex/latex/base/ts1cmr.fd)
(c:/texlive/2021/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)
(c:/texlive/2021/texmf-dist/tex/latex/translations/translations-basic-dictionar
y-english.trsl) [1{c:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map
}...2021/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:3834: ...2021/texm
f-dist/tex/lualatex/luapstricks/luapstricks.lua:736: Unknown name "pdfmark"
stack traceback:
    [C]: in function 'error'
    ...2021/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:3911: in function 
<...2021/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:3891>
    [C]: in function 'vf.node'
    ...2021/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:3884: in function 
<...2021/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:3875>.
<inserted text> BAD

l.12 \end{document}

? 
pstricks-fans commented 2 years ago

For a quick solution (for me), David Carlislie suggested me to do the following:

put a local copy of luapstricks.lua next to the document and add at line 1096

  pdfmark = function()
    local entry
    repeat
      entry = pop()
    until (not entry) or type(entry) == 'table' and entry.kind == 'mark'
    if not entry then error'Unmatched mark' end
  end,
hvoss49 commented 2 years ago

Use this https://github.com/zauguin/luapstricks/tree/trunk/PSTricksFiles/pst-geometrictools. version, but it still needs fixing for \psProtractor. Lua has another coordinate system. I'll fix it as soon as possible ...

pstricks-fans commented 2 years ago

Thank you very much.

hvoss49 commented 2 years ago

Should work with current version of CTAN.