diff --git a/_static/images/logo-latex.pdf b/_static/images/logo-latex.pdf index deaa2699d6de4ab582af1ae276ca36d8f341cca0..5491dbf79bebb11b097c750078a4402941b6a9b8 100644 Binary files a/_static/images/logo-latex.pdf and b/_static/images/logo-latex.pdf differ diff --git a/_static/latex/preamble.tex b/_static/latex/preamble.tex new file mode 100644 index 0000000000000000000000000000000000000000..e13368a5c75605a23fd88423ca902350431ef83f --- /dev/null +++ b/_static/latex/preamble.tex @@ -0,0 +1,25 @@ +% LaTeX documentation preamble +% +% Copyright (c) 2021 Nordic Semiconductor ASA +% SPDX-License-Identifier: Apache-2.0 + +\usepackage[some]{background} +\usepackage{sectsty} +\usepackage{lscape} +\usepackage{longtable} +\usepackage{fontspec} +\usepackage{comment} +\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} +\setmainfont{DejaVuSans} +\setmonofont{FreeMono} + +\definecolor{bg-color}{HTML}{a97f2c} + +\setcounter{tocdepth}{2} + +\addto\captionsenglish{\renewcommand{\contentsname}{Table of contents}} + +\allsectionsfont{\color{bg-color}} + +\let\oldtabular\tabular +\renewcommand{\tabular}{\footnotesize\oldtabular} diff --git a/_static/latex/title.tex b/_static/latex/title.tex new file mode 100644 index 0000000000000000000000000000000000000000..b6b842995a9102e42dc92a41022a841b82d8d76d --- /dev/null +++ b/_static/latex/title.tex @@ -0,0 +1,43 @@ +% LaTeX documentation title page +% +% Copyright (c) 2021 Nordic Semiconductor ASA +% SPDX-License-Identifier: Apache-2.0 + +\makeatletter +\newgeometry{top=3cm,left=0cm,right=0cm,bottom=2.5cm} + +\backgroundsetup{ + scale=1, + contents={\sphinxlogo}, + opacity=0.7, + angle=0, + position={0.40\textwidth,-0.60\textheight} +} + +\BgThispage + +\begin{minipage}{2cm} + \color{bg-color} \rule{2cm}{1.7cm} +\end{minipage} +\hspace{0.2cm} +\begin{minipage}{2cm} + \sphinxlogo +\end{minipage} +\hspace{0.2cm} +\begin{minipage}{14cm} + \color{bg-color} \Large \textbf{\@title} +\end{minipage} + +\vspace{21cm} + +\begin{flushright} + \begin{minipage}{4cm} + \large \@author\\\@date + \end{minipage} + \begin{minipage}{1.5cm} + \color{bg-color} \rule{1.5cm}{1.3cm} + \end{minipage} +\end{flushright} + +\restoregeometry +\makeatother diff --git a/conf.py b/conf.py index 3c883c227b5a9bde263c349db0bfb16dd4c6a868..21b5c31b39f9cd491f4721aa2fabb533f498b0f9 100644 --- a/conf.py +++ b/conf.py @@ -123,4 +123,26 @@ html_context = { "pages_url": pages_url, "pages_slug": pages_slug, "docs_url": docs_url, -} \ No newline at end of file +} + +# -- Options for proposal PDF generation -- +latex_elements = { + "papersize": "a4paper", + "maketitle": open("_static/latex/title.tex").read(), + "preamble": open("_static/latex/preamble.tex").read(), + "sphinxsetup": ",".join( + ( + "verbatimwithframe=false", + "VerbatimColor={HTML}{f0f2f4}", + "InnerLinkColor={HTML}{2980b9}", + "warningBgColor={HTML}{e9a499}", + "warningborder=0pt", + r"HeaderFamily=\rmfamily\bfseries", + ) + ), +} +latex_engine = "xelatex" +latex_logo = str("_static/images/logo-latex.pdf") +latex_documents = [ + ("proposals/template", "template.tex", "Project proposal template 2024", "John Doe", "manual"), +] \ No newline at end of file