Necesito ayuda para formatear una tabla larga en Latex

Necesito ayuda para formatear una tabla larga en Latex

Tengo problemas para formatear mi tabla larga de dos páginas. Este es mi código actual:

ingrese la descripción de la imagen aquí

\begin{longtable}{p{5cm}p{9cm}}
    \caption{Descriptions of learning styles \citep{Hoerner2013}}\\
    \hline
    \multicolumn{1}{c}{\textbf{Learning Style}} & \multicolumn{1}{c}{\textbf{Description}} \\\hline
    \endhead 
    \multicolumn{1}{c}{1. Visual} & \parbox[c]{\hsize}{People who understand work better when it is in the form of a diagram. Knowledge and concept maps are good tools for such learners.} \vspace{1mm} \\\hline
    \multicolumn{1}{c}{2. Aural} &  \parbox[c]{\hsize}{\vspace{1mm} People who dislike reading, but enjoys hearing someone else say something aloud. Hearing the information is key for such students and group discussions can be of great aid.} \vspace{1mm}  \\\hline
    \multicolumn{1}{c}{3. Verbal} & \parbox[c]{\hsize}{Verbal learners are people who express themselves easier through writing and speaking. Mnemonics, scripting and role playing are some great techniques to helps those learners.} \vspace{1mm} \\\hline
    \multicolumn{1}{c}{4. Physical} &   \parbox[c]{\hsize}{Hands-on activities rather than lectures or demonstrations appeal to these learners. They are a small percentage of the population, but they learn better through practical experience.} \vspace{1mm} \\\hline
    \multicolumn{1}{c}{5. Logical} &    \parbox[c]{\hsize}{People who are good with numbers and using logic to understand. They easily recognize patterns and often tend to group information to further their understanding.}  \vspace{1mm} \\\hline
    \multicolumn{1}{c}{6. Social} & \parbox[c]{\hsize}{When communicating and socialising with others come easy, someone is a social learner. Studying in group formats and learning from others are their speciality and is how they excel.}   \vspace{1mm} \\\hline
    \multicolumn{1}{c}{7. Solitary} &   \parbox[c]{\hsize}{People who are more comfortable studying in private and introspective.  The concentration of these students are at their peak when they can focus on their own thoughts without the distractions of others around them.} \vspace{1mm} \\\hline
    \label{learningstyles}
\end{longtable}

y se muestra como en la imagen adjunta. Como puede verse, en cada fila de la tabla la línea h está muy cerca de la parte superior de cada párrafo. He insertado \ después de cada \hline que funciona, pero luego el espacio encima de cada párrafo y debajo no es del mismo tamaño, y se agrega una fila vacía encima de 3. Verbal en la segunda página de la tabla. Intenté agregar un \vspace{1mm} detrás de cada \hline en lugar de \ para que el espacio fuera del mismo tamaño, pero luego el programa falla.

¿Hay algo más que pueda hacer para que se vea mejor?

Respuesta1

No utilices \hliney \cline; en su lugar, cargue el booktabspaquete y emplee sus comandos \toprule, \midrule, \bottomruley \addlinespacesde dibujo lineal.

También reemplazaría las líneas horizontales interiores con espacios en blanco, no centraría el contenido de las columnas y no usaría en exceso la negrita.

ingrese la descripción de la imagen aquí

\documentclass{article} % select a suitable document class
\usepackage{natbib, longtable, booktabs}

\newlength\mylen
\settowidth\mylen{Learning Style}
% Calculate maximal permissible width of second column:
\setlength\mylen{\dimexpr\textwidth-\mylen-2\tabcolsep\relax}

