mirror of https://github.com/hamaluik/mkbook
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
1.5 KiB
TeX
86 lines
1.5 KiB
TeX
\documentclass[twoside, 10pt]{book}
|
|
|
|
% booklet-sized pages
|
|
\usepackage[papersize={5.5in, 8.5in}]{geometry}
|
|
|
|
% for strike-outs
|
|
\usepackage{ulem}
|
|
|
|
% use prettier fonts
|
|
\usepackage{fontspec}
|
|
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
|
|
\setmainfont{Crimson}
|
|
\setsansfont{Poppins}
|
|
\setmonofont{Source Code Pro}
|
|
|
|
% sans-serif fonts in the headers
|
|
\usepackage{sectsty}
|
|
\allsectionsfont{\sffamily}
|
|
|
|
% syntax highlighting
|
|
\usepackage{xcolor}
|
|
\definecolor{light-grey}{gray}{0.975}
|
|
\usepackage{minted}
|
|
\usemintedstyle{vs}
|
|
|
|
% prevent page breaks
|
|
% https://tex.stackexchange.com/a/94702
|
|
\newenvironment{absolutelynopagebreak}
|
|
{\par\nobreak\vfil\penalty0\vfilneg
|
|
\vtop\bgroup}
|
|
{\par\xdef\tpd{\the\prevdepth}\egroup
|
|
\prevdepth=\tpd}
|
|
|
|
% urls
|
|
\usepackage[hidelinks]{hyperref}
|
|
|
|
% extra symbols
|
|
\usepackage{amsmath}
|
|
\usepackage{amssymb}
|
|
|
|
% better lists
|
|
\usepackage{enumitem}
|
|
|
|
\title{ {{ front.title }} }
|
|
\author{ {{ front.author }} }
|
|
\date{ {{ front.pubdate|human_date }} }
|
|
|
|
\begin{document}
|
|
\frontmatter
|
|
\pagestyle{empty}
|
|
\maketitle
|
|
\clearpage
|
|
|
|
% copyright
|
|
\pagestyle{empty}
|
|
\topskip0pt
|
|
\vspace*{\fill}
|
|
\begin{center}
|
|
\textcopyright{} {{ front.pubdate|year }} {{ front.author }}
|
|
\end{center}
|
|
\vspace*{\fill}
|
|
|
|
\tableofcontents
|
|
|
|
\chapter{Preface}
|
|
|
|
{{ description }}
|
|
|
|
\mainmatter
|
|
\pagestyle{headings}
|
|
|
|
{% for chapter in chapters %}
|
|
\chapter{ {{ chapter.front.title }} }
|
|
|
|
{{ chapter.contents }}
|
|
|
|
{% for section in chapter.sections %}
|
|
\section{ {{ section.front.title }} }
|
|
|
|
{{ section.contents }}
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
\end{document}
|