0

First of all

I'm very sorry for not making the example absolutely minimal.

Code

test.tex:

% lualatex test.tex


%%%%%%%%%%%%%%%%%%%%%%%%
%%                    %%
%%   Dokumentklasse   %%
%%                    %%
%%%%%%%%%%%%%%%%%%%%%%%%


\documentclass[
  a4paper,
  12pt,
  danish
]{article}


%%%%%%%%%%%%%%%%
%%            %%
%%   Pakker   %%
%%            %%
%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LaTeX --> DVIPS --> PS2PDF %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Tillader `æ', `ø' og `å' (i inputfilen).
%\usepackage{inputenc}

% Hjælper med orddeling og lignende ved `æ', `ø' og `å'.
%\usepackage[T1]{fontenc}

% Sørger for dansk orddeling og dansk opsætning af `specielle' ord.
%\usepackage{babel}

% Sætter skrifttypen.
%\usepackage[sc]{mathpazo}

%%%%%%%%%%%%%%
%% LuaLaTeX %%
%%%%%%%%%%%%%%

% Opsætning af skrift til LuaLaTeX.
\usepackage{fontspec}
\setmainfont[
  Extension      = .otf,
  UprightFont    = *-regular,
  BoldFont       = *-bold,
  ItalicFont     = *-italic,
  BoldItalicFont = *-bolditalic,
  Ligatures = {
    TeX,
    CommonOff
  }
]{NewCM10}

% Matematik.
\usepackage[
  math-style = TeX,
  warnings-off = {
    mathtools-colon
  }
]{unicode-math}
\setmathfont{NewCMMath-Regular.otf}
\setmathfont[
  version = bold,
  FakeBold = 2
]{NewCMMath-Regular.otf}

% Sørger for dansk orddeling og dansk opsætning af `specielle' ord.
\usepackage{polyglossia}
\setdefaultlanguage{danish}

%%%%%%%%%%%%%%%%%%%%%

% Marginer.
\usepackage[
  hmargin = 2.4cm,
  vmargin = 3cm
]{geometry}

% Sidehoved og -fod.
\usepackage{fancyhdr}

% Sidetal.
\usepackage[
  lastpage
]{zref}

% Placering af floats.
\usepackage{float}

% Fysiske enheder.
\usepackage{siunitx}

% Intern vektorgrafik.
\usepackage{pstricks-add}

% Interaktive krydsreferencer med mere.
\usepackage{hyperref}


%%%%%%%%%%%%%%%%%
%%             %%
%%   Makroer   %%
%%             %%
%%%%%%%%%%%%%%%%%


% Opsætning af pakker.
% ``siunitx''
\sisetup{
  locale = DE
}
% ``pstricks''
\psset{
  dimen = m
}
% ``hyperref''
\hypersetup{
  pdftitle = {FSA, matematisk problemløsning, maj~2000},
  pdfauthor = {Svend Mortensen},
  pdfsubject = {Eksamenssæt, matematik},
  pdfstartview = FitH,
  breaklinks = true,
  hidelinks
}

% Placering af floats.
\makeatletter
  \providecommand*\setfloatlocations[2]{\@namedef{fps@#1}{#2}}
\makeatother
\setfloatlocations{figure}{H}

% Letter notationen.
\newcommand*\fil[1]{\texttt{#1}}

% Opgave 3.2
\newcommand*\breddeA{\fpeval{\ydreA+0.62}}
\newcommand*\hoejdeA{\fpeval{sqrt(3)/2*\ydreA+0.59}}

% Opgave 3.4
\newcommand*\indreB{\fpeval{0.5*\ydreB}}
\newcommand*\lille{\fpeval{0.1*\ydreB}}
\newcommand*\breddeB{\fpeval{\ydreB+0.64}}
\newcommand*\hoejdeB{\fpeval{sqrt(3)/2*\ydreB+0.54}}

% Sidehoved- og fod.
\pagestyle{fancy}
\renewcommand*\headrulewidth{0pt}
\setlength\headheight{14.5pt}
\makeatletter
\zref@newprop*{numpage}{\the\value{page}}
\zref@addprop{main}{numpage}
\fancyhf{}
\fancyfoot[C]{
  \ifnum \zref@extractdefault{LastPage}{numpage}{0} > 1
    \thepage
  \fi
    %
}
\makeatother


%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                      %%
%%   Selve dokumentet   %%
%%                      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}

\section{Cirkustelt}
\label{opg:3}
På svararket er vist en grundplan over manegen.

Til manegen vil Springboldene have et nyt tæppe, som
\begin{enumerate}
  \item skal være cirkelformet,
  \item skal være så stort som muligt og
  \item netop skal røre de $3$~teltpæle.
\end{enumerate}

\subsection{Første spørgsmål}
\label{spm:31}
Kald hjørnerne i manegen, der er en regulær sekskant, for $P_{1},P_{2},\dots,P_{6}$
og tegn dernæst (stiplede) linjestykker fra $P_{1}$ til $P_{4}$, fra $P_{2}$ til
$P_{5}$ og fra $P_{3}$ til $P_{6}$.

Linjestykkernes skæringspunkt er der hvor tæppets centrum skal ligge.

\subsection{Andet spørgsmål}
\label{spm:32}
Følgende figur viser en grundplan over manegen:

\begin{figure}
\def\indreA{3.5}
\def\ydreA{6}
\centering
 \psset{
   unit = 0.9
 }
  \begin{pspicture}(-\breddeA,-\hoejdeA)(\breddeA,\hoejdeA)
    \multido
      {\i = 1+1,
       \rA = 0+60,
       \rB = 6.5+60}
      {6}
      {\psRelNode[angle = \rA](A)(\ydreA,0){1}{P\i}
       \psdot(P\i)
       \uput[\rA](P\i){$P_{\i}$}
       \psRelNode[angle = \rA](A)(\indreA,0){1}{Q\i}
       \psdot(Q\i)
       \psRelNode[angle = \rB](A)(\indreA,0){1}{Q\i}
       \uput[\rB](Q\i){$Q_{\i}$}}
    \pnode
      (0,0){A}
    \pscircle(A){\indreA}
    \pspolygon(P1)(P2)(P3)(P4)(P5)(P6)
    \pcline[
      linestyle = none,
      offset = 12pt
    ](P2)(P1)
    \ncput*[
      nrot = :U
    ]{\qty{9}{\m}}
    \multido
      {\iA = 1+1,
       \iB = 4+1,
       \r = 90+120}
      {3}
      {\psline[
         linestyle = dashed
       ](P\iA)(P\iB)
       \psRelNode[
         angle = \r
       ](A)(\indreA,0){1}{Q\iA}
       \psdot[
         dotstyle = Bo
       ](Q\iA)
       \uput[\r](Q\iA){\scriptsize Teltpæl~$\iA$}}
  \end{pspicture}
 \caption{Grundplan over manegen.}
 \label{fig:1}
\end{figure}
\vspace{0ex}

\noindent
\textsf{Bemærkning:} Figuren er ikke i målestoksforholdet~$1\mathinner{:}150$, men
dens mål passer i forhold til hinanden. Det er dog også umuligt at opnå det korrekte
målestoksforhold, da det afhænger af skærmen, dokumentet læses på.

\subsection{Tredje spørgsmål}
\label{spm:33}
På \autoref{fig:1} aflæser vi, at $r \approx \qty{3.5}{\cm}$. Eftersom \autoref{fig:1}
er i målestoksforholdet~$1\mathinner{:}150$, er tæppets radius derfor
\begin{equation}
  r_{\text{tæppe}}
  \approx 150 \cdot \qty{3.5}{\cm}
  = \qty{525}{\cm}
  = \qty{525}{\cm} \cdot \frac{1}{100}\,\unit{\m\per\cm}
  = \frac{525 \cdot 1}{100}\,\unit{\m}
  = \qty{5.25}{\m}.
\end{equation}

\subsection{Fjerde spørgsmål}
\label{spm:34}
\autoref{fig:2} viser et manegetæppe med netop tre symmetriakser (de stiplede
linjestykker):

\begin{figure}
\def\ydreB{3.5}
\centering
  \begin{pspicture}(-\breddeB,-\hoejdeB)(\breddeB,\hoejdeB)
    \multido
      {\i = 1+1,
       \r = 0+60}
      {6}
      {\psRelNode[
         angle = \r
       ](A)(\ydreB,0){1}{Q\i}
       \psdot(Q\i)
       \uput[\r](Q\i){$Q_{\i}$}
       \psRelLine[
         angle = \r,
         linestyle = dotted
       ](0,0)(\ydreB,0){1}{B}}
    \pspolygon(Q1)(Q2)(Q3)(Q4)(Q5)(Q6)
    \multido
      {\i = 1+1,
       \r = 60+120}
      {3}
      {\psRelNode[
         angle = \r
       ](A)(\indreB,0){1}{Q\i}
       \pscircle[
         fillstyle = solid,
         fillcolor = red
       ](Q\i){\lille}}
    \pnode(0,0){A}
    \pscircle(A){\ydreB}
  \end{pspicture}
 \caption{Manegetæppe med netop tre symmetriakser.}
 \label{fig:2}
\end{figure}

\end{document}

Problem

When I compile using latex --> dvips --> dvips -dALLOWPSTRANSPARENCY, I get the following correct output:

correct

However, when I compile using lualatex, I get the following wrong output:

wrong

How can I compile using lualatex and get the correct output?

6
  • 1
    Is your system up-to-date? Commented Nov 10, 2022 at 18:49
  • @MarcelKrüger I updated my TL22 yesterday. Commented Nov 10, 2022 at 18:52
  • 1
    it looks ok for me, show your log-file. Commented Nov 10, 2022 at 18:55
  • 1
    @UlrikeFischer The above code compiles fine for me as well, it seems ... I tried to cut a large document into a MWE but obviusly I missed something. I'll investigate and then return. Sorry for the inconvenience. Commented Nov 10, 2022 at 19:05
  • @MarcelKrüger I've tried to make the code example as small as I can without loosing any of the effects regarding the problem. (I might have failed, but I've tried. :-)) Commented Nov 11, 2022 at 14:29

2 Answers 2

2

All that header/footer stuff is completely not needed for a minimal example!

Define the node to which you refer with \psRelNode before you use it:

\begin{pspicture}(-\breddeB,-\hoejdeB)(\breddeB,\hoejdeB)
    \pnode(0,0){A}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \multido
    {\i = 1+1,
        \r = 0+60}
    {6}
    {\psRelNode[
        angle = \r
        ](A)(\ydreB,0){1}{Q\i}
        \psdot(Q\i)
        \uput[\r](Q\i){$Q_{\i}$}
        \psRelLine[
        angle = \r,
        linestyle = dotted
        ](0,0)(\ydreB,0){1}{B}}
    \pspolygon(Q1)(Q2)(Q3)(Q4)(Q5)(Q6)

enter image description here

1
  • Thank you very much, user187802! Commented Nov 12, 2022 at 7:00
2

You are using the node A in both pictures and it seems to leak out. It doesn't happen only for lualatex but also on the dvips route. Compare here the outcome if both nodes are called the same (right page, D) and differently (left page, A + B). I'm not a PSTricks user and don't know if that is expected behaviour or a bug.

\documentclass[]{article}
\usepackage{pstricks-add}


\begin{document}

  \begin{pspicture}(0,0)(3,3)
    \pnode
      (0,0){B}
  \end{pspicture}


 \begin{pspicture}(0,0)(5,5)
    \multido
      {\i = 1+1,
       \r = 0+60}
      {6}
      {\psRelNode[
         angle = \r
       ](A)(3.5,0){1}{Q\i}
       \psdot(Q\i)
       \uput[\r](Q\i){$Q_{\i}$}
      }
    \pspolygon(Q1)(Q2)(Q3)(Q4)(Q5)(Q6)
  \end{pspicture}
 
 \newpage 
 
  \begin{pspicture}(0,0)(3,3)
    \pnode
      (0,0){D}
  \end{pspicture}


 \begin{pspicture}(0,0)(5,5)
    \multido
      {\i = 1+1,
       \r = 0+60}
      {6}
      {\psRelNode[
         angle = \r
       ](D)(3.5,0){1}{Q\i}
       \psdot(Q\i)
       \uput[\r](Q\i){$Q_{\i}$}
      }
    \pspolygon(Q1)(Q2)(Q3)(Q4)(Q5)(Q6)
  \end{pspicture}
 
\end{document}

enter image description here

2
  • it is the expected behaviour for this (senseless) example.
    – user187802
    Commented Nov 12, 2022 at 7:00
  • Thank you very much, Ulrike! Commented Nov 12, 2022 at 7:00

You must log in to answer this question.

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