
次のコードを使用して表形式のテーブルを作成したいと思います。
\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}
結果は次のとおりです。
質問: (1) すべての表が 2 列のテンプレートに収まるようにするにはどうすればよいですか? (2) 表に行を追加するにはどうすればよいですか?
ありがとう。
答え1
(a) 環境の幅tabularx
を に設定し、(b) 列タイプを\columnwidth
から に切り替えて、列 1 でも改行を許可することをお勧めします。列 1 のヘッダーで改行を許可するには、を に変更することをお勧めします。l
p
Place/Transition
Place\slash Transition
IEEEtranドキュメントクラスを使用する場合は、newtxmath
Times Romanなどのパッケージを使用することをお勧めします。数学フォントまた、縦線をすべて取り除き、横線を少なくして間隔をあけて配置することで、テーブルをより開放的で魅力的な「外観」にしようとします。
\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}