Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I wanna place some text below a line. So I'm using \bput. Works great, but text is always centered. Is there a way to align it left / right? See the picture for better bellow.

\documentclass[letterpaper,dvips]{article}

\usepackage[utf8]{inputenc}

\usepackage{pst-all}
\usepackage{pst-eps}

\begin{document}    

\pagestyle{empty}
\begin{TeXtoEPS}
\fontfamily{phv}\selectfont
\psset{xunit=1cm,yunit=1cm,runit=1cm}
\begin{pspicture}(0,-8.3)(16,0.0)
    \psframe[fillstyle=solid, linewidth=1pt](0,-8.3)(16,0.0)
    \psset{linewidth=2pt}

    \psframe[fillstyle=none, linewidth=0pt](0.5,-0.6)(15.5,-3.0)
    \pcline[linestyle=solid, linecolor=black]{<->}(1.0,-1.5)(15.0,-1.5)
    \bput*{:U}(0.1){LongerWord1}
    \bput*{:U}(0.5){LongerWord2}
    \bput*{:U}(0.90){LongerWord3}

    \psframe[fillstyle=none, linewidth=0pt](0.5,-3.6)(15.5,-6.0)
    \pcline[linestyle=solid, linecolor=black]{<->}(1.0,-4.5)(15.0,-4.5)
    \bput*{:U}(0.1){Short1}
    \bput*{:U}(0.5){Short2}
    \bput*{:U}(0.90){Short3}

\end{pspicture}

\end{TeXtoEPS}

\end{document}

enter image description here

share|improve this question
    
Thanks for accepting answers to all your questions! Generally, upvoting all helpful answers (to your questions as well as to others you read) is strongly encouraged. This way, we get a more precise rating which answers are more helpful and which are less so. So it'd be great if you went over your questions and upvoted some of the answers. More info in our faq. –  doncherry Sep 30 '12 at 21:05
add comment

1 Answer 1

up vote 5 down vote accepted

\bput is an obsolet command, use \nbput instead. Aligning is not really possible with \nbput, but you can use \rlap or \llap or \rput instead:

\documentclass{article}
\usepackage{pst-all}
\usepackage{helvet}\renewcommand\familydefault{phv}

\begin{document}    
\begin{pspicture}(0,-8.3)(16,0.0)
    \psframe[fillstyle=solid, linewidth=1pt](0,-8.3)(16,0.0)
    \psset{linewidth=2pt}

    \psframe[fillstyle=none, linewidth=0pt](0.5,-0.6)(15.5,-3.0)
    \pcline[linestyle=solid, linecolor=black]{<->}(1.0,-1.5)(15.0,-1.5)
    \rput*[lb](1.0,-2.05){LongerWord1}
    \nbput*{LongerWord2}
    \rput*[rb](15.0,-2.05){LongerWord3}

    \psframe[fillstyle=none, linewidth=0pt](0.5,-3.6)(15.5,-6.0)
    \pcline[linestyle=solid, linecolor=black]{<->}(1.0,-4.5)(15.0,-4.5)
    \nbput*[npos=0]{\rlap{Short1}}
    \nbput*{Short2}
    \nbput*[npos=1]{\llap{Short3}}
\end{pspicture}

\end{document}

enter image description here

share|improve this answer
    
High-rep users changing their gravatar confuse me :) –  doncherry Sep 30 '12 at 21:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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