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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm making some placecards and using the picture environment to try to control exactly where everything goes. My problem is that, in the example below, the two lines are not exactly right-aligned. Any idea how to fix this would be very welcome!

enter image description here

\documentclass[12pt]{article}

\setlength{\unitlength}{1mm}

\newcommand{\rbox}[2]{
  \put(0,#1){
    \makebox(89,0)[r]{
      #2
  }}
}

\newcommand{\pclabel}[2]{

  \begin{picture}(89,51)(0,0)    
    \rbox{42}{
      \LARGE#1
    }
    \rbox{28}{
      \Large\textsc{#2}
    }

    \put(87,  0){\line( 0, 1){50}}
  \end{picture}
}

\begin{document}
\pclabel{Bob Smithm}{Fiji}
\end{document}
share|improve this question
up vote 9 down vote accepted

Remove spurious blank spaces from your code (one carriage return in text mode is taken as a space):

\documentclass[12pt]{article}

\setlength{\unitlength}{1mm}

\newcommand{\rbox}[2]{%
  \put(0,#1){%
    \makebox(89,0)[r]{%
      #2%
  }}%
}

\newcommand{\pclabel}[2]{%
  \begin{picture}(89,51)(0,0)    
    \rbox{42}{%
      \LARGE#1%
    }%
    \rbox{28}{%
      \Large\textsc{#2}%
    }%

    \put(88.5,  0){\line( 0, 1){50}}
  \end{picture}
}

\begin{document}
\pclabel{Bob Smithm}{Fiji}
\end{document}

enter image description here

share|improve this answer
    
Excellent, thank you! – ocd Jun 3 '12 at 14:15

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.