1

As can be seen from the image, there are 2 labels (a,b) that have misaligned baselines. I know that the problem arises because the height of the content in both uputs is different (b is taller than a). So the question is how can I simulate a box with the height of a b but the contents of an a

x axis labels are misaligned

There is a trivial answer using rput or tinkering with labelsep but I'm interested in a solution with uput's content

MWE

\documentclass{minimal}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}(-2,-2)(2,2)%
\psline{->}(-2,0)(2,0)%
\psdot(-1,0)\uput[270](-1,0){$a$}%
\psdot(+1,0)\uput[270](+1,0){$b$}%
\end{pspicture}
\end{document}
3
  • 2
    Use $\mathstrut a$ and $\mathstrut b$, but there can be better methods (I'm no expert with pstricks).
    – egreg
    Aug 31 '15 at 11:17
  • The problem was tangentially about pstricks. The content inside the uput is what I was looking for and vphantom does the trick. I'll have to take a look at mathstrut because I have no idea what it does. Perhaps the question could use some editing
    – hanzo2001
    Aug 31 '15 at 11:43
  • \mathstrut is defined as \vphantom( so it has the height and depth of a simple math element. Aug 31 '15 at 14:06
3

You could insert a vphantom{b} in front of a:

\documentclass{minimal}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}(-2,-2)(2,2)%
\psline{->}(-2,0)(2,0)%
\psdot(-1,0)\uput[270](-1,0){$\vphantom{b}a$}%
\psdot(+1,0)\uput[270](+1,0){$b$}%
\end{pspicture}
\end{document}

Does this solve your problem?

1
  • Perfect, phantoms are a feature I soon forget exist
    – hanzo2001
    Aug 31 '15 at 11:39
1

another possible solution:

\psdots(-1,0)(1,0)
\rput[b](-1,-3ex){$a$}\rput[b](1,-3ex){$b$}
1
  • I already knew that rput would be enough. What I don't know is the -3ex length. Three heights of x under?
    – hanzo2001
    Aug 31 '15 at 22:35

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.