Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit fc3c1ed9 authored by Deepak Khatri's avatar Deepak Khatri :dog:
Browse files

Setup custom PDF generation

parent f2ba49e1
Branches
1 merge request!7My feedback
No preview for this file type
% 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}
% 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
...@@ -123,4 +123,26 @@ html_context = { ...@@ -123,4 +123,26 @@ html_context = {
"pages_url": pages_url, "pages_url": pages_url,
"pages_slug": pages_slug, "pages_slug": pages_slug,
"docs_url": docs_url, "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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment