[pstricks] bug pstricks x positions of nodes set before and after fnode, not center of fnode

jean-pierre moreau jpmoreau at gmail.com
Mon Nov 3 06:12:45 CET 2008


See below latex source for this intricate bug. I think it is a bug, but I am
somewhat confused, I find it difficult to explain. I include below latex file
to explain it, by trying to confine this (supposed) bug of pstricks node.

The pdf output is same as the ps output (as seen by gv, of
ghostscript, which I think
does the ps2pdf too). It is from:
    $ latex bug-pstricks-node-positions.tex
    $ dvips -o bug-pstricks-node-positions.ps bug-pstricks-node-positions.dvi
    $ ps2pdf bug-pstricks-node-positions.ps bug-pstricks-node-positions.pdf
on my GNU/Linux Slackware-12.1 system, with an old pstricks and a much
recent one
(as said in the following).

%%%%%%%%%%%%%% Begin bug-pstricks-node-positions.tex latex file
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[fleqn,12pt]{article}
\usepackage[latin1]{inputenc}   % ISO-Latin1 encoding for input characters
\usepackage[francais]{babel}    % Babel LaTeX, français
  % same as \usepackage[canadien]{babel},  Babel LaTeX, français canadien
\usepackage{amsmath} % AMS-LaTeX for \text{...} in math mode, better
than LaTeX \mbox{...}.
  % Example: $A_{\text{indice}}$ met 'indice' en scriptsize!
  % AMS-LaTeX also for \tfrac, \dfrac; for ...
\usepackage{fancyhdr} % fancy headers, footers: \lhead, \lfoot,
\chead, \cfoot, \rhead, \rfoot, ...
\usepackage{pstricks,pst-node} % for ...node... commands, etc.

\setlength{\parindent}{0pt}
\setlength{\parskip}{1.5ex}
\pagestyle{fancy}
  \fancyhead{}\fancyfoot{}
  \renewcommand{\footrulewidth}{0.4pt}
  \rfoot{\thepage}
  %
  \lfoot{\small jpm 2008-11-03 bug-pstricks-node-positions}

% Derived from my mat-2101/tech-eqn-1-inconnue.tex


\begin{document}

Bug in pstricks node? In relation with $x$ position of \verb!\fnode*!
and \verb!\psframe*!.

Bug seen with:
\begin{itemize}
  \item latest pstricks-2008-10-19, pstricks-add-3.11,...,
xkeyval-2.6, in TeTeX-3.0;
  \item much older pstricks, pstricks-add, etc... of original TeTex-3.0.
\end{itemize}

\vspace*{\parskip}

A node set just before a \verb!\fnode*! is not at horizontal center of
this \verb!\fnode*!,
but another node set after this \verb!\fnode*! it is at horizontal
center of this \verb!\fnode*!.
I think the two nodes should be at horizontal center of this
\verb!\fnode*!, from what I
understand of pstricks nodes.

And this is an intricate bug? A node set at Right of the = below, if
before a \verb!\fnode*!,
is at same $x$ (horizontal position) than if there is \emph{no}
following \verb!\fnode*!,
and at same $x$ than if \verb!\psframe*! follows this node.

\newlength{\hOfOval}
\settoheight{\hOfOval}{$\ovalnode{anyname}{\dfrac{1}{2}}$}
%
This shows that, at Right of =, testR1 node set just before
\verb!\fnode*! is NOT in center of this
\verb!\fnode*!, but that testR2 node set just after this \verb!\fnode*! is:
{
  \[ % y of many nodes = .5ex to be at approx *center* of eqns
     z
        \quad
        \pnode{testL1}
        \fnode*[linecolor=lightgray,framesize=6pt \hOfOval](0,.5ex){eqL}
        \pnode(0,2ex){testL2}
        \quad
     =
        \quad
        \pnode{testR1}
           % PROBLEM (pstricks bug?) : testR1 node is NOT at x =
center of next \fnode*,
           % However a node is correct (at x = center of next \fnode*)
if node is defined
           % AFTER this \fnode*: testR2 node below is OK:
        \fnode*[linecolor=lightgray,framesize=1pt 4\hOfOval](0,.5ex){eqR}
        \pnode(0,2ex){testR2}
        \quad
     z
  \]
  \ncline{testL1}{testR1}
  \ncline{testL2}{testR2}
}
\verb!\fnode*! at Left of =, NO \verb!\fnode*! at right of =,
{
  \[ % y of many nodes = .5ex to be at *center* of eqns
     z
        \quad
        \pnode{testL1}
        \fnode*[linecolor=lightgray,framesize=6pt \hOfOval](0,.5ex){eqL}
        \pnode(0,2ex){testL2}
        \quad
     =
        \quad
        \pnode{testR1}
        % \fnode*[linecolor=lightgray,framesize=1pt \hOfOval](0,.5ex){eqR}
        \pnode(0,2ex){testR2}
        \quad
     z
  \]
  \ncline{testL1}{testR1}
  \ncline{testL2}{testR2}
}
\verb!\fnode*! at Left of =, \verb!\psframe*! instead of
\verb!\fnode*! at right of =;
we see that Right \verb!\psframe*! not same location as above Right
\verb!\fnode*! :
{
  \[ % y of many nodes = .5ex to be at *center* of eqns
     z
        \quad
        \pnode{testL1}
        \fnode*[linecolor=lightgray,framesize=6pt \hOfOval](0,.5ex){eqL}
        \pnode(0,2ex){testL2}
        \quad
     =
        \quad
        \pnode{testR1}
        % testR1 node incorrect, NOT at center of \fnode*, however
testL1 is correct
        % \fnode*[linecolor=lightgray,framesize=1pt \hOfOval](0,.5ex){eqR}
        \psframe*[linecolor=lightgray](-1pt,-\hOfOval)(1pt,1\hOfOval)
        \pnode(0,2ex){testR2}
        \quad
     z
  \]
  \ncline{testL1}{testR1}
  \ncline{testL2}{testR2}
}
Only $x=x$ with less quads, then with some Left and Right tests nodes,
same problem seen as above:
\psset{linecolor=lightgray,framesize=4pt \hOfOval}
  {
    \[ z \quad\fnode*{eqL} = \fnode*{eqR}\quad z \]
  }
  { \[ z \quad
         \pnode{testL1}
           \fnode*{eqL}
         \pnode(0,2ex){testL2}
       =
         \pnode{testR1}
           \fnode*{eqR}
         \pnode(0,2ex){testR2}
         \quad
       z
         \text{\quad Left fnode*, Right fnode*} \]
     \ncline[linecolor=black]{testL1}{testR1}
     \ncline[linecolor=black]{testL2}{testR2}
  }
  { \[ z \quad
         \pnode{testL1}
           \fnode*{eqL}
         \pnode(0,2ex){testL2}
       =
         \pnode{testR1}
           \psframe*(-2pt,-\hOfOval)(2pt,\hOfOval)
         \pnode(0,2ex){testR2}
         \quad
       z
         \text{\quad Left fnode*, Right psframe*} \]
     \ncline[linecolor=black]{testL1}{testR1}
     \ncline[linecolor=black]{testL2}{testR2}
  }

\end{document}

%%%%%%%%%%%%%% End bug-pstricks-node-positions.tex latex file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


More information about the PSTricks mailing list