1

Here is the following code:

\documentclass[multi,pstricks]{standalone}
\usepackage{pstricks-add,amsmath}
\begin{document}
\begin{pspicture}(2,2)
\Cnodeput[radius=.7](1,1){a}{$\dfrac{a_b}{a}$}
\psdot(1,1)
\end{pspicture}
\end{document}

The circle is offcentered when using Cnodeput, but it is correctly centered when using cnodeput. How can this be fixed without using magic numbers?

Edit: with the new pst-node.tex.

\documentclass[multi,pstricks]{standalone}
\usepackage{pstricks-add,amsmath}
\begin{document}
\begin{pspicture}(2,2)
\pnode(1,1){cat}
\cnodeput(cat){cat}{$\dfrac{a_b}{a}$} %works
\Cnodeput[radius=.7](cat){meow}{$\dfrac{a_b}{a}$} %works
\Cnodeput[radius=.7](cat){cat}{$\dfrac{a_b}{a}$} %does not work
\psdot(1,1)
\end{pspicture}
\end{document}
0

I found the problem: A fixed file pstricks.tex is here: http://comedy.dante.de/~herbert/texnik/tex/generic/pstricks/ You need also the old pst-node.tex http://comedy.dante.de/~herbert/texnik/tex/generic/pstnode/

Will also be on CTAN in the next days.

\documentclass[multi,pstricks]{standalone}
\usepackage{pstricks-add,amsmath}

\begin{document}
    \begin{pspicture}[showgrid](2,2)
    \pnodes(1,1){cat}
    \cnodeput(cat){cat}{$\dfrac{a_b}{a}$}
    \Cnodeput[radius=.7](cat){cat}{$\dfrac{a_b}{a}$} 
    \Cnodeput[radius=.9](cat){cat}{$\dfrac{a_b}{a}$}
    \end{pspicture}
\end{document}

enter image description here

  • Please see new edit. There looks to be another bug. – cat May 26 '16 at 19:37
  • No, that is the default behaviour. You used a node name cat for the coordinates and also define a new node with the same name. Use something like \Cnodeput[radius=.9](cat){cat2}{$\dfrac{a_b}{a}$} – user2478 May 26 '16 at 19:48
  • O I see. Why does (cat){cat} work for \cnodeput? – cat May 26 '16 at 20:05
  • it works different. However, I'll put it on the todo-list – user2478 May 26 '16 at 20:16
  • See my edited answer. The problem was in pstricks.tex and not in pst-node.tex – user2478 May 28 '16 at 7:50
0

I defined a \myCnodeput command, which accepte an optional argument. I added auto-pst-pdf which allows compiling with pdflatex, provided you use the --enable-write18 switch (for MiKTeX) ot -shell-escape (TeX Live, MacTeX):

\documentclass{standalone}%
\usepackage{pstricks-add,amsmath}
\usepackage{auto-pst-pdf}
\usepackage{xparse}
\NewDocumentCommand\myCnodeput{or()mm}{%
\rput(#2){#4}\Cnodeput[#1](#2){#3}%
}%
\begin{document}

\begin{pspicture}(2,2)
\myCnodeput[radius=0.7, linecolor=red](1,1){b}{$\dfrac{a_b}{a}$}
\psdot(1,1)
\end{pspicture}

\end{document} 

enter image description here

  • I need Cnodeput though to get a specific radius. – cat May 26 '16 at 18:34
  • Ah! That's different. I'll try to think of a solution. – Bernard May 26 '16 at 18:36
  • @cat: Please see my updated answer. – Bernard May 26 '16 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.