
Sé que ya hay al menos una pregunta aquí sobre cómo configurar una hoja de aprobación. Sin embargo, la pregunta que les traigo ahora es ligeramente diferente, porque la pregunta en sí se refiere a cómo automatizar el número de miembros del comité examinador. A menudo, dependiendo del programa al que esté afiliado el estudiante, el comité puede estar formado por tres, cuatro, cinco o más miembros. Así, quisiera redactar un código en el que pudiera informar en el preámbulo del documento las siguientes informaciones: 1 - informar el número de miembros del comité examinador; 2 - ingrese el nombre del primer miembro; 3 - informar el título del primer miembro; 4- informar a la institución del primer miembro, y así sucesivamente. Por supuesto que los puntos 2, 3 y 4 se repetirían ya que informé el número de miembros presentes en el comité. ¿Sería posible crear tal código?
A continuación presento un ejemplo mínimo.
\documentclass[12pt,a4paper]{memoir}
\parindent0pt
\setSpacing{1.5}
\abnormalparskip{0.2\baselineskip}%
\setlength{\parindent}{1.5cm}%
\renewcommand*{\footnoterule}{\kern -3pt \hrule width 50mm \kern
2.6pt}%
\setlrmarginsandblock{30mm}{20mm}{*}%
\setulmarginsandblock{30mm}{20mm}{*}%
\setheadfoot{\baselineskip}{2\baselineskip}
\setheaderspaces{20.0mm}{*}{*}%
\setmarginnotes{2.0mm}{16mm}{5.0mm}%
\setcolsepandrule{3.5mm}{0.15mm}
\setfootins{\bigskipamount}{\bigskipamount}
\checkandfixthelayout[fixed]
\newcommand{\committeemembernumber}[1]{#1}
\newcommand{\memberonename}[1]{\gdef\thememberonename{#1}}
\newcommand{\memberoneinstitute}[1]{\gdef\thememberoneinstitute{#1}}
\newcommand{\membertwoname}[1]{\gdef\themembertwoname{#1}}
\newcommand{\membertwoinstitute}[1]{\gdef\themembertwoinstitute{#1}}
\newcommand{\memberthreename}[1]{\gdef\thememberthreename{#1}}
\newcommand{\memberthreeinstitute}[1]{\gdef\thememberthreeinstitute{#1}}
\newcommand{\memberfourname}[1]{\gdef\thememberfourname{#1}}
\newcommand{\memberfourinstitute}[1]{\gdef\thememberfourinstitute{#1}}
\newcommand{\memberfivename}[1]{\gdef\thememberfivename{#1}}
\newcommand{\memberfiveinstitute}[1]{\gdef\thememberfiveinstitute{#1}}
\title{Approval sheet: an example for the LaTeX}
\author{Alexsandro Lucena Mota}
\date{2020}
%\committeemembernumber{3}
\memberonename{Prof.~MA. Sir Isaac Newton}
\memberoneinstitute{Trinity College -- University of Cambrigde}
\membertwoname{Prof.~PhD. Albert Einstein}
\membertwoinstitute{Institute for Advanced Study (IAS)}
\memberthreename{Prof. PhD. Paul Adrien Maurice Dirac}
\memberthreeinstitute{Florida State University}
\memberfourname{Prof. PhD. Richard Phillips Feynman}
\memberfourinstitute{California Institute of Technology -- Caltech}
\memberfivename{Prof. PhD. Murray Gell-Mann}
\memberfiveinstitute{California Institute of Technology -- Caltech}
\begin{document}
\thispagestyle{empty}
\begin{center}
{\large \theauthor\par}
\vspace{\baselineskip}
{\Large
\begin{OnehalfSpace}%
\bfseries\thetitle\par%
\end{OnehalfSpace}%
}
\vspace{0.0cm}
\end{center}
\begin{flushright}%
\begin{minipage}{0.55\textwidth}%
\begin{SingleSpacing}%
{\small Doctoral thesis presented at Postgraduate
Program in Physics of the Universidade Federal do
Maranhão as prerequisite to obtain the Doctoral
degree.}\par
{\small {\bfseries Research line:} Topological
field theory with Lorentz symmetry breaking.}\par%
\end{SingleSpacing}%
\end{minipage}%
\end{flushright}
\vspace{\baselineskip}
Approval in: \rule[0.0cm]{3cm}{0.04cm}~
\rule[0.0cm]{1cm}{0.04cm},~\thedate.\par
\vspace{\baselineskip}
\begin{center}
{\Large Examining Committee}\par%
\vspace{\baselineskip}
\begin{SingleSpacing}
\rule{12cm}{0.04cm}\par%
\thememberonename\par%
\thememberoneinstitute\par
\vspace{1.9\baselineskip}
\rule{12cm}{0.04cm}\par
\themembertwoname\par%
\themembertwoinstitute\par
\vspace{1.9\baselineskip}
\rule{12cm}{0.04cm}\par
\thememberthreename\par
\thememberthreeinstitute\par
\vspace{1.9\baselineskip}
\rule{12cm}{0.04cm}\par
\thememberfourname\par%
\thememberfourinstitute\par
\vspace{1.9\baselineskip}
\rule{12cm}{0.04cm}\par
\thememberfivename\par
\thememberfiveinstitute\par
\end{SingleSpacing}
\end{center}
\end{document}
Este código proporciona el siguiente documento pdf:
Respuesta1
Aquí tienes una forma de hacerlo. La idea básica es tener un único comando:
\member{<name>}{<institute>}
Esto asignará automáticamente los miembros del comité y realizará un seguimiento de cuántos hay. Luego, a cada nombre/afiliación de comité se le asigna un nombre único utilizando el contador que realiza un seguimiento de los miembros. Esto se hace utilizando el \csgdef
contenedor \csname ... \endcsname
proporcionado por el etoolbox
paquete. Luego usamos ese contador y un bucle (usando el pgffor
paquete) para producir el número correcto de líneas de miembros (limitado, por supuesto, por la cantidad de espacio que tiene en la página).
\documentclass[12pt,a4paper]{memoir}
\parindent0pt
\setSpacing{1.5}
\abnormalparskip{0.2\baselineskip}%
\setlength{\parindent}{1.5cm}%
\renewcommand*{\footnoterule}{\kern -3pt \hrule width 50mm \kern
2.6pt}%
\setlrmarginsandblock{30mm}{20mm}{*}%
\setulmarginsandblock{30mm}{20mm}{*}%
\setheadfoot{\baselineskip}{2\baselineskip}
\setheaderspaces{20.0mm}{*}{*}%
\setmarginnotes{2.0mm}{16mm}{5.0mm}%
\setcolsepandrule{3.5mm}{0.15mm}
\setfootins{\bigskipamount}{\bigskipamount}
\checkandfixthelayout[fixed]
\usepackage{etoolbox}
\usepackage{pgffor}
\newcounter{committee}
\newcommand{\member}[2]{\stepcounter{committee}\csgdef{member\thecommittee}{#1}
\csgdef{institute\thecommittee}{#2}}
\title{Approval sheet: an example for the LaTeX}
\author{Alexsandro Lucena Mota}
\date{2020}
\member{Prof.~MA. Sir Isaac Newton}{Trinity College -- University of Cambridge}
\member{Prof.~PhD. Albert Einstein}{Institute for Advanced Study (IAS)}
\member{Prof. PhD. Paul Adrien Maurice Dirac}{Florida State University}
\member{Prof. PhD. Richard Phillips Feynman}{California Institute of Technology -- Caltech}
\member{Prof. PhD. Murray Gell-Mann}{California Institute of Technology -- Caltech}
\begin{document}
\thispagestyle{empty}
\begin{center}
{\large \theauthor\par}
\vspace{\baselineskip}
{\Large
\begin{OnehalfSpace}%
\bfseries\thetitle\par%
\end{OnehalfSpace}%
}
\vspace{0.0cm}
\end{center}
\begin{flushright}%
\begin{minipage}{0.55\textwidth}%
\begin{SingleSpacing}%
{\small Doctoral thesis presented at Postgraduate
Program in Physics of the Universidade Federal do
Maranhão as prerequisite to obtain the Doctoral
degree.}\par
{\small {\bfseries Research line:} Topological
field theory with Lorentz symmetry breaking.}\par%
\end{SingleSpacing}%
\end{minipage}%
\end{flushright}
\vspace{\baselineskip}
Approval in: \rule[0.0cm]{3cm}{0.04cm}~
\rule[0.0cm]{1cm}{0.04cm},~\thedate.\par
\vspace{\baselineskip}
\begin{center}
{\Large Examining Committee}\par%
\vspace{\baselineskip}
\begin{SingleSpacing}
\foreach \x in {1,...,\value{committee}}{
\rule{12cm}{0.04cm}\par%
\csuse{member\x}\par%
\csuse{institute\x}\par
\vspace{1.9\baselineskip}
}
\end{SingleSpacing}
\end{center}
\end{document}