목차의 불일치, 한 자리로 된 표는 두 자리로 된 표와 공간이 다릅니다.

목차의 불일치, 한 자리로 된 표는 두 자리로 된 표와 공간이 다릅니다.

다음 주요 코드를 사용했습니다.

      \documentclass{report}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PACKAGES %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{arabtex}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\graphicspath{ {images/} }
%\usepackage[a4paper, width = 150mm, top = 25mm, bottom = 25mm, bindingoffset = 4mm]{geometry}
\usepackage[a4paper,margin=2.5cm, left=4cm, top=2.5cm, right=2.5cm, bottom=2.5cm]{geometry}

\usepackage{sectsty}
\usepackage{titlesec}

\titleformat{\chapter}[display]
{\vspace{0cm}\filcenter}
{\filcenter \LARGE\bfseries
\chaptertitlename\ \justwords{\thechapter}}
{0ex}
{\vspace*{0ex}\filcenter\Huge\bfseries}
\def\justwords#1{\ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
\titlespacing*{\chapter}{0pt}{-30pt}{10pt}

\usepackage[titles]{tocloft}

\usepackage{hyperref}
\usepackage{tocloft}



%%%%%%%%%%%%%

% Define a command for capital Roman numerals
\newcommand{\RomanNumeral}[1]{\uppercase\expandafter{\romannumeral#1\relax}}

% Redefine the chapter format for the table of contents
\renewcommand{\cftchapaftersnum}{-} % add a dot after the chapter number in TOC
\renewcommand{\cftchapleader}{\cftdotfill{ \cftdotsep}} % add dots to the page number
\renewcommand{\cftchappresnum}{\RomanNumeral} % use capital Roman numerals for chapter numbers




%%%%%%%%%%%%%%%%%%%%%%%%%%


\usepackage{caption}
\usepackage{chngcntr}

\counterwithout{figure}{chapter}

% Adjust table numbering to be independent of chapters
\counterwithout{table}{chapter}

\usepackage{etoolbox}
\usepackage{setspace}\setstretch{2}
\usepackage[labelfont=bf]{caption}
\usepackage{enumitem}
\usepackage{pdfpages}
%\usepackage{caption}
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{\alph{subfigure})}



%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PRELIMINARY PAGES %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}


\thispagestyle{empty}

\pagebreak

\thispagestyle{empty}
\begin{center}
\vspace*{\fill}
\textcopyright\ 2023\\
 
All Rights Reserved \\
\end{center}

\pagenumbering{roman}\setcounter{page}{1}

\pagebreak

\chapter*{ACKNOWLEDGEMENTS}
\addcontentsline{toc}{chapter}{ACKNOWLEDGEMENTS}


\pagebreak
\begin{center}
\LARGE{} \vspace{1cm}
\Large{} \vspace{0cm}

\end{center}
\vspace{-\baselineskip}
\begingroup
{\let\clearpage\relax \chapter*{ABSTRACT}}
\addcontentsline{toc}{chapter}{ABSTRACT}
\endgroup

\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TABLE OF CONTENT %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%


\addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
\renewcommand*\contentsname{TABLE OF CONTENTS}
\renewcommand*\listtablename{TABLE OF CONTENTS}

\tableofcontents

\newpage
\addcontentsline{toc}{chapter}{LIST OF TABLES}
\renewcommand*\listtablename{LIST OF TABLES}
\listoftables
\newpage

\addcontentsline{toc}{chapter}{LIST OF FIGURES}
\renewcommand*\listfigurename{LIST OF FIGURES}

\listoffigures
\newpage


\pagenumbering{arabic}\setcounter{page}{1}
 \renewcommand{\chaptername}{CHAPTER}

\chapter{INTRODUCTION}\label{chapter:intro}

\chapter{RELATED WORK}\label{chapter:lit_review}


\chapter{PROPOSED APPROACH}\label{chapter:algorithm}
\input{table}


\end{document}

다른 파일 table.tex(테스트용):

\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}

\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
\begin{table}
    \centering
    \begin{tabular}{cc}
         & \\
         & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}

    

결과는 다음과 같습니다: 표 1 - 제목 표 10 -제목은 다음 공백에서 가져오는 새 숫자와 같습니다.

또한 로마 숫자와 장 이름 사이의 공백이 일치하지 않는 것도 확인했습니다.
I- Title III-Title

답변1

