Skip to content

Commit d3d14db

Browse files
author
Ron DuPlain
committed
Lift LaTex style & logo PDF from Flask docs.
These might be better placed in a repository submodule.
1 parent 30b3ded commit d3d14db

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

docs/flaskstyle.sty

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
\definecolor{TitleColor}{rgb}{0,0,0}
2+
\definecolor{InnerLinkColor}{rgb}{0,0,0}
3+
4+
\renewcommand{\maketitle}{%
5+
\begin{titlepage}%
6+
\let\footnotesize\small
7+
\let\footnoterule\relax
8+
\ifsphinxpdfoutput
9+
\begingroup
10+
% This \def is required to deal with multi-line authors; it
11+
% changes \\ to ', ' (comma-space), making it pass muster for
12+
% generating document info in the PDF file.
13+
\def\\{, }
14+
\pdfinfo{
15+
/Author (\@author)
16+
/Title (\@title)
17+
}
18+
\endgroup
19+
\fi
20+
\begin{flushright}%
21+
%\sphinxlogo%
22+
{\center
23+
\vspace*{3cm}
24+
\includegraphics{logo.pdf}
25+
\vspace{3cm}
26+
\par
27+
{\rm\Huge \@title \par}%
28+
{\em\LARGE \py@release\releaseinfo \par}
29+
{\large
30+
\@date \par
31+
\py@authoraddress \par
32+
}}%
33+
\end{flushright}%\par
34+
\@thanks
35+
\end{titlepage}%
36+
\cleardoublepage%
37+
\setcounter{footnote}{0}%
38+
\let\thanks\relax\let\maketitle\relax
39+
%\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
40+
}
41+
42+
\fancypagestyle{normal}{
43+
\fancyhf{}
44+
\fancyfoot[LE,RO]{{\thepage}}
45+
\fancyfoot[LO]{{\nouppercase{\rightmark}}}
46+
\fancyfoot[RE]{{\nouppercase{\leftmark}}}
47+
\fancyhead[LE,RO]{{ \@title, \py@release}}
48+
\renewcommand{\headrulewidth}{0.4pt}
49+
\renewcommand{\footrulewidth}{0.4pt}
50+
}
51+
52+
\fancypagestyle{plain}{
53+
\fancyhf{}
54+
\fancyfoot[LE,RO]{{\thepage}}
55+
\renewcommand{\headrulewidth}{0pt}
56+
\renewcommand{\footrulewidth}{0.4pt}
57+
}
58+
59+
\titleformat{\section}{\Large}%
60+
{\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor}
61+
\titleformat{\subsection}{\large}%
62+
{\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
63+
\titleformat{\subsubsection}{}%
64+
{\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
65+
\titleformat{\paragraph}{\large}%
66+
{\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor}
67+
68+
\ChNameVar{\raggedleft\normalsize}
69+
\ChNumVar{\raggedleft \bfseries\Large}
70+
\ChTitleVar{\raggedleft \rm\Huge}
71+
72+
\renewcommand\thepart{\@Roman\c@part}
73+
\renewcommand\part{%
74+
\pagestyle{plain}
75+
\if@noskipsec \leavevmode \fi
76+
\cleardoublepage
77+
\vspace*{6cm}%
78+
\@afterindentfalse
79+
\secdef\@part\@spart}
80+
81+
\def\@part[#1]#2{%
82+
\ifnum \c@secnumdepth >\m@ne
83+
\refstepcounter{part}%
84+
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
85+
\else
86+
\addcontentsline{toc}{part}{#1}%
87+
\fi
88+
{\parindent \z@ %\center
89+
\interlinepenalty \@M
90+
\normalfont
91+
\ifnum \c@secnumdepth >\m@ne
92+
\rm\Large \partname~\thepart
93+
\par\nobreak
94+
\fi
95+
\MakeUppercase{\rm\Huge #2}%
96+
\markboth{}{}\par}%
97+
\nobreak
98+
\vskip 8ex
99+
\@afterheading}
100+
\def\@spart#1{%
101+
{\parindent \z@ %\center
102+
\interlinepenalty \@M
103+
\normalfont
104+
\huge \bfseries #1\par}%
105+
\nobreak
106+
\vskip 3ex
107+
\@afterheading}
108+
109+
% use inconsolata font
110+
\usepackage{inconsolata}
111+
112+
% fix single quotes, for inconsolata. (does not work)
113+
%%\usepackage{textcomp}
114+
%%\begingroup
115+
%% \catcode`'=\active
116+
%% \g@addto@macro\@noligs{\let'\textsinglequote}
117+
%% \endgroup
118+
%%\endinput

docs/logo.pdf

23.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)