Inconsistência no índice, tabela com um dígito tem espaço diferente em comparação com dois dígitos

Inconsistência no índice, tabela com um dígito tem espaço diferente em comparação com dois dígitos

Usei o seguinte código principal:

      \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}

em outro arquivo table.tex (para teste):

\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}

    

os resultados são: tabela 1 - título tabela 10 -título é como se o novo dígito tirasse do espaço depois -

Notei também que o espaço entre o número romano e o nome do capítulo é inconsistente:
I- Título III-Título

Responder1

O que o OP parece chamar de inconsistência de espaçamento no índice e na lista de tabelas, outros tendem a ver como totalmente normal. A menos que sua universidade ou empregador exija que você faça uma alteração, eu usaria o esquema de layout padrão do LaTeX.

Eu também gostaria de sugerir que você simplificasse alguns hábitos de programação de estilo bastante barroco. O código abaixo fornece algumas sugestões sobre como o código do preâmbulo pode ser simplificado.

insira a descrição da imagem aqui


insira a descrição da imagem aqui


\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}

informação relacionada