
Me gustaría crear una tabla tabular usando el siguiente código.
\documentclass[journal]{IEEEtran}
\usepackage{tabularx}
\usepackage{booktabs}
\renewcommand{\arraystretch}{1.25}
\noindent\begin{tabularx}{\textwidth} { |
l |
>{\raggedright\arraybackslash}X |
c |
}
\hline
Place/Transition & Explanation & Time \\
\hline
$T_1$ and $T_{2(n+1)}$ & Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. & w \\
\hline
item 31 & item 32 & item 33 \\
\hline
\end{tabularx}
Aquí está el resultado.
Preguntas: (1) ¿Cómo asegurarse de que toda la tabla encaje en la plantilla de dos columnas? (2) ¿Cómo puedo agregar más filas en la tabla?
Gracias.
Respuesta1
Le sugiero que (a) establezca el ancho del tabularx
entorno \columnwidth
y (b) permita también el salto de línea en la columna 1, cambiando de un tipo de columna l
a otro p
. Para permitir un salto de línea en el encabezado de la columna 1, le sugiero que cambie Place/Transition
a Place\slash Transition
.
Cuando trabaje con la clase de documento IEEEtran, le sugiero además que utilice un paquete, como newtxmath
, que proporcione una versión Times Roman.fuente matemática. También intentaría darle a la mesa un "aspecto" más abierto y atractivo, eliminando todas las líneas verticales y creando menos reglas horizontales, pero bien espaciadas.
\documentclass[journal]{IEEEtran}
\usepackage{newtxtext,newtxmath} % Times Roman text and math fonts
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{ragged2e} % for \RaggedRight macro
\newlength\mylen
\settowidth\mylen{Transition} % target width of column 1
\begin{document}
%\renewcommand{\arraystretch}{1.25} % <-- I wouldn't do that
\noindent
\begin{tabularx}{\columnwidth} {@{}
>{\RaggedRight}p{\mylen}
>{\RaggedRight}X
c @{}}
\toprule
Place\slash Transition & Explanation & Time \\
\midrule
$T_1$ and $T_{2(n+1)}$ &
Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks, and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. &
$w$ \\
\addlinespace
item 31 & item 32 & item 33 \\
\bottomrule
\end{tabularx}
\end{document}