OP가 목차와 표 목록의 간격 불일치라고 부르는 것처럼 보이는 것은 다른 사람들이 완전히 정상적인 것으로 보는 경향이 있습니다. 귀하의 대학이나 고용주가 변경을 요구하지 않는 한 저는 LaTeX 기본 레이아웃 구성표를 사용하겠습니다.

또한 바로크 스타일의 프로그래밍 습관을 간소화할 것을 제안하고 싶습니다. 아래 코드는 프리앰블 코드를 간소화하는 방법에 대한 몇 가지 제안을 제공합니다.

여기에 이미지 설명을 입력하세요


여기에 이미지 설명을 입력하세요


\documentclass{report}

% Create a scratch file "on the fly":
\begin{filecontents}[overwrite]{tables.tex}
\begin{table}[h] \caption{Caption a} \label{tab:my_label1} \end{table}
\begin{table}[h] \caption{Caption b} \label{tab:my_label2} \end{table}
\begin{table}[h] \caption{Caption c} \label{tab:my_label3} \end{table}
\begin{table}[h] \caption{Caption d} \label{tab:my_label4} \end{table}
\begin{table}[h] \caption{Caption e} \label{tab:my_label5} \end{table}
\begin{table}[h] \caption{Caption f} \label{tab:my_label6} \end{table}
\begin{table}[h] \caption{Caption g} \label{tab:my_label7} \end{table}
\begin{table}[h] \caption{Caption h} \label{tab:my_label8} \end{table}
\begin{table}[h] \caption{Caption i} \label{tab:my_label9} \end{table}
\begin{table}[h] \caption{Caption j} \label{tab:my_label10} \end{table}
\begin{table}[h] \caption{Caption k} \label{tab:my_label11} \end{table}
\begin{table}[h] \caption{Caption l} \label{tab:my_label12} \end{table}
\end{filecontents}

\usepackage{arabtex}
%\usepackage[utf8]{inputenc} % that's the default nowadays
%\usepackage[T1]{fontenc}

\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage[a4paper, left=4cm, right=2.5cm, vmargin=2.5cm]{geometry}

\usepackage{titlesec}
\titleformat{\chapter}[display]%
   {\vspace{0cm}\filcenter}
   {\filcenter\LARGE\bfseries
   \chaptertitlename\ \justwords{\value{chapter}}}
   {0ex}
   {\vspace*{0ex}\filcenter\Huge\bfseries}
\def\justwords#1{\ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
\titlespacing*{\chapter}{0pt}{-30pt}{10pt}

\usepackage[titles]{tocloft}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} 
\cftsetindents{chap}{0em}{2.5em}
\cftsetindents{table}{0em}{2em}

\usepackage[colorlinks,allcolors=blue,linktocpage]{hyperref}

\renewcommand\thechapter{\Roman{chapter}}
\renewcommand{\chaptername}{CHAPTER}

\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}

\usepackage{setspace}
\setstretch{2}
\usepackage{enumitem}
\usepackage{pdfpages}

\usepackage[labelfont=bf]{caption}
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{\alph{subfigure})}



\begin{document}

\thispagestyle{empty}
\pagebreak

\thispagestyle{empty}
\begin{center}
\vspace*{\fill}
\textcopyright\ 2023
 
All Rights Reserved 
\end{center}
\pagebreak

\pagenumbering{roman}

\chapter*{ACKNOWLEDGEMENTS}
\addcontentsline{toc}{chapter}{ACKNOWLEDGEMENTS}
\pagebreak

\begin{center}
\LARGE{} \vspace{1cm}
\Large{} \vspace{0cm}
\end{center}
\vspace{-\baselineskip}
\begingroup
{\let\clearpage\relax \chapter*{ABSTRACT}}
\addcontentsline{toc}{chapter}{ABSTRACT}
\endgroup
\newpage

\addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
\renewcommand*\contentsname{TABLE OF CONTENTS}
\tableofcontents
\newpage

\addcontentsline{toc}{chapter}{LIST OF TABLES}
\renewcommand*\listtablename{LIST OF TABLES}
\listoftables
\newpage

\addcontentsline{toc}{chapter}{LIST OF FIGURES}
\renewcommand*\listfigurename{LIST OF FIGURES}
\listoffigures
\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagenumbering{arabic}

\chapter{INTRODUCTION}\label{chapter:intro}

\chapter{RELATED WORK}\label{chapter:lit_review}

\chapter{PROPOSED APPROACH}\label{chapter:algorithm}
\input tables % load contents of 'tables.tex'

\end{document}

관련 정보