Skip to content

Commit d85f59b

Browse files
committed
latexpdf: add page styling
JIRA: CI-526
1 parent 3f9cb0c commit d85f59b

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

_static/images/small_logo.png

8.48 KB
Loading

_static/latex/preamble.tex

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@
2525
% Make chapters start on new pages
2626
\newcommand{\sectionbreak}{\clearpage}
2727

28+
\fancypagestyle{toc}{
29+
\fancyhf{}
30+
\fancyfoot[R]{%
31+
\begin{tikzpicture}
32+
\node[circle, fill=ps-orange, text=white, minimum size=20pt, inner sep=0pt, font=\bfseries] {\thepage};
33+
\end{tikzpicture}%
34+
}
35+
}
36+
37+
\fancypagestyle{normal}[toc]{
38+
\fancyhead[R]{\includegraphics[width=2.5cm]{small_logo.png}}
39+
}
40+
41+
% Apply the style to all pages
42+
\pagestyle{normal}
43+
2844
% Override Sphinx verbatim settings
2945
\fvset{
3046
frame=none,

conf.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,23 @@
7575

7676
latex_additional_files = [
7777
"_static/images/pdf-titlepage.png",
78-
"_static/images/pdf-lastpage.png"
78+
"_static/images/pdf-lastpage.png",
79+
"_static/images/small_logo.png"
7980
]
8081

8182
latex_elements = {
8283
'makeindex': r'',
8384
'papersize': r'a4paper',
8485
'babel': r'\usepackage[english]{babel}',
86+
'tableofcontents': r'''
87+
\makeatletter
88+
\begingroup
89+
\pagestyle{toc}
90+
\@starttoc{toc}
91+
\clearpage
92+
\endgroup
93+
\makeatother
94+
''',
8595
'extrapackages': r'''
8696
\usepackage{tocloft}
8797
\usepackage{graphicx}
@@ -91,6 +101,9 @@
91101
\usepackage{listings}
92102
\usepackage[absolute]{textpos}
93103
\usepackage{fontspec}
104+
\usepackage{fancyhdr}
105+
\usepackage{tikz}
106+
\usepackage{fancyvrb}
94107
''',
95108
'preamble': Path("_static/latex/preamble.tex").read_text(),
96109
'maketitle': r'''

0 commit comments

Comments
 (0)