Crear una tabla tabular

Crear una tabla tabular

Me gustaría desarrollar una tabla tabular como esta. ingrese la descripción de la imagen aquí

Sin embargo, cuando uso el código de referencia dehttps://www.overleaf.com/learn/latex/Tables#Creating_a_simple_table_in_LaTeX, con código:

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{0.8\textwidth} { 
  | >{\raggedright\arraybackslash}X 
  | >{\centering\arraybackslash}X 
  | >{\raggedleft\arraybackslash}X | }
 \hline
 Place/Transition & Explanation & Time  \\
 \hline
 T_1 and T_(2(n+1))  & Robot operation which relates to loadlocks. Transition T_1indicates 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}
\end{document}

El resultado es el siguiente.

ingrese la descripción de la imagen aquí

Quizás, ¿alguien tiene alguna otra referencia para crear una tabla tabular que quiera, por favor?

Cuando reemplazo \begin{tabularx}{0.8\textwidth} por \noindent\begin{tabularx}{\linewidth} , aquí está el resultado:

ingrese la descripción de la imagen aquí Gracias de antemano.

Respuesta1

El problema es, como se indica en los comentarios, que omites la sintaxis necesaria para el modo matemático. Debido a esto, TeX en algún momento leerá un _carácter que solo es válido en modo matemático. Por lo tanto, cambiará al modo matemático automáticamente, pero como no sabe dónde debe terminar el modo matemático, sigue escribiendo en modo matemático, lo que genera este resultado extraño.

Es muy fácil resolver este problema utilizando la sintaxis correcta para el modo matemático. Como no necesita párrafos en las columnas uno y tres, también puede cambiar a otra definición de columna:

\documentclass{article}
\usepackage{tabularx}

\begin{document}
\begin{tabularx}{0.8\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}
\end{document}

ingrese la descripción de la imagen aquí

Se podría crear una solución alternativa con la ayuda del booktabspaquete, que puede ayudarle a reducir la cantidad de bordes entre celdas:

\documentclass{article}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\renewcommand{\arraystretch}{1.25}
\begin{tabularx}{0.8\textwidth} { 
  l 
  >{\raggedright\arraybackslash}X 
  c 
}
  \toprule
  Place/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 \\
  item 31 & item 32 & item 33 \\
  \bottomrule
\end{tabularx}
\end{document}

ingrese la descripción de la imagen aquí


Tenga en cuenta que es posible que desee reemplazar 0.8\textwidthpor \linewidthsi desea extender la tabla al ancho de una columna de texto en un diseño de dos columnas:

\documentclass[journal]{IEEEtran}
\usepackage{lipsum}
\usepackage{tabularx}

\begin{document}

\lipsum[1]

\noindent%
\begin{tabularx}{\linewidth} { |
  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}

\newpage

Right column

\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

He aquí una idea que complementa la segunda tabla deLa respuesta de @JasperHabicht: elimine el relleno de espacios en blanco en cada extremo y permita saltos de línea en la columna 1.

ingrese la descripción de la imagen aquí

\documentclass{article}
\usepackage{tabularx} % for 'tabularx' env. and 'X' column type
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage{ragged2e} % for '\RaggedRight' macro
\newlength\mylen

\begin{document}

\begin{center}
\settowidth\mylen{Transition} % target width of column 1
\begin{tabularx}{0.8\textwidth} {@{} 
     >{\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{center}
\end{document}

información relacionada