
次のメインコードを使用しました:
\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-
タイトルIII-タイトル
答え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}