![在 extarticle 类中设计标题(使用 babel)](https://linux22.com/image/451489/%E5%9C%A8%20extarticle%20%E7%B1%BB%E4%B8%AD%E8%AE%BE%E8%AE%A1%E6%A0%87%E9%A2%98%EF%BC%88%E4%BD%BF%E7%94%A8%20babel%EF%BC%89.png)
我用:
\documentclass[14pt]{extarticle}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ukrainian]{babel}
\begin{document}
\tableofcontents
\newpage
\section*{The name of one of the section without numbering}\addcontentsline{toc}{section}{The name of one of the section without numbering}
\section{Long title of one of the section in several lines in Ukrainian with numbering in the table of contents}
\subsection{Subsection name}
\subsubsection{Subsubsection name}
\end{document}
并得到:
第一页:
第二页:
我想:
对于第一页:
1.a)将目录标题居中;
1.b) 在章节(小节和小小节)编号后添加一个点。
对于第二页:
2.a) 删除第二部分的编号,但保留其用于链接和公式编号;
2.b) 将第二部分的页眉居中;
2.c) 对没有编号的章节标题进行手动换行;
2.d) 在小节和小节编号后添加一个点;
获得类似的结果(对于第二页):
答案1
这应该可以满足您的所有要求。对于节标题中的手动换行符,您需要编写在目录中输入的可选节标题,并在将在文档中输入的强制参数中放置一些手动换行符。
\documentclass[14pt]{extarticle}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ukrainian]{babel}
\usepackage{etoolbox}
\patchcmd{\tableofcontents}{\contentsname}{\centering\contentsname}{}{}
\makeatletter
\patchcmd{\@sect}{\csname the#1\endcsname}{\csname the#1\endcsname.}{}{}
\def\@seccntformat#1{\csname the#1\endcsname.\quad}
\patchcmd{\@sect}{#6}{\ifstrequal{#1}{section}{\centering#6}{#6}}{}{}
\patchcmd{\@sect}{\@hangfrom{\hskip #3\relax\@svsec}}{\@hangfrom{\hskip #3\relax\ifstrequal{#1}{section}{Розділ~\thesection}{\@svsec}}\ifstrequal{#1}{section}{\par\nopagebreak}{}}{}{}
\makeatother
\begin{document}
\tableofcontents
\newpage
\section*{The name of one of the section without numbering}\addcontentsline{toc}{section}{The name of one of the section without numbering}
\section[Long title of one of the section in several lines in Ukrainian with numbering in the table of contents]{Long title of one\\ of the\\ section in several lines in Ukrainian with numbering in the table of contents}
\subsection{Subsection name}
\subsubsection{Subsubsection name}
\section{Long title of one of the section in several lines in Ukrainian with numbering in the table of contents}
\subsection{Subsection name}
\subsubsection{Subsubsection name}
\end{document}