Skip to content

Commit 8b2b504

Browse files
committed
Better look and feel for PDF
1 parent 1df90d5 commit 8b2b504

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

advanced/advanced_python/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ that their use is as simple as possible.
2828

2929
.. _PEPs: https://www.python.org/dev/peps/
3030

31-
.. contents:: Chapters contents
31+
.. contents:: Chapter contents
3232
:local:
3333
:depth: 4
3434

conf.py

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def __init__(self, **options):
246246
#latex_font_size = '10pt'
247247

248248
# Latex references with page numbers (only Sphinx 1.0)
249-
latex_show_pagerefs = True
249+
latex_show_pagerefs = False
250250

251251
# Grouping the document tree into LaTeX files. List of tuples
252252
# (source start file, target name, title, author, document class [howto/manual]).
@@ -272,7 +272,7 @@ def __init__(self, **options):
272272

273273

274274
# Additional stuff for the LaTeX preamble.
275-
latex_preamble = """
275+
latex_preamble = r"""
276276
\definecolor{VerbatimColor}{rgb}{0.961, .98, 1.}
277277
\definecolor{VerbatimBorderColor}{rgb}{0.6,0.6,0.6}
278278
\setcounter{tocdepth}{1}
@@ -282,9 +282,47 @@ def __init__(self, **options):
282282
\DeclareUnicodeCharacter{2461}{\ding{183}}
283283
\DeclareUnicodeCharacter{2462}{\ding{184}}
284284
\DeclareUnicodeCharacter{2794}{\ding{229}}
285+
286+
\definecolor{Admonition}{RGB}{249,249,249}
287+
288+
\usepackage{ifthen}
289+
\usepackage{xcolor}
290+
\usepackage{fourier}
291+
292+
\makeatletter
293+
\renewenvironment{notice}[2]{%
294+
\def\thishead{}%
295+
\ifthenelse{\equal{#1}{tip}}%
296+
{\colorlet{thiscolor}{white}}%
297+
{\ifthenelse{\equal{#1}{warning}}
298+
{\colorlet{thiscolor}{red!10!white}%
299+
\def\thishead{\llap{\smash{\raisebox{-1em}{\small\danger~\,~}}}}}%
300+
{\colorlet{thiscolor}{Admonition}}%
301+
}%
302+
\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth}%
303+
\thishead%
304+
}{%
305+
\end{minipage}\end{lrbox}%
306+
\colorbox{thiscolor}{\usebox{\@tempboxa}}%
307+
}
308+
309+
\makeatother
310+
311+
\def\shadowbox#1{\rule{\linewidth}{1pt}\nopagebreak
312+
313+
\nopagebreak#1\nopagebreak
314+
315+
\nopagebreak\rule{\linewidth}{1pt}
316+
}
285317
"""
286318

287319
latex_elements = {
320+
'fontpkg': '\\usepackage{lmodern}',
321+
'fncychap': r'''%
322+
\usepackage[Sonny]{fncychap}%
323+
\ChRuleWidth{1.5pt}%
324+
\ChNumVar{\fontsize{76}{80}\sffamily\slshape}
325+
\ChTitleVar{\raggedleft\Huge\sffamily\bfseries}''',
288326
'classoptions': ',oneside,openany',
289327
'babel': '\usepackage[english]{babel}',
290328
'releasename': 'Edition',

intro/matplotlib/matplotlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Matplotlib: plotting
1212

1313
**Authors**: *Nicolas Rougier, Mike Müller, Gaël Varoquaux*
1414

15-
.. contents:: Chapters contents
15+
.. contents:: Chapter contents
1616
:local:
1717
:depth: 2
1818

0 commit comments

Comments
 (0)