
저는 라텍스를 처음 사용하기 때문에 다소 복잡한 테이블을 만들어야 합니다. 제목은 기본적으로 내가 하고 싶은 일을 말해줍니다. 해결하고 싶은 문제는 다음과 같습니다.
- 테이블이 조금 더 길어질 것이므로 반드시 다른 페이지가 필요합니다.
- 보시다시피 일부 줄은 줄바꿈을 하지 않습니다. 예:고급 증강, 줄 바꿈이 작동하는 다른 경우에는 왜 이런 일이 발생하는지 궁금합니다.
- 여러 행의 숫자는 수직으로 중앙에 위치하지 않습니다.5.2조금 아래에 있어야합니다.
한편으로는 문제를 해결하면 테이블의 다른 부분이 깨져서 조금 실망스럽습니다. 좋은 아이디어가 있나요?
최소 실행 예:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{longtable}
\usepackage{amsmath}
\usepackage{gensymb}
\begin{document}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{table}[h!]
\centering
\begin{tabularx}{\textwidth}{C{1.5cm}|C{2cm} C{2cm} Y}
Chapter & Experiment & Hyperparameter & Range \\
\hline
5.1 & benchmark & None & Configuration as in Chapter 3.2 \\
\hline
\multirow{7}{*}{5.2} & learning rate & learning rate & 0.00002, 0.00005, 0.0001, 0.00025 \\
\cline{2-4}
& \multirow{6}{=}{basic augmentation}
& aspect ratio & $1\pm0.5$ times total height and width \\
& & cropping & random $333\times333$ region \\
& & horizontal flip & probability of $50\%$ \\
& & rotation & rotating up to $\pm 180\degree$ uniformly chosen\\
& & shearing & random angle between $\pm 30\degree$ uniformly chosen \\
& & scaling & ratio between $0.5-2.0$ uniformly chosen \\
\hline
\multirow{16}{*}{5.2} & \multirow{2}{*}{brightness shift} & minimum brightness & X \\
& & maximum brightness & X \\
\cline{2-4}
& \multirow{2}{*}{noise injection} & mean & X \\
& & variance & X \\
\cline{2-4}
& \multirow{2}{*}{patch shuffle} & patch size & X \\
& & probability & X \\
\cline{2-4}
& \multirow{3}{*}{random erasing} & maximum range & X \\
& & aspect ratio r\_2 & X \\
& & probability & X \\
\cline{2-4}
& \multirow{7}{*}{advanced augmentation} & patch shuffle & X \\
& & scaling & X \\
& & horizontal flip & X \\
& & vertical flip & X \\
& & \begin{tabular}[c]{@{}c@{}}brightness \\ shift\end{tabular} & X \\
& \multicolumn{1}{l}{} & aspect ratio & X \\
& \multicolumn{1}{l}{} & shearing & X \\
\hline
5.3 & ablation study without augmentation & image cycle consistency loss weight & 0.1,0.2,0.5,1.0 \\
\end{tabularx}
\caption{Searched hyperparameters \label{all_hyperparameter}}
\end{table}
\end{document}
지금까지의 모습은 다음과 같습니다.
답변1
geometry
나는 , xcolor
및 xltabular
(페이지 전체에서 tabularx 테이블을 나누기 위해)을 사용하는 이 변형 레이아웃을 제안합니다 .
\documentclass{article}
\usepackage{geometry}
\usepackage[table, svgnames]{xcolor}
\usepackage{multirow}
\usepackage{ xltabular, booktabs}
\usepackage{amsmath}
\usepackage{gensymb}
\begin{document}
{\centering\setlength{\extrarowheight}{2pt}\arrayrulecolor{SlateGrey}%
\begin{xltabular}{\textwidth}{!{\quad}m{3.6cm}>{\raggedleft}m{3.5cm}X}%
\caption{Searched hyperparameters \label{all_hyperparameter}} \\
Experiment & Hyperparameter & Range \\
\addlinespace
\endfirsthead
\caption[]{Searched hyperparameters (\emph{continued})} \\
Experiment & Hyperparameter & Range \\
\addlinespace
\endhead
\hline
\multicolumn{3}{r}{\small\emph{To be continued}}
\endfoot
\bottomrule
\endlastfoot
\rowcolor{Gainsboro!50!Lavender} \multicolumn{3}{@{}l}{\textsc{Chapter 5.1}} \\[0.5ex]
benchmark & None & Configuration as in Chapter 3.2 \\[2ex]%
\rowcolor{Gainsboro!60!Lavender}\multicolumn{3}{@{}l}{ \textsc{Chapter 5.2}}\\[0.5ex]
learning rate & learning rate & 0.00002, 0.00005, 0.0001, 0.00025 \\
\cmidrule(l{1em}){1-3}
{basic augmentation} &
aspect ratio & $1\pm0.5$ times total height and width \\
& cropping & random $333\times333$ region \\
& horizontal flip & probability of $50\%$ \\
& rotation & rotating up to $\pm 180\degree$ uniformly chosen\\
& shearing & random angle between $\pm 30\degree$ uniformly chosen \\
& scaling & ratio between $0.5-2.0$ uniformly chosen \\
\cmidrule(l{1em}){1-3}
\multirow{2}{*}{brightness shift} & minimum brightness & X \\
& maximum brightness & X \\
\cmidrule(l{1em}){1-3}
\multirow{2}{*}{noise injection} & mean & X \\
& variance & X \\
\cmidrule(l{1em}){1-3}
\multirow{2}{*}{patch shuffle} & patch size & X \\
& probability & X \\
\cmidrule(l{1em}){1-3}
\multirow{3}{*}{random erasing} & maximum range & X \\
& aspect ratio r\_2 & X \\
& probability & X \\
\cmidrule(l{1em}){1-3}
advanced \rlap{augmentation} & patch shuffle & X \\
& scaling & X \\
& horizontal flip & X \\
& vertical flip & X \\
&brightness shift & X \\%
& aspect ratio & X \\
& shearing & X \\[2ex]
\rowcolor{Gainsboro!60!Lavender}\multicolumn{3}{@{}l}{\textsc{Chapter} 5.3} \\[0.5ex]
ablation study without augmentation & image cycle consistency loss weight & 0.1,0.2,0.5,1.0
\end{xltabular}}
\end{document}
답변2
다음은 수평선이 다소 있는 두 가지 버전입니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{xltabular}
\usepackage{multirow}
\usepackage{array}
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage[english]{babel}
\usepackage{booktabs}
\begin{document}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{xltabular}{\textwidth}{@{\quad\quad}>{\raggedright\arraybackslash}p{2.25cm} >{\raggedright\arraybackslash}p{2.5cm} X}
\caption{Searched hyperparameters \label{all_hyperparameter}}\\
\toprule
Experiment & Hyperparameter & Range \\
\midrule
\endhead
\multicolumn{3}{@{}l}{\itshape Chapter 5.1}\\ \addlinespace
benchmark & None & Configuration as in Chapter 3.2 \\
\midrule
\multicolumn{3}{@{}l}{\itshape Chapter 5.2}\\
\addlinespace
learning rate & learning rate & 0.00002, 0.00005, 0.0001, 0.00025 \\
\addlinespace
\multirow{2}{=}{basic augmentation} & aspect ratio & $1\pm0.5$ times total height and width \\
& cropping & random $333\times333$ region \\
& horizontal flip & probability of $50\%$ \\
& rotation & rotating up to $\pm 180\degree$ uniformly chosen\\
& shearing & random angle between $\pm 30\degree$ uniformly chosen \\
& scaling & ratio between $0.5-2.0$ uniformly chosen \\
\addlinespace
brightness shift & maximum brightness & X \\
\addlinespace
noise injection & mean & X \\
& variance & X \\
\addlinespace
patch shuffle & patch size & X \\
& probability & X \\
\addlinespace
\multirow{2}{=}{random erasing} & maximum range & X \\
& aspect ratio r\_2 & X \\
& probability & X \\
\addlinespace
\multirow{2}{=}{advanced augmentation} & patch shuffle & X \\
& scaling & X \\
& horizontal flip & X \\
& vertical flip & X \\
& brightness shift & X \\
& aspect ratio & X \\
& shearing & X \\
\midrule
\multicolumn{3}{@{}l}{\itshape Chapter 5.3}\\ \addlinespace
ablation study without augmentation & image cycle consistency loss weight & 0.1,0.2,0.5,1.0 \\
\end{xltabular}
\begin{xltabular}{\textwidth}{@{\quad\quad}>{\raggedright\arraybackslash}p{2.25cm} >{\raggedright\arraybackslash}p{2.5cm} X}
\caption{Searched hyperparameters \label{all_hyperparameter}}\\
\toprule
Experiment & Hyperparameter & Range \\
\midrule
\endhead
\multicolumn{3}{@{}l}{\itshape Chapter 5.1}\\ \addlinespace
benchmark & None & Configuration as in Chapter 3.2 \\
\midrule
\multicolumn{3}{@{}l}{\itshape Chapter 5.2}\\
\addlinespace
learning rate & learning rate & 0.00002, 0.00005, 0.0001, 0.00025 \\
\midrule
\multirow{2}{=}{basic augmentation} & aspect ratio & $1\pm0.5$ times total height and width \\
& cropping & random $333\times333$ region \\
& horizontal flip & probability of $50\%$ \\
& rotation & rotating up to $\pm 180\degree$ uniformly chosen\\
& shearing & random angle between $\pm 30\degree$ uniformly chosen \\
& scaling & ratio between $0.5-2.0$ uniformly chosen \\
\midrule
brightness shift & maximum brightness & X \\
\midrule
noise injection & mean & X \\
& variance & X \\
\midrule
patch shuffle & patch size & X \\
& probability & X \\
\midrule
\multirow{2}{=}{random erasing} & maximum range & X \\
& aspect ratio r\_2 & X \\
& probability & X \\
\midrule
\multirow{2}{=}{advanced augmentation} & patch shuffle & X \\
& scaling & X \\
& horizontal flip & X \\
& vertical flip & X \\
& brightness shift & X \\
& aspect ratio & X \\
& shearing & X \\
\midrule
\multicolumn{3}{@{}l}{\itshape Chapter 5.3}\\ \addlinespace
ablation study without augmentation & image cycle consistency loss weight & 0.1,0.2,0.5,1.0 \\
\end{xltabular}
\end{document}