\begin{document}
\frenchspacing
\begin{longtable}{@{}lp{\mylen}@{}}
    \caption{Descriptions of learning styles \citep{Hoerner2013}}
    \label{learningstyles} \\
    \toprule
    Learning Style & Description \\    
    \midrule
    \endhead 
    
    \bottomrule
    \endfoot
    
    1. Visual & People who understand work better when it is in the form of a diagram. Knowledge and concept maps are good tools for such learners.  \\ 
    \addlinespace
    2. Aural &  People who dislike reading, but enjoys hearing someone else say something aloud. Hearing the information is key for such students and group discussions can be of great aid.   \\ 
    \addlinespace
    3. Verbal & Verbal learners are people who express themselves easier through writing and speaking. Mnemonics, scripting and role playing are some great techniques to helps those learners.  \\ 
    \addlinespace
    4. Physical &   Hands-on activities rather than lectures or demonstrations appeal to these learners. They are a small percentage of the population, but they learn better through practical experience.  \\ 
    \addlinespace
    5. Logical &    People who are good with numbers and using logic to understand. They easily recognize patterns and often tend to group information to further their understanding.  \\ 
    \addlinespace
    6. Social & When communicating and socialising with others come easy, someone is a social learner. Studying in group formats and learning from others are their speciality and is how they excel.    \\ 
    \addlinespace
    7. Solitary &   People who are more comfortable studying in private and introspective.  The concentration of these students are at their peak when they can focus on their own thoughts without the distractions of others around them.  \\ 
    
\end{longtable}

\end{document}

Respuesta2

Con el uso del xltabularancho de las columnas se puede determinar automáticamente:

\documentclass{article}

\usepackage{booktabs, makecell, xltabular}
\renewcommand\theadfont{\normalsize\bfseries}

\usepackage{lipsum}

\begin{document}
\lipsum[1-3]

\begin{xltabular}{\linewidth}{@{} lX @{}}
    \caption{Descriptions of learning styles}
    \label{learningstyles}                              \\
    \toprule
\thead{Learning\\ Style}  & \thead{Description}         \\
    \midrule
\endfirsthead
    \caption[]{Descriptions of learning styles (cont.)} \\
    \toprule
\thead{Learning\\ Style}  & \thead{Description}         \\
    \midrule
\endhead
    \midrule
    \multicolumn{2}{r}{%
        \footnotesize\textit{Continue on the next page}}\\    
\endfoot
    \bottomrule
\endlastfoot
1. Visual
    &   People who understand work better when it is in the form of a diagram. Knowledge and concept maps are good tools for such learners.\\
    \addlinespace
2. Aural
    &   People who dislike reading, but enjoys hearing someone else say something aloud. Hearing the information is key for such students and group discussions can be of great aid.\\
    \addlinespace
3. Verbal
    &   Verbal learners are people who express themselves easier through writing and speaking. Mnemonics, scripting and role playing are some great techniques to helps those learners.\\
    \addlinespace
4. Physical
    &   Hands-on activities rather than lectures or demonstrations appeal to these learners. They are a small percentage of the population, but they learn better through practical experience.\\
    \addlinespace
5. Logical
    &   People who are good with numbers and using logic to understand. They easily recognize patterns and often tend to group information to further their understanding.\\
    \addlinespace
6. Social
    &   When communicating and socialising with others come easy, someone is a social learner. Studying in group formats and learning from others are their speciality and is how they excel.\\
    \addlinespace
7. Solitary
    &   People who are more comfortable studying in private and introspective.  The concentration of these students are at their peak when they can focus on their own thoughts without the distractions of others around them.\\
\end{xltabular}

\end{document}

ingrese la descripción de la imagen aquí

Respuesta3

Considere eliminar \parboxcuál es el culpable del espaciado extraño y reemplazarlo con las mcolumnas del arraypaquete.

También utilicé el booktabspaquete para líneas horizontales más bonitas.

\documentclass{article}

\usepackage{longtable}
\usepackage{array}
\usepackage{booktabs}

\begin{document}

