
ヘッダー、目次、セクション名内の段落のドット/記号を直接処理しようとしました。
章、目次、サブセクション、セクション名などすべてが完璧です。
しかし、偶数ページのヘッダーに余分なドットがあるのを見つけました。スクリーンショットはこちらです。ひどいですね。
最善を尽くしました...しかし、今はあなたの助けを求めたいです。他のものを変更せずに、この点を削除してください。
%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}