Skip to content

Commit 927cb3c

Browse files
committed
latexpdf: add section styling
JIRA: CI-526
1 parent d85f59b commit 927cb3c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

_static/latex/preamble.tex

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@
2222
\titleformat{\paragraph}{\bfseries\color{darkblue}}{\theparagraph}{1em}{}
2323
\titleformat{\subparagraph}{\bfseries\color{darkblue}}{\thesubparagraph}{1em}{}
2424

25+
% Section title styling
26+
\makeatletter
27+
\def\@makesectionhead#1{%
28+
{\parindent \z@
29+
\interlinepenalty\@M
30+
\noindent\textcolor{orange}{\rule{\textwidth}{2pt}}
31+
\par\vspace{0.5em}
32+
{\bfseries\Large\itshape#1}
33+
\noindent\textcolor{orange}{\rule{\textwidth}{2pt}}
34+
}}
35+
\renewcommand{\section}{\@startsection{section}{1}{\z@}%
36+
{-3.5ex \@plus -1ex \@minus -.2ex}%
37+
{2.3ex \@plus.2ex}%
38+
{\@makesectionhead}}
39+
\makeatother
40+
% Add dot to the section title only
41+
\renewcommand{\thesection}{\arabic{section}.\hspace{-0.5em}}
42+
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
43+
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}
44+
2545
% Make chapters start on new pages
2646
\newcommand{\sectionbreak}{\clearpage}
2747

0 commit comments

Comments
 (0)