\begin{longtable}{m{5cm}m{9cm}}
    \caption{Descriptions of learning styles}\\
    \toprule
    \multicolumn{1}{c}{\textbf{Learning Style}} & \multicolumn{1}{c}{\textbf{Description}} \\
    \midrule
    \endhead 
    \multicolumn{1}{c}{1. Visual} 
        & People who understand work better when it is in the form of a diagram. Knowledge and concept maps are good tools for such learners.\\
    \midrule
    \multicolumn{1}{c}{2. Aural} 
        & People who dislike reading, but enjoys hearing someone else say something aloud. Hearing the information is key for such students and group discussions can be of great aid.\\
    \midrule
    \multicolumn{1}{c}{3. Verbal} 
        & Verbal learners are people who express themselves easier through writing and speaking. Mnemonics, scripting and role playing are some great techniques to helps those learners.\\
    \midrule
    \multicolumn{1}{c}{4. Physical} 
        & Hands-on activities rather than lectures or demonstrations appeal to these learners. They are a small percentage of the population, but they learn better through practical experience.\\
    \midrule
    \multicolumn{1}{c}{5. Logical} 
        & People who are good with numbers and using logic to understand. They easily recognize patterns and often tend to group information to further their understanding.\\
    \midrule
    \multicolumn{1}{c}{6. Social} 
        & When communicating and socialising with others come easy, someone is a social learner. Studying in group formats and learning from others are their speciality and is how they excel.\\
    \midrule
    \multicolumn{1}{c}{7. Solitary} 
        & People who are more comfortable studying in private and introspective.  The concentration of these students are at their peak when they can focus on their own thoughts without the distractions of others around them.\\
    \bottomrule
    \label{learningstyles}
\end{longtable}


\end{document}

ingrese la descripción de la imagen aquí

Editar

En general, estoy de acuerdo con las sugerencias de Mico, pero si prefiere el estilo de tabla proporcionado (que repliqué), aún así recomendaría calcular el ancho de la columna como lo sugiere Mico usando la entrada más larga.

\documentclass{article}

\usepackage{longtable}
\usepackage{array}
\usepackage{booktabs}

\newlength\colOne
\newlength\colTwo
\settowidth\colOne{Learning Style}
% Calculate maximal permissible width of second column:
\setlength\colTwo{\dimexpr\textwidth-\colOne-2\tabcolsep\relax}

\begin{document}

\begin{longtable}{m{\colOne}m{\colTwo}}
    \caption{Descriptions of learning styles}\\
    \toprule
    \multicolumn{1}{c}{\textbf{Learning Style}} & \multicolumn{1}{c}{\textbf{Description}} \\
    \midrule
    \endhead 
    \multicolumn{1}{c}{1. Visual} 
        & People who understand work better when it is in the form of a diagram. Knowledge and concept maps are good tools for such learners.\\
    \midrule
    \multicolumn{1}{c}{2. Aural} 
        & People who dislike reading, but enjoys hearing someone else say something aloud. Hearing the information is key for such students and group discussions can be of great aid.\\
    \midrule
    \multicolumn{1}{c}{3. Verbal} 
        & Verbal learners are people who express themselves easier through writing and speaking. Mnemonics, scripting and role playing are some great techniques to helps those learners.\\
    \midrule
    \multicolumn{1}{c}{4. Physical} 
        & Hands-on activities rather than lectures or demonstrations appeal to these learners. They are a small percentage of the population, but they learn better through practical experience.\\
    \midrule
    \multicolumn{1}{c}{5. Logical} 
        & People who are good with numbers and using logic to understand. They easily recognize patterns and often tend to group information to further their understanding.\\
    \midrule
    \multicolumn{1}{c}{6. Social} 
        & When communicating and socialising with others come easy, someone is a social learner. Studying in group formats and learning from others are their speciality and is how they excel.\\
    \midrule
    \multicolumn{1}{c}{7. Solitary} 
        & People who are more comfortable studying in private and introspective.  The concentration of these students are at their peak when they can focus on their own thoughts without the distractions of others around them.\\
    \bottomrule
    \label{learningstyles}
\end{longtable}


\end{document}

ingrese la descripción de la imagen aquí

Editar 2

Como sugirió Mico en su comentario, tenemos que calcular el ancho de la versión de fuente en negrita del texto, ya que difiere del ancho de peso de fuente normal. Además, hay dos más \tabcolsepen este ejemplo en comparación con el de Mico. El que está en el extremo izquierdo de la mesa y el que está en el extremo derecho. Mico los suprimió escribiendo @{}lp{\mylen}@{}, donde @{}se usa para restablecer \tabcolseplocalmente cualquier dimensión que esté entre las llaves, por lo que en este caso, nada.

Por tanto, el código para calcular el ancho de las columnas debería sustituirse por el siguiente:

\newlength\colOne
\newlength\colTwo
\settowidth\colOne{\textbf{Learning Style}}
% Calculate maximal permissible width of second column:
\setlength\colTwo{\dimexpr\textwidth-\colOne-4\tabcolsep\relax}

información relacionada