0

I'm trying to create a two-column area for signatures, so folks signing the document are listed in the left column or right column, and there are enough rows to accommodate everyone's signature. Under each signature line, I want to print their name and optionally title/company name if applicable, and I want to pull the name/title/company from a variable so I can change those easily.

I'm having difficulty with this since a foreach loop will have everything identical, but I might need different commands if I'm on the left-hand side vs. the right-hand side.

Here is my variable with everyone's names; I'm flexible on how this is laid out:

\def\members{
   {
      {Name1, Title1, CompanyName1},
      {Name2, Title2, CompanyName2}
   }, {
      {Name3},
      {Name4, Title4, CompanyName4}
   }, {
      {Name5, Title5, CompanyName5},
      {Name6}
   }, {
      {Name7, Title7, CompanyName7},
      {Name8, Title8, CompanyName8}
   }, {
      {Name9, Title9, CompanyName9},
      {Name10, Title10, CompanyName10}
   }%
}

Here is what I had originally that worked well for listing everyone in a single column, and it relied on members being flatter than shown above:

\foreach \x in \members {
   \ \\[8ex]
   \makebox[2.5in]{\hrulefill} \\
   \foreach \y in \x {
      \y \\[1ex]
   }
}

What I'm trying to do now is incorporate a table with left/right columns:

\begin{tabular}{ l l }
   \begin{tabular}{@{}l@{}} \ \\[8ex] \makebox[2.5in]{\hrulefill} \\
      Name1 \\
      Title1 \\
      CompanyName1 \end{tabular}
   & \begin{tabular}{@{}l@{}} \ \\[8ex] \makebox[2.5in]{\hrulefill} \\
      Name1 \\
      Title1 \\
      CompanyName1 \end{tabular} \\
\end{tabular}
1
  • 1
    Welcome to TeX-SE! Using \foreach to build a table is more complicated than one may expect. See e.g. tex.stackexchange.com/a/62178/121799 for a solution.
    – user121799
    Mar 10, 2019 at 1:29

1 Answer 1

0

@marmot's comment helped. Instead of looping with \foreach, I used a pair of macros. I couldn't keep it as neat and separated as I want, but this will do nicely.

\newcommand{\sigblock}[3]{
   \makebox[2.5in]{\hrulefill} \\
      \ #1 \\
      \ #2 \\
      \ #3
}

\newcommand{\sigpair}[2]{%
   \begin{tabular}{@{}l@{}} \ \\[8ex] \sigblock #1 \end{tabular} &
   \begin{tabular}{@{}l@{}} \ \\[8ex] \sigblock #2 \end{tabular}
}

\begin{tabular}{ l l }
   \sigpair{{Name1}{Title1}{CompanyName1}}{{Name2}{Title2}{CompanyName2}} \\
   \sigpair{{Name3}{}{}}{{Name4}{Title4}{CompanyName4}} \\
   \sigpair{{Name5}{Title5}{CompanyName5}}{{Name6}{Title6}{CompanyName6}} \\
   \sigpair{{Name7{}Title7}{CompanyName7}}{{Name8}{}{}} \\
   \sigpair{{Name9}{Title9}{CompanyName9}}{{Name10}{Title10}{CompanyName10}}
\end{tabular}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .