对齐倾斜

对齐倾斜

我想在一行下方放置一些文本。所以我使用\bput。效果很好,但文本始终居中。有没有办法将其左/右对齐?请参阅下面的图片以了解更多信息。

\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}

在此处输入图片描述

答案1

\bput是已过时的命令,请\nbput改用。使用 无法真正实现对齐\nbput,但您可以改用\rlap\llap\rput

\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}

在此处输入图片描述

相关内容