![如何制作以下章节标题样式](https://linux22.com/image/446545/%E5%A6%82%E4%BD%95%E5%88%B6%E4%BD%9C%E4%BB%A5%E4%B8%8B%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98%E6%A0%B7%E5%BC%8F.png)
答案1
titlesec
这是一种使用和tikz
(用于章节名称周围的垂直规则)来实现此目的的方法。
也许有人有更好的主意。
\documentclass{book}
\usepackage[explicit,calcwidth]{titlesec}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\renewcommand{\chaptername}{Kapitola}
\titlespacing{\chapter}{4cm}{-18pt}{10ex}[4cm]
\titlespacing{\section}{0cm}{0pt}{0ex}
\titleformat{\chapter}[display]{\filcenter\LARGE\bfseries}{\itshape\chaptertitlename\ \Roman{chapter}}{8ex}{\large\MakeUppercase{#1}%
\begin{tikzpicture}[remember picture,overlay]
% Left Rule
\coordinate (L1) at ([xshift=3.5cm]current page text area.north west);
\coordinate (L2) at ([yshift=-3pt]0,0);
\draw [line width=.8pt] (L1) -- ($(L1)!(L2)!(L1)$);
% Right Rule
\coordinate (R1) at ([xshift=-3.5cm]current page text area.north east);
\coordinate (R2) at ([yshift=-3pt]0,0);
\draw [line width=.8pt] (R1) -- ($(R1)!(R2)!(R1)$);
%% Auxiliaries Rules
% \draw (L1) -- (R1)
% \draw (R1) |- (R2);
% \draw (L1) |- (L2);
\end{tikzpicture}
}
\titleformat{\section}[display]{\filcenter}{\large\bfseries § \arabic{section}}{1ex}{\addtolength{\titlewidth}{-12ex}\titleline*[c]{\titlerule[.8pt]}\vspace{1ex}\itshape #1}
\begin{document}
\setcounter{chapter}{5}% Next chapter: 6
\chapter{Besselova Rovnice}
\section{Besselovy funkce l. druhu}
\end{document}
我认为只想调整字母类型。