![La alineación vertical en la tabla usando una matriz no funciona](https://rvso.com/image/391709/La%20alineaci%C3%B3n%20vertical%20en%20la%20tabla%20usando%20una%20matriz%20no%20funciona.png)
Vea a continuación mi código. No cambié nada con el código, simplemente volví a compilar mi documento LaTeX y la alineación central vertical ya no funciona.
¿Cómo puedo recuperar la alineación central vertical (como se ve en la captura de pantalla "antes")?
Código:
\documentclass[10pt]{exam}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{| L{3cm} | L{8cm} | L{1.7cm} | L{1.7cm} |}
\hline
\textbf{Section} & \textbf{Description} & \textbf{Available Points} & \textbf{Earned Points}\\
\hline
\textbf{Cover Page} & Includes the title of the report, team name, and all of the team member names. & 1 & ~\\[1cm]
\hline
\textbf{Introduction} & Explains the project functionality and features. & 2 & ~\\[1cm]
\hline
\end{tabular}
\end{table}
\end{document}
Antes:
Después:
Respuesta1
A mi tampoco me funciona. Propongo modificar la definición de sus tipos de columnas para incorporar el S
preespecificador (puede usar otra letra si carga siunitx
) de cellspace
. Esto asegura en las columnas correspondientes un espacio vertical mínimo en la parte superior e inferior de las celdas:
\documentclass[10pt]{exam}
\usepackage{array, cellspace}
\setlength{\cellspacetoplimit}{2ex}
\setlength{\cellspacebottomlimit}{2ex}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}S{m{#1}}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}S{m{#1}}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}S{m{#1}}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{| L{3cm} |L{8cm} | L{1.7cm} | L{1.7cm} |}
\hline
\textbf{Section} & \textbf{Description} & \textbf{Available Points} & \textbf{Earned Points}\\
\hline
\textbf{Cover Page} & Includes the title of the report, team name, and all of the team member names. & 1 & ~\\
\hline
\textbf{Introduction} & Explains the project functionality and features. & 2 & ~\\
\hline
\end{tabular}
\end{table}
\end{document}