ToC에서 섹션 번호 뒤의 점을 제거합니다. [패키지 없음]

ToC에서 섹션 번호 뒤의 점을 제거합니다. [패키지 없음]

나는 the를 사용하고 book class있으며 섹션 번호의 마지막 점을 제거하고 싶습니다.

1. Chapter Name
1.1. Section Name
1.1.1. Subsection Name
1.1.1.1. Subsubsection Name

나는 원해요

 1. Chapter Name
 1.1 Section Name
 1.1.1 Subsection Name
 1.1.1.1 Subsubsection Name

비슷한 게시물을 찾다가 [Babel의 스페인어를 사용하여 ToC에서 섹션 번호 뒤의 점을 어떻게 제거합니까?솔루션은 매우 훌륭하지만 여전히 문제가 있습니다. 코드를 사용할 때 es-nosectiondotToC에서 해당 장의 점이 사라지고 LoF 및 LoT도 마찬가지입니다. 즉, Figure 1( Table 1) 대신 Figure 1.( Table 1.)를 사용하므로 다음 게시물을 사용합니다. 코드는 \def\numberline#1{\hb@xt@\@tempdima{#1\if&#1&\else.\fi\hfil}}이전 문제를 해결하기 때문에 유용하지만 이제 섹션, 하위 섹션 및 하위 하위 섹션의 점이 ToC에 나타납니다. 즉,

1. Chapter Name
1.1. Section Name
1.1.1. Subsection Name
1.1.1.1. Subsubsection Name

이것은 내 MWE입니다.

\documentclass{book}

\usepackage[spanish,es-nosectiondot]{babel}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
\addto\captionsspanish{%
    \renewcommand{\tablename}%
    {Tabla}%
}

\makeatletter
 %%add prefix Figura/Tabla in LoF/LoT
 \long\def\@caption#1[#2]#3{%
  \par
  \addcontentsline{\csname ext@#1\endcsname}{#1}%
    {\protect\numberline{\csname fnum@#1\endcsname}{\ignorespaces #2}}%
  \begingroup
    \@parboxrestore
    \if@minipage
      \@setminipage
    \fi
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}
  \renewcommand*\l@figure{\@dottedtocline{1}{0em}{5em}}%
  \let\l@table\l@figure
  %%egreg's code
 \def\numberline#1{\hb@xt@\@tempdima{#1\if&#1&\else.\fi\hfil}}
\makeatother

\begin{document}

\tableofcontents
\listoffigures
\listoftables

\chapter{Chapter}
\section{Section}
\begin{table}[h]
\caption{Some table}
\centering abc
\end{table}

\begin{figure}[h]
\caption{A figure}
\centering xyz
\end{figure}
\subsection{Subsection}
\subsubsection{Subsubsection}

\end{document}

나는 원해요

ToC
1. Chapter
1.1 Section
1.1.1 Subsection
1.1.1.1 Subsubsection

LoT
Table 1.

LoF
Figure 1.

1.1 The Section
 Content
1.1.1 The Subsection
 Content
1.1.1.1 The Subsubsection
 Content

답변1

(OP의 형식 지정 목표를 더 잘 이해한 후 이 답변을 처음부터 다시 작성했습니다.

외부 LaTeX 패키지에 의존하지 않는 답변은 제공할 수 없습니다. 그러나 captiontocloft패키지는 꽤 오랜 세월이 흘렀고 디버깅이 매우 잘되었으며 book문서 클래스와 잘 작동하는 것으로 알려져 있으므로 이 두 패키지를 사용하는 것에 대해 사과하지 않겠습니다.

(a) 지침을 계속 사용하고 \usepackage[spanish,es-nosectiondot]{babel}, (b) 문서 본문의 caption레이블 구분 기호를 :("콜론")에서 (마침표)로 변경하고, (c) 패키지를 사용하여 모양을 수정하는 것이 좋습니다. LoF와 LoT의 항목입니다 . 하지만 MWE 사이 와 MWE에서 코드 청크를 버릴 수 있습니다 ..tocloftfiguretable\makeatletter\makeatother

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

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

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

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

\documentclass{book}
\usepackage[spanish,es-nosectiondot]{babel}
\addto\captionsspanish{%
   \renewcommand{\tablename}{Tabla}
   \renewcommand{\listtablename}{\'Indice de tablas} % do you need this?
}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}

%% modify the separator between caption numbers and text
\usepackage{caption}
\captionsetup{labelsep=period,skip=0.333\baselineskip}

\usepackage[titles]{tocloft}
%% modify appearance of entries in LoF and LoT
\cftsetindents{figure}{0em}{5em} % how much space to set aside
\cftsetindents{table}{0em}{5em}
\renewcommand{\cftfigpresnum}{\figurename\space} % prefix material
\renewcommand{\cftfigaftersnum}{.}               % postfix material
\renewcommand{\cfttabpresnum}{\tablename\space}
\renewcommand{\cfttabaftersnum}{.}

\begin{document}

\tableofcontents
\listoffigures
\listoftables

\chapter{Chapter}
\section{Section}
\begin{table}[h] \caption{Some table} \centering abc \end{table}
\begin{figure}[h] \caption{A figure} \centering xyz \end{figure}
\subsection{Subsection}
\subsubsection{Subsubsection}
\end{document}

답변2

이것이 당신이 원하는 것과 다른가요?

\documentclass{book}
\usepackage[spanish]{babel}

\usepackage{titlesec}
\titlelabel{\thetitle\quad}

\begin{document}

\chapter{Test}
\section{Test}
\subsection{Test}

\end{document}

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

관련 정보