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'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
add comment

1 Answer

up vote 8 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
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.