3

I would like to have multiple boxes with many rows on a line with wrapping when the boxes are overflowing.

The idea would be to build a custom contributors/reviewers environment that I can also use with TeX4ht:

\documentclass[a4paper]{report}

\usepackage{pgffor}

\newcommand{\ccReviewer}[1]{%
    \hbox{#1}
}
\newcommand{\ccAffiliation}[1]{%
    \hbox{#1}
}
\newcommand{\ccReviewersList}[1]{%
    \hbox{%
        \foreach \reviewer / \affiliation in #1{%
            \vbox{
                \ccReviewer{\reviewer}%
                \ccAffiliation{\affiliation}
            }
        }
    }
}


\begin{document}
\begin{center}
    {\large Contributors and Reviewers}\\
    \vspace{5mm}
    \def\ccReviewers{%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation%
    }
    \ccReviewersList{\ccReviewers}
\end{center}

\end{document}

Here is the current output:

CCRA

3
\documentclass[a4paper]{report}

\usepackage{pgffor,stackengine}

\newcommand{\ccReviewer}[1]{%
    \hbox{#1}
}
\newcommand{\ccAffiliation}[1]{%
    \hbox{#1}
}
\newcommand{\ccReviewersList}[1]{%
        \foreach \reviewer / \affiliation in #1{%
            \Longstack[l]{%
                \ccReviewer{\reviewer}
                \ccAffiliation{\affiliation}
            }
        }
}
\begin{document}
\begin{center}
    {\large Contributors and Reviewers}\\
    \vspace{5mm}
    \def\ccReviewers{%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation%
    }
    \ccReviewersList{\ccReviewers}
\end{center}
\end{document}

enter image description here

You could streamline it further:

\documentclass[a4paper]{report}

\usepackage{pgffor,stackengine}

\newcommand{\ccReviewersList}[1]{%
    \foreach \reviewer / \affiliation in #1{%
        \addstackgap[4pt]{\Longstack[l]{\reviewer{} \affiliation}}\hspace{4pt} 
    }
}
\begin{document}
\begin{center}
    {\large Contributors and Reviewers}\\
    \vspace{5mm}
    \def\ccReviewers{%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation,%
        Author/Affiliation%
    }
    \ccReviewersList{\ccReviewers}
\end{center}
\end{document}

...or even replace pgffor with listofitems, as such, allowing you to not require the % trailers in the \ccReviewers list:

\documentclass[a4paper]{report}

\usepackage{stackengine,listofitems}

\newcommand{\ccReviewersList}[1]{%
    \setsepchar[?]{,?/}%
    \readlist*\authlist{#1}%
    \foreachitem\x\in\authlist[]{%
        \addstackgap[4pt]{%
        \Longstack[l]{\authlist[\xcnt,1] \authlist[\xcnt,2]}}\hspace{4pt}
    }
}
\begin{document}
\begin{center}
    {\large Contributors and Reviewers}\\
    \vspace{5mm}
    \def\ccReviewers{
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation,
        Author/Affiliation
    }
    \ccReviewersList{\ccReviewers}
\end{center}
\end{document}
1
  • Brilliant, thanks!
    – Kel Solaar
    Mar 15 '19 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.