5

Consider the following non-MWE:

\documentclass[
  a4paper,
  12pt
]{article}

\usepackage[
  hmargin = 2cm,
  vmargin = 3cm
]{geometry}
\usepackage{pst-eucl}
\usepackage{animate}
\usepackage{siunitx}
\usepackage{xfp}

\def\length{16}
\def\startAngle{15}

\newcommand*\northB{\fpeval{90-\north}}
\newcommand*\lengthB{\fpeval{\length*sind(\northB)}}
\newcommand*\lengthC{\fpeval{\length*sind(\north)}}
\newcommand*\coorx{\fpeval{\lengthB*sind(\northB)}}
\newcommand*\coory{\fpeval{\lengthC*cosd(\north)}}
\newcommand*\numberOfFrames{\fpeval{91-2*\startAngle}}

\def\maxx{0}
\def\maxy{0}
\multido
  {\i = \startAngle+1}
  {\numberOfFrames}
  {\def\north{\i}
   \def\maxxA{\fpeval{\length+0.25}}
   \def\maxxB{\fpeval{1/4*\length*(sind(2*\north)+cosd(2*\north)+3)-0.35}}
   \xdef\maxx{\fpeval{max(\maxx,\maxxA,\maxxB)}}
   \def\maxyA{\fpeval{1/2*\lengthC*(sind(\north)+cosd(\north))}}
   \def\maxyB{\fpeval{\coory+0.6}}
   \xdef\maxy{\fpeval{max(\maxy,\maxyA,\maxyB)}}
  }

\newcommand*\sundial[1]{
 \def\north{#1}
 \psset{
   unit = 0.9
 }
 \sisetup{
   round-mode = places,
   round-precision = 1
 }
  \begin{pspicture}(-0.5,-0.15)(\maxx,\maxy)
    \pnodes
      (0,0){P0}
      (\coorx,\coory){P1}
      (\length,0){P2}
    \pspolygon(P0)(P1)(P2) 
    \pstMarkAngle{P2}{P0}{P1}{\ang{\north}}
    \pstRightAngle[
      RightAngleSize = 0.3
    ]{P0}{P1}{P2}
    \pstMarkAngle{P1}{P2}{P0}{\ang{\northB}}
    \uput[180](P0){$A$}
    \uput[90](P1){$C$}
    \uput[0](P2){$B$} 
    \pstMediatorAB[
      PointSymbol = none,
      PointNameA = none,
      PointNameB = none,
      CodeFig = true,
      CodeFigColor = black,
      RightAngleSize = 0.3
    ]{P1}{P2}{M}{MN}
   \psset{
     linestyle = none,
     offset = -9pt,
     nrot = :U
   }
    \pcline(P0)(P1)
    \ncput*{\qty{\lengthB}{\cm}}
    \pcline(P1)(P2)
    \ncput*{\qty{\lengthC}{\cm}}
    \pcline[
      offset = 9pt
    ](P0)(P2)
    \ncput*{\qty{\length}{\cm}}
  \end{pspicture}
}

\begin{document}

\begin{figure}[htbp]
\centering
  \begin{animateinline}[
    poster = first,
    controls,
    palindrome
  ]{2}
    \multiframe
      {\numberOfFrames}
      {i = \startAngle+1}
      {\sundial{\i}}
  \end{animateinline}
\end{figure}

\end{document}

If I compile using latex <file>.tex --> dvips <file>.dvi --> ps2pdf -dALLOWPSTRANSPARENCY <file>.ps everything works as expected. However, if I compile using lualatex <file>.tex, I get the error:

lua:4048: ...2022/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:794: Unkn
own name "tx@Dict"
stack traceback:
    [C]: in function 'error'
    ...2022/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:4178: in function 
<...2022/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:4153>
    [C]: in function 'vf.node'
    ...2022/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:4146: in function 
<...2022/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua:4137>.
<recently read> \@anim@box 
           
l.98       {\sundial{\i}}

How do I fix this?

3

1 Answer 1

4

Here is a workaound, before it will be fixed:

  \begin{animateinline}[
    poster = first,
    controls,
    palindrome
  ]{2}
    \multiframe
      {\numberOfFrames}
      {i = \startAngle+1}
      {\pstheader{pstricks.pro}%
       \pstheader{pst-node.pro}%
       \pstheader{pst-eucl.pro}%
      \sundial{\i}}
  \end{animateinline}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .