Skip to content

Commit

Permalink
USe poptitle add logo, compile with lualatex
Browse files Browse the repository at this point in the history
  • Loading branch information
JDBetteridge committed Jan 19, 2023
1 parent 02bb0ae commit bff7461
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 10 deletions.
105 changes: 105 additions & 0 deletions docs/source/_static/poptitle.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{poptitle}[2023/01/18 Firedrake manual title page.]

\RequirePackage{fontspec}
\setsansfont{TeX Gyre Heros}
\RequirePackage[british]{babel}
\RequirePackage[utf8]{inputenc}
\RequirePackage[absolute]{textpos}
\RequirePackage{xcolor}
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\RequirePackage[
type={CC},
modifier={by},
version={4.0},
]{doclicense}
\RequirePackage{fmtcount}
\RequirePackage{hyperref}
\RequirePackage{titling}

\newcommand{\editions}{}
\newcommand{\edition}[1]{\listadd{\editions}{#1}}
\makeatletter
\providecommand\subtitle[1]{\renewcommand\thesubtitle{#1}}
\newcommand\thesubtitle{\@latex@error{No \noexpand\subtitle given}\@ehc}
\makeatother

\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{0mm}{0mm}


\definecolor{imperialblue}{cmyk}{1,.61,0,.45}

\newcommand{\poptitlepages}{
\clearpage
\thispagestyle{empty}
\newcounter{edcnt}
\setcounter{edcnt}{0}
\renewcommand*{\do}[1]{\stepcounter{edcnt}
\ifdefined\thisedition
\renewcommand{\thisedition}{\Ordinalstring{edcnt} edition}
\else
\newcommand{\thisedition}{}
\fi
}
\dolistloop{\editions}

% \begin{textblock}{70}(17.5,17.5)
% \noindent\includegraphics[width=70mm]{imperial.pdf}
% \end{textblock}
% \begin{textblock}{210}(0,279)
% \noindent\rule{210mm}{.5mm}
% \end{textblock}
% \begin{textblock}{30}(190,-5)
% {\color{imperialblue}
% \noindent\rule[-5mm]{21mm}{300mm}}
% \end{textblock}
% \begin{textblock}{210}(17.5,284.5)
% {\sffamily\fontsize{25}{30}\selectfont
% \noindent Course Notes in Mathematics}
% \end{textblock}
% \begin{textblock}{30}(185,284.5)
% {\sffamily\fontsize{25}{30}\selectfont\centering\color{white}\bfseries
% \thevolcnt

% }
% %\rule{15mm,297mm}
%\end{textblock}
\begin{textblock}{154}(17.5,74.25)
\setlength{\parskip}{2ex}
{\sffamily\fontsize{25}{30}\selectfont\noindent\thetitle}

{\sffamily\fontsize{17}{20}\selectfont\noindent\thesubtitle
\vspace{\parskip}

\noindent\Large\theauthor
\vspace{7\parskip}

\noindent{\itshape\thisedition}}
\end{textblock}

\mbox{}
\pagebreak

\begin{textblock}{146}[0,1](17.5,230.5)
{
%\hypersetup{urlcolor=imperialblue}
\sffamily\fontsize{12}{14}\selectfont
\setcounter{edcnt}{0}
\renewcommand*{\do}[1]{\stepcounter{edcnt}\noindent\Ordinalstring{edcnt} edition: ##1
\vspace{1ex}

}
\dolistloop{\editions}
\vspace{2ex}
\noindent\copyright\ \theauthor
\doclicenseThis
}
\end{textblock}
\mbox{}
\setcounter{page}{0}
\thispagestyle{empty}
\clearpage
}
43 changes: 33 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,45 +186,67 @@

# -- Options for LaTeX output --------------------------------------------

latex_engine = 'lualatex'

latex_additional_files = [
'_static/poptitle.sty'
]

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4paper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

'babel': r'\usepackage[british]{babel}',

# Additional stuff for the LaTeX preamble.
'preamble': r'''\newcommand{\require}[1]{}
\usepackage{cancel}
%\sphinxDUC{2730}{\ding{80}}
\sphinxDUC{27F6}{$\rightarrow$}
\sphinxDUC{2208}{$\in$}
\sphinxDUC{2200}{$\forall$}
\sphinxDUC{2218}{$\circ$}
\sphinxDUC{22C5}{$\cdot$}
\sphinxDUC{25A3}{$\boxdot$}
%\sphinxDUC{27F6}{$\rightarrow$}
%\sphinxDUC{2208}{$\in$}
%\sphinxDUC{2200}{$\forall$}
%\sphinxDUC{2218}{$\circ$}
%\sphinxDUC{22C5}{$\cdot$}
%\sphinxDUC{25A3}{$\boxdot$}
% Sphinx equivalent of
% \DeclareUnicodeCharacter{}{}
% The default sphinx colouring colours a lot of links that are actually dead in
% the book version.
\definecolor{internallinkcolor}{HTML}{c52b03}
\definecolor{externallinkcolor}{HTML}{e55d05}
%\hypersetup{linkcolor=internallinkcolor}
\hypersetup{linkcolor=black}
%\hypersetup{urlcolor=externallinkcolor}
\hypersetup{urlcolor=black}
\usepackage{poptitle}
\subtitle{}
\edition{2023}
''',

'extrapackages': r'''\usepackage{mathtools}'''
'extrapackages': r'''\usepackage{mathtools}''',

'maketitle' : r'\poptitlepages'
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Firedrake.tex', u'Firedrake Documentation',
('index', 'Firedrake.tex', u'User Manual',
u'the Firedrake team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
latex_logo = '_themes/firedrake/static/banner.png'

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
latex_use_parts = True

# If true, show page references after internal links.
#latex_show_pagerefs = False
Expand All @@ -237,6 +259,7 @@

# If false, no module index is generated.
#latex_domain_indices = True
latex_docclass = {"manual": "book"}


# -- Options for manual page output --------------------------------------
Expand Down

0 comments on commit bff7461

Please sign in to comment.