Skip to content

Commit cd07328

Browse files
committed
latexpdf: change codeblock style
JIRA: CI-526
1 parent cac7bbe commit cd07328

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

_static/latex/preamble.tex

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
%
2+
% Phoenix-RTOS
3+
%
4+
% Copyright 2025 Phoenix Systems
5+
% Author: Adam Debek
6+
%
7+
% This file is part of Phoenix-RTOS.
8+
%
9+
% %LICENSE%
10+
11+
\addtolength{\cftsubsecnumwidth}{5pt}
12+
\setcounter{secnumdepth}{3}
13+
\definecolor{ps-orange}{HTML}{ea5b22}
14+
\addto\captionsenglish{\renewcommand{\contentsname}{\textcolor{ps-orange}{Table of contents}}}
15+
16+
% Override Sphinx verbatim settings
17+
\fvset{
18+
frame=none,
19+
numbers=none,
20+
fontfamily=ttfamily,
21+
baselinestretch=1.2
22+
}
23+
% Sphinx-specific settings
24+
\sphinxsetup{
25+
VerbatimColor={rgb}{0.97,0.97,0.97},
26+
VerbatimBorderColor={rgb}{0.97,0.97,0.97},
27+
verbatimwithframe=false,
28+
verbatimsep=8pt,
29+
verbatimborder=0pt
30+
}
31+
32+
% Additional frame removal
33+
\renewenvironment{Verbatim}{%
34+
\setlength{\fboxsep}{0pt}%
35+
\setlength{\fboxrule}{0pt}%
36+
\begin{flushleft}%
37+
}{%
38+
\end{flushleft}%
39+
}

conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Configuration file for the Sphinx documentation builder.
22

33
from version_management import get_version_context
4+
from pathlib import Path
45

56
project = ""
67
copyright = "2024, Phoenix Systems"
@@ -82,13 +83,11 @@
8283
\usepackage{tocloft}
8384
\usepackage{graphicx}
8485
\usepackage{xcolor}
86+
\usepackage{fancyvrb}
87+
\usepackage{framed}
88+
\usepackage{listings}
8589
''',
86-
'preamble': r'''
87-
\addtolength{\cftsubsecnumwidth}{5pt}
88-
\setcounter{secnumdepth}{3}
89-
\definecolor{ps-orange}{HTML}{ea5b22}
90-
\addto\captionsenglish{\renewcommand{\contentsname}{\textcolor{ps-orange}{Table of contents}}}
91-
''',
90+
'preamble': Path("_static/latex/preamble.tex").read_text(),
9291
'maketitle': r'''
9392
\newgeometry{margin=0pt}
9493
\thispagestyle{empty}

0 commit comments

Comments
 (0)