
Ich habe den folgenden Hauptcode verwendet:
\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}
in einer anderen Datei table.tex (zum Testen):
\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}
Ergebnisse sind: Tabelle 1 - Titel Tabelle 10 - Titel es ist wie die neue Ziffer nimmt aus dem Leerzeichen nach -
Mir ist auch aufgefallen, dass der Abstand zwischen der römischen Zahl und dem Kapitelnamen nicht einheitlich ist:
I-Titel III-Titel
Antwort1
Was der OP als Inkonsistenz der Abstände im Inhaltsverzeichnis und im Tabellenverzeichnis bezeichnet, halten andere für völlig normal. Sofern Ihre Universität oder Ihr Arbeitgeber keine Änderung verlangt, würde ich das Standardlayoutschema von LaTeX verwenden.
Ich möchte Ihnen außerdem vorschlagen, einige eher barocke Programmiergewohnheiten zu rationalisieren. Der folgende Code enthält einige Vorschläge, wie der Präambelcode rationalisiert werden könnte.
\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}