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.
mkbook/templates/book.tex

95 lines
1.7 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}
% better copyright symbol
\usepackage{textcomp}
% images
\usepackage{graphicx}
\makeatletter
\def\maxwidth#1{\ifdim\Gin@nat@width>#1 #1\else\Gin@nat@width\fi}
\makeatother
\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}