% docs/book/preamble.tex -- what both books share: the packages, the fonts, % what pandoc's fragments expect, the glyphs, the running heads, and meta.tex % (the commit, the date, the version). Input by main.tex (the book) and % fabric.tex (the Book of Fabric, #138). \usepackage{amsmath,amssymb} \usepackage{fontspec} % fonts-dejavu-core has no serif/sans italics (fonts-dejavu-extra does); when a % shape is missing, slant the upright one rather than silently drop emphasis. \setmainfont{DejaVu Serif}[AutoFakeSlant=0.2] \setsansfont{DejaVu Sans}[AutoFakeSlant=0.2] \setmonofont{DejaVu Sans Mono}[Scale=0.85] \newfontfamily\symbolfont{DejaVu Sans} \usepackage[letterpaper,margin=1in]{geometry} \usepackage{xcolor} \usepackage{graphicx} \usepackage{longtable,booktabs,array,calc,multirow} \usepackage{fancyvrb} \usepackage[normalem]{ulem} \usepackage{enumitem} \usepackage{newunicodechar} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \usepackage[hidelinks]{hyperref} \usepackage{bookmark} % --- what pandoc's LaTeX fragments expect (normally from its own template) \providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \providecommand{\pandocbounded}[1]{#1} \providecommand{\st}[1]{\sout{#1}} \newcounter{none} % pandoc: {\def\LTcaptype{none} ...} marks unnumbered tables \usepackage{etoolbox} \makeatletter \def\fnum@table{\tablename~\thetable} \patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{} \makeatother \usepackage{fvextra} \input{pandoc-highlighting} % Code and diagrams are wider than the page in places: wrap, never overflow. \RecustomVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\},breaklines,breakanywhere,fontsize=\small} \RecustomVerbatimEnvironment{verbatim}{Verbatim}{breaklines,breakanywhere,fontsize=\small} \setlistdepth{9} \renewlist{itemize}{itemize}{9} \setlist[itemize]{label=\textbullet} \renewlist{enumerate}{enumerate}{9} \setlist[enumerate]{label=\arabic*.} % Running heads: chapter on the left page, section on the right, both cut to % the page width (several design-record titles are a full sentence long). \usepackage{fancyhdr} \usepackage[fit]{truncate} \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\sectionmark}[1]{\markright{#1}} \fancyhead[LE]{\small\truncate{\dimexpr\headwidth-3em}{\leftmark}} \fancyhead[RO]{\small\truncate{\dimexpr\headwidth-3em}{\rightmark}} \fancyhead[RE,LO]{\small\thepage} \renewcommand{\headrulewidth}{0.4pt} \setlength{\headheight}{14pt} \fancypagestyle{plain}{\fancyhf{}\fancyfoot[C]{\small\thepage}\renewcommand{\headrulewidth}{0pt}} \setlength{\emergencystretch}{3em} \setlength{\parindent}{0pt} \setlength{\parskip}{0.5em} % --- glyphs DejaVu Serif lacks: the status marks used across the docs \newunicodechar{✅}{{\symbolfont ✔}} \newunicodechar{✓}{{\symbolfont ✓}} \newunicodechar{❌}{{\symbolfont ✘}} \newunicodechar{✗}{{\symbolfont ✗}} \newunicodechar{⬜}{{\symbolfont ☐}} \newunicodechar{⭐}{{\symbolfont ★}} \newunicodechar{🔶}{{\symbolfont ◆}} \newunicodechar{⚠}{{\symbolfont ⚠}} \newunicodechar{📋}{} \newunicodechar{🐛}{[bug]} \newunicodechar{🎯}{[goal]} \newunicodechar{🟡}{{\symbolfont ●}} \newunicodechar{📍}{{\symbolfont ▸}} \newunicodechar{🔓}{[unlocked]} \newunicodechar{❓}{?} \newunicodechar{⟺}{\ensuremath{\Longleftrightarrow}} \newunicodechar{⋯}{\ensuremath{\cdots}} \newunicodechar{^^^^fe0f}{} % --- the documents number their own sections (§III.1, D-3, ...) \setcounter{secnumdepth}{0} \setcounter{tocdepth}{1} \input{meta} % \datasource{path/to/data.csv}: cite the data behind a figure or table. % Every figure or table of measured numbers reads its CSV at build time % (\addplot table / \pgfplotstabletypeset) and is followed by this line, so % the reader can find the exact file at the exact commit. \newcommand{\datasource}[1]{% \par{\small Data: \texttt{\detokenize{#1}} at commit \texttt{\bookcommit}.}\par}