
He tenido un problema de desalineación entre los campos de texto generados hyperref
y las líneas rectas correspondientes debajo de ellos. La imagen adjunta ilustra el problema.
El objetivo es claro. Me gustaría bajar los campos de texto para que cada campo de texto quede directamente encima de la línea recta correspondiente. Mi código es el siguiente:
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{flushleft}
\begin{Form}
\renewcommand{\baselinestretch}{1.0}
\fontsize{12}{24}\selectfont
\hspace*{2cm} \TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} advisor, \hspace{2cm} Date\\
\hspace*{2cm} \TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberA \\
\hspace*{2cm} \TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberB \\
\hspace*{2cm} \TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberC \\
\hspace*{2cm} \TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberD \\
\end{Form}
\end{flushleft}
\end{document}
Siempre existe la opción de subir las líneas pero tendré que subir los títulos de las firmas (por ejemplo advisor
, memberA
) también. Preferiría bajar los campos de texto si es posible, ya que siempre puedo crearlos a mano usando Acrobat si es necesario.
Cualquier ayuda será apreciada.
Respuesta1
Yo usaría a tabular
junto con booktabs
:
\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\begin{tabular}{@{}p{11.5cm}@{}}
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
advisor, \hspace{2cm} Date\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberA\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberB\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberC\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberD
\end{tabular}
\end{Form}
\end{document}
Respuesta2
La respuesta anterior es correcta. Por motivos de exhaustividad, me gustaría añadir los resultados de mi propio intento fallido para ilustrar diferentes aspectos del problema.
Si uso raisebox
, mi código se vuelve así:
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{flushleft}
\begin{Form}
\renewcommand{\baselinestretch}{1.0}
\fontsize{12}{24}\selectfont
\raisebox{-1.0 cm}[2cm]{\TextField[name=First and Last Name, width=8cm, borderwidth=1, charsize=0pt]{} \TextField[name=Date, width=3.7cm, borderwidth=1, charsize=0pt]{}}\\
\rule[-2.5ex]{11.4cm}{0.5pt} \\
advisor, \hspace{7.3cm} Date\\
\hspace*{2cm} \raisebox{-1.0 cm}[2cm]{\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberA \\
\hspace*{2cm} \raisebox{-3.0 cm}{\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberB \\
\hspace*{2cm} \raisebox{-1.0 cm}{\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberC \\
\hspace*{2cm} \raisebox{-1.0 cm}{\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}}\\
\hspace*{2cm} \rule[-2.5ex]{11.4cm}{0.5pt} \\
\hspace*{2cm} memberD \\
\end{Form}
\end{flushleft}
\end{document}
y los resultados se pueden ver en la imagen. Como puede ver, intentar bajar el campo de texto raisebox
tiene éxito, hasta un punto crítico. Después de este punto crítico, en lugar de bajar solo el campo de texto, se baja todo el "grupo" (que consta del campo de texto, la línea y el título de la firma).
Mi segunda observación se refiere a la solución mencionada anteriormente, con booktabs
, que funciona. Si cambio ligeramente el código, verá que el problema es causado esencialmente por el rule
comando.
\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\begin{tabular}{@{}p{11.5cm}@{}}
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\rule[-2.5ex]{11.4cm}{0.5pt}
advisor, \hspace{2cm} Date\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberA\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberB\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberC\\[2.5ex]
\TextField[name=First and Last Name, width=8cm, borderwidth=1]{}\\\midrule[0.5pt]
memberD
\end{tabular}
\end{Form}
\end{document}