
Ich möchte mithilfe des folgenden Codes eine tabellarische Tabelle erstellen.
\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}
Hier ist das Ergebnis.
Fragen: (1) Wie stelle ich sicher, dass die gesamte Tabelle in die zweispaltige Vorlage passt? (2) Wie kann ich der Tabelle weitere Zeilen hinzufügen?
Danke schön.
Antwort1
Ich schlage vor, dass Sie (a) die Breite der tabularx
Umgebung auf einstellen \columnwidth
und (b) auch in Spalte 1 Zeilenumbrüche zulassen, indem Sie von einem l
zu einem p
Spaltentyp wechseln. Um einen Zeilenumbruch in der Kopfzeile von Spalte 1 zuzulassen, schlage ich vor, dass Sie Place/Transition
zu ändern Place\slash Transition
.
Wenn Sie mit der IEEEtran-Dokumentenklasse arbeiten, empfehle ich Ihnen außerdem, ein Paket wie zu verwenden newtxmath
, das eine Times Roman-Datei bereitstellt.Mathe-Schriftart. Ich würde auch versuchen, der Tabelle ein offeneres und einladenderes Aussehen zu verleihen, indem ich alle vertikalen Linien entferne und weniger, aber dafür gut verteilte horizontale Linien einführe
\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}