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 am attemting to add three side-by-side signature to a scrlttr2 letter by using a minipage environment in the signature definition. I am getting an error: Extra }, or forgotten \endgroup pointing me to the closing line. The error goes away if i do without the minpages. Here's the MWE:

\documentclass[%
paper=letter,
pagesize,
fontsize=10pt,
standard
]{scrlttr2}

\usepackage{filecontents}
\setkomavar{fromname}{Sender's Name}
\setkomavar{fromaddress}{Some street\\in some town\\with zip code}
\begin{filecontents}{standard.lco}
    \setkomavar{signature}{% 
    \begin{minipage}[b]{0.33\linewidth}
    First name\\
    Position 1
    \end{minipage}
    \begin{minipage}[b]{0.33\linewidth}
    Second name\\
    Position 2
    \end{minipage}
    \begin{minipage}[b]{0.33\linewidth}
    Third name\\
    Position 3
    \end{minipage}
}

\@setplength[1]{sigindent}{0.01\textwidth}
\end{filecontents}


\begin{document}
\begin{letter}{%
Recipient's name,\\
Some position\\
More address info
}

\opening{Dear Recipient}
\lipsum[1-2]

\closing{Sincerely,}

\end{letter}
\end{document}

The document renders correctly, even though the compilation fails. Am I going the right way about this?

share|improve this question
    
can you post the error message you get when you try to compile it? –  ArTourter Aug 17 '12 at 20:25
    
Sure thing: ERROR: Extra }, or forgotten \endgroup. ---TeX said --- <recently read> } l.153 \closing{Sincerely,} --- HELP --- From the .log file... I've deleted a group-closing symbol because it seems to be spurious, as in '$x}$'. but perhaps the } is legitimate and you forgot something else, as in \hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g. by typing I$}'` –  Ricardo Aug 17 '12 at 20:29
    
It also says 'TeX has become confused. The position indicated by the error locator is probably beyond the point where the incorrect input is.` For what is worth, I've checked all my braces and they are balanced. There's no math in this document. The error goes away when I remove the minipages. –  Ricardo Aug 17 '12 at 20:35
add comment

2 Answers

up vote 5 down vote accepted

Instead of minipages you can use \parboxes:

\documentclass[%
paper=letter,
pagesize,
fontsize=10pt,
standard
]{scrlttr2}
\usepackage[english]{babel}
\usepackage{lipsum}

\newcommand\Sigline[4][t]{%
  \parbox[#1]{.333\linewidth}{\raggedright#2}%
  \parbox[#1]{.333\linewidth}{\raggedright#3}%
  \parbox[#1]{.333\linewidth}{\raggedright#4}%
}

\setkomavar{fromname}{Sender's Name}
\setkomavar{fromaddress}{Some street\\in some town\\with zip code}
\setkomavar{signature}{% 
   \Sigline{First name}{Second name}{Third name} \\
  \Sigline{Position 1}{Position 2}{Position 3} \\
}

\begin{document}
\begin{letter}{%
Recipient's name,\\
Some position\\
More address info
}

\opening{Dear Recipient}
\lipsum[2]

\closing{Sincerely,}

\end{letter}
\end{document}

enter image description here

share|improve this answer
    
I think it's critical to mention that you used \textwidth instead of \linewidth. Not sure, since I didn't delve deep enough... –  Werner Aug 17 '12 at 20:42
    
@Werner Hmmm I was just editiong to change to \linewidth; can you elaborate your comment, please? –  Gonzalo Medina Aug 17 '12 at 20:45
    
This worked! Why should I prefer parbox over minipage in this case, and why did you replace \textwidthfor \linewidth? –  Ricardo Aug 17 '12 at 20:47
2  
@Ricardo \textwidth produced overfull boxes; as for the reason \parbox works but minipage doesn't, I am not so sure in this case and will have to look more closely to what \setkomavar and signature do. –  Gonzalo Medina Aug 17 '12 at 20:58
    
@GonzaloMedina: When I used \linewidth instead of \textwidth, it seemed like the signature was squished horizontally. I thought it might be that it puts it in a reduced-width box. –  Werner Aug 17 '12 at 20:58
add comment

Here is a solution that is independent of any particular document class.

\documentclass{minimal}

\begin{document}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat, sed diam voluptua.

\def\s#1#2{\vbox{\hsize=4.5cm
    \kern2cm
    \hrule\kern1ex
    \hbox to \hsize{\strut\hfil #1 \hfil}
    \hbox to \hsize{\strut\hfil #2 \hfil}}}

\hbox to \hsize{\s{John Doe}{President}\hfil
    \s{Jane Doe}{COO}\hfil
    \s{James Dow}{CFO}} 

\end{document}

screenshot

share|improve this answer
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.