4

As you can see below, the 3/2 looks so weird in which the font size of the numerator is bigger than that of the denominator. How to make it get balanced?

\documentclass[pstricks,border=0pt,12pt]{standalone}
\usepackage{pst-eucl}
\usepackage{etoolbox}
\robustify\sqrt

\begin{document}
\begin{pspicture}(-6,-1)(6,1.25)
    \pstGeonode[
        PointSymbol=|,
        PosAngle=-90,
        PointNameSep=16pt,
        PointName={\frac{3-\sqrt{17}}{2},-\frac{1}{2},\frac{3}{2},2,\frac{3+\sqrt{17}}{2}}
    ](-4,0){A}(-2,0){B}(0,0){C}(2,0){D}(4,0){E}
    \pcline[nodesep=-1](A)(E)
    \pcline(5.8,0)(E)\nbput{$++++$}
    \pcline(E)(D)\nbput{$----$}
    \pcline(D)(C)\nbput{$++++$}
    \pcline(C)(B)\nbput{$----$}
    \pcline(B)(A)\nbput{$++++$}
    \pcline(A)(-5.8,0)\nbput{$----$}
    \psset{arrows=*-*,offset=22pt}
    \pcline(A)(B)
    \pcline(C)(D)
    \pcline{*->}(E)(5.5,0)
\end{pspicture}
\end{document}

enter image description here

3
  • 1
    I find it hard to follow the picture when 1/2 = 2 :)
    – user156344
    Commented May 17, 2019 at 10:22
  • @JouleV: It is not such hard. Commented May 17, 2019 at 10:26
  • I noticed the bigger fractions first.
    – egreg
    Commented May 17, 2019 at 10:50

3 Answers 3

3

For reasons that depend on the same ones that force to \robustify\sqrt, a fraction as the first item is typeset incorrectly. You can \robustify also \frac.

\documentclass[pstricks,border=0pt,12pt]{standalone}
\usepackage{pst-eucl}
\usepackage{etoolbox,amsmath}
\robustify\sqrt
\robustify\frac

\begin{document}
\begin{pspicture}(-6,-1)(6,1.25)
    \pstGeonode[
        PointSymbol=|,
        PosAngle=-90,
        PointNameSep=16pt,
        PointName={\frac{3-\sqrt{17}}{2},-\frac{1}{2},\frac{3}{2},2,\frac{3+\sqrt{17}}{2}}
    ](-4,0){A}(-2,0){B}(0,0){C}(2,0){D}(4,0){E}
    \pcline[nodesep=-1](A)(E)
    \pcline(5.8,0)(E)\nbput{${+}{+}{+}{+}$}
    \pcline(E)(D)\nbput{${-}{-}{-}{-}$}
    \pcline(D)(C)\nbput{${+}{+}{+}{+}$}
    \pcline(C)(B)\nbput{${-}{-}{-}{-}$}
    \pcline(B)(A)\nbput{${+}{+}{+}{+}$}
    \pcline(A)(-5.8,0)\nbput{${-}{-}{-}{-}$}
    \psset{arrows=*-*,offset=22pt}
    \pcline(A)(B)
    \pcline(C)(D)
    \pcline{*->}(E)(5.5,0)
\end{pspicture}
\end{document}

enter image description here

Also bracing each item works, but using a robust \frac is better.

