標題中的額外點

標題中的額外點

我嘗試直接處理標題、內容表和章節名稱中的段落的點/符號。

章節、目錄、小節、章節名稱一切都很完美。

但我在偶數頁的頁首中發現了一個額外的點。截圖在這裡。太糟糕了。

我已經盡力了……但現在我想請求你的幫助。請刪除這個點而不改變其他東西。

   %document information
    \documentclass[10pt,a4paper]{book}

% packages
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}

\usepackage{titlesec}
\titleformat{\section}
  {\normalfont\Large\bfseries}{\thesection}{1em}{}

\renewcommand{\thesection}{\textsection\arabic{section}.}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead [CE] {\nouppercase{\slshape \large \rightmark}}
\fancyhead [CO] {\nouppercase{\slshape \large \leftmark}}

\begin{document}
\tableofcontents

\chapter{eh eh}
\section{omg}

\chapter{oh no}
\section{lmao}
\end{document}

在此輸入影像描述

答案1

替換在你的序言中

\titleformat{\section}
  {\normalfont\Large\bfseries}{\textsection\thesection}{1em}{}

\renewcommand{\thesection}{\arabic{section}.}

\titleformat{\section}
{\normalfont\Large\bfseries}{²textsection\thesection.}{1em}{}

您的最後一個命令的結果是,對部分的交叉引用將在部分編號後面加上一個點。

**新增:*

這是包含目錄解決方案的程式碼

\documentclass[10pt,a4paper]{book}
\usepackage[showframe]{geometry}
% packages
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}

\usepackage{titlesec, titletoc}

\titleformat{\section}
  {\normalfont\Large\bfseries}{\thesection.}{1em}{}
\renewcommand{\thesection}{\textsection\arabic{section}}
\titlecontents{section}[2.7em]{\addvspace{0.5ex}}%
 {\contentslabel[\thecontentslabel.]{1.25em}\hskip0.8em}%numbered
 {}%numberless%
 {\enspace\titlerule*[0.7pc]{.}\contentspage}%

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead [CE] {\nouppercase{\slshape \large \rightmark}}
\fancyhead [CO] {\nouppercase{\slshape \large \leftmark}}

\begin{document}

\tableofcontents

\chapter{eh eh}
\section{omg}

\chapter{oh no}
\section{lmao}

\end{document} 

在此輸入影像描述

相關內容