
다음 코드를 사용하여 테이블 형식의 테이블을 만들고 싶습니다.
\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) 테이블에 행을 더 추가하려면 어떻게 해야 합니까?
감사합니다.
답변1
(a) 환경의 너비를 tabularx
로 설정하고 (b) an에서 열 유형 으로 \columnwidth
전환하여 열 1에서도 줄바꿈을 허용하도록 제안합니다 . 열 1의 헤더에 줄 바꿈을 허용하려면 로 변경하는 것이 좋습니다 .l
p
Place/Transition
Place\slash Transition
newtxmath
IEEEtran 문서 클래스로 작업할 때 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}