Note: due to + and - being binary operation symbols, a sequence such as ++++ is interpreted as Ord Bin Ord Ord (by rule a binary operation symbol is changed into an ordinary one if it doesn't have suitable operands on either side) and the spacing is odd. Input them as {+}{+}{+}{+} and {-}{-}{-}{-} to get all ordinary symbols.

0
3

It looks like a bug in pst-eucl. As a workaround, you can use \dfrac instead (load amsmath), and slightly increase the value of PointNameSep:

\documentclass[pstricks, border=0pt,12pt]{standalone}
\usepackage{pst-eucl}
\usepackage{amsmath, nccmath}
\usepackage{etoolbox}
\robustify\sqrt

\begin{document}

\begin{pspicture}(-6,-1.25)(6,1.25)
    \pstGeonode[
        PointSymbol=|,
        PosAngle=-90,
        PointNameSep=18 pt,
        PointName={\dfrac{3-\sqrt{17}}{2},-\dfrac{1}{2},\dfrac{3}{2},2, \dfrac{3+\sqrt{17}}{2}}
    ](-4,0){A}(-2,0){B}(0,0){C}(2,0){D}(4,0){E}
    \pcline[nodesep=-1](A)(E)
    \pcline(5.8,0)(E)\nbput{$++++$}
    \pcline(E)(D)\nbput{$----$}
    \pcline(D)(C)\nbput{$++++$}
    \pcline(C)(B)\nbput{$----$}
    \pcline(B)(A)\nbput{$++++$}
    \pcline(A)(-5.8,0)\nbput{$----$}
    \psset{arrows=*-*,offset=22pt}
    \pcline(A)(B)
    \pcline(C)(D)
    \pcline{*->}(E)(5.5,0)
\end{pspicture}

\end{document} 

enter image description here

1
  • That is not a bug, it is a wrong use of PointName!
    – user187802
    Commented May 17, 2019 at 13:50
2

It is completely nonsense to use the PointName key for such labels because the label is internally also the node name. You should use simple nodes and \psxTick instead. However,

PointName={{\frac{3-\sqrt{17}}{2}},{-\frac{1}{2}},{\frac{3}{2}},{\scriptstyle2},{\frac{3+\sqrt{17}}{2}}}

should also do the trick

enter image description here

\documentclass[pstricks,border=0pt,12pt]{standalone}
\usepackage{pstricks-add}

\begin{document}
\begin{pspicture}(-6,-1)(6,1.25)
    \pnodes(-4,0){A}(-2,0){B}(0,0){C}(2,0){D}(4,0){E}
    \psxTick(-4){\frac{3-\sqrt{17}}{2}}
    \psxTick(-2){-\frac{1}{2}}
    \psxTick(0){\frac{3}{2}}
    \psxTick(2){\scriptstyle2\vphantom{\frac12}}
    \psxTick(4){\frac{3+\sqrt{17}}{2}}
    \multido{\rA=-4.9+4.0}{3}{\uput[90](\rA,0){$----$}}%
    \multido{\rA=-3+4}{3}{\uput[90](\rA,0){$++++$}}%
    \pcline[nodesep=-1.75](A)(E)
    \psset{arrows=*-*,offset=22pt}
    \pcline(A)(B)
    \pcline(C)(D)
    \pcline{*->}(E)(5.5,0)
\end{pspicture}
\end{document}

enter image description here

Or if you do not like hardcoded values:

\documentclass[pstricks,border=0pt,12pt]{standalone}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-6,-1)(6,1.25)
    \pnodes(-4,0){A}(-2,0){B}(0,0){C}(2,0){D}(4,0){E}
    \psxTick(-4){\frac{3-\sqrt{17}}{2}}
    \psxTick(-2){-\frac{1}{2}}
    \psxTick(0){\frac{3}{2}}
    \psxTick(2){\scriptstyle2\vphantom{\frac12}}
    \psxTick(4){\frac{3+\sqrt{17}}{2}}
    \pcline[nodesep=-1.75](A)(E)
    \psset{arrows=*-*,offset=20pt}
    \pcline(A)(B)\nbput{$++++$}
    \pcline(C)(D)\nbput{$++++$}
    \pcline{*->}(E)(5.5,0)\nbput{$++++$}
    \psset{linestyle=none,arrows=-}
    \pcline(-5.8,0)(A)\nbput{$----$}
    \pcline(B)(C)\nbput{$----$}
    \pcline(D)(E)\nbput{$----$}
\end{pspicture}
\end{document}

You must log in to answer this question.

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