mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-07 18:18:42 -05:00
Brings the TinyTorch lab guide's Quarto project in line with
book/quarto/, the only other in-tree Quarto publication that builds
both web and PDF outputs from a single source. The previous name had
three redundancies:
- already under tinytorch/, so "site-" prefix wasn't disambiguating
- also produces the PDF lab guide, so "site-" was misleading
- the top-level site/ dir made "site-quarto" read as "the site's
quarto config" rather than "the tinytorch site, in quarto"
After this rename the convention is straightforward:
book/quarto/ -> the textbook (web + PDF)
tinytorch/quarto/ -> the TinyTorch lab guide (web + PDF)
mlsysim/docs/ -> mlsysim API reference (kept as docs/, since it
really is API reference, not a publication)
Touches 7 GitHub workflows, both .gitignore files, the rename target's
own self-references (Makefile, _quarto.yml configs, STYLE.md,
measure-pdf-images.py), and 6 copies of subscribe-modal.js plus a few
shared scripts/configs whose comments documented the old path.
Verified: rebuilt pdf/TinyTorch-Guide.pdf (2.1M) cleanly from the new
location with 'make pdf' from tinytorch/quarto/.
174 lines
8.0 KiB
TeX
174 lines
8.0 KiB
TeX
% =============================================================================
|
||
% TinyTorch Lab Guide — custom PDF title page
|
||
% =============================================================================
|
||
% Overrides Quarto's default `title.tex` partial so the book opens with the
|
||
% full TikZ cover: asymmetric neural-net decorations (dense 8-node clusters
|
||
% top-left + bottom-right, sparse 4-node clusters on the other corners,
|
||
% scattered edge pathways linked by diagonal connections), then logo /
|
||
% tagline / title / author / MLSysBook badge, and a draft indicator on the
|
||
% back of the titlepage.
|
||
%
|
||
% Direct port of the legacy jupyter-book cover at
|
||
% tinytorch/site-legacy/_config_pdf.yml (lines 234–380). The only
|
||
% substantive changes:
|
||
% • Logo path re-rooted from Sphinx's LaTeX build dir
|
||
% (`../../_static/logos/logo-tinytorch.png`) to this book project's
|
||
% asset tree (`../assets/images/logos/logo-tinytorch.png`).
|
||
% • Draft date changed from a hardcoded string to `\today` so the PDF
|
||
% reports each build's actual date.
|
||
%
|
||
% Requires preamble packages `tikz` (with calc, positioning,
|
||
% decorations.pathmorphing libraries) and `tcolorbox`, plus the brand
|
||
% palette (torchnavy, flameorange, flamered, bodygray) — all loaded via
|
||
% `include-in-header.text` in this project's `_quarto.yml`.
|
||
% =============================================================================
|
||
|
||
\begin{titlepage}
|
||
|
||
% ── Neural network border decorations ─────────────────────────────────────
|
||
% Asymmetric diagonal flow: visual weight concentrated top-left and
|
||
% bottom-right with sparse ballast on the other two corners. Faint edge
|
||
% pathways tie the clusters together so the decoration reads as a network,
|
||
% not four disconnected blobs.
|
||
\begin{tikzpicture}[remember picture, overlay]
|
||
\tikzset{
|
||
neuron/.style={circle, fill=flameorange!30, draw=flameorange!60, minimum size=6pt, inner sep=0pt},
|
||
neuron-small/.style={circle, fill=torchnavy!20, draw=torchnavy!40, minimum size=4pt, inner sep=0pt},
|
||
neuron-tiny/.style={circle, fill=torchnavy!12, draw=torchnavy!25, minimum size=3pt, inner sep=0pt},
|
||
neuron-accent/.style={circle, fill=flameorange!50, draw=flameorange, minimum size=8pt, inner sep=0pt},
|
||
neuron-large/.style={circle, fill=flameorange!40, draw=flameorange!70, minimum size=10pt, inner sep=0pt},
|
||
connection/.style={draw=torchnavy!15, line width=0.4pt},
|
||
connection-accent/.style={draw=flameorange!25, line width=0.5pt}
|
||
}
|
||
|
||
% TOP-LEFT: dense primary cluster (8 nodes) — main visual anchor
|
||
\node[neuron-large] (tl1) at ($(current page.north west)+(2.0cm,-2.0cm)$) {};
|
||
\node[neuron-accent] (tl2) at ($(tl1)+(0.7cm,-0.2cm)$) {};
|
||
\node[neuron] (tl3) at ($(tl1)+(0.4cm,-0.8cm)$) {};
|
||
\node[neuron] (tl4) at ($(tl1)+(1.2cm,-0.6cm)$) {};
|
||
\node[neuron-small] (tl5) at ($(tl1)+(0.5cm, 0.5cm)$) {};
|
||
\node[neuron-small] (tl6) at ($(tl1)+(1.5cm,-0.1cm)$) {};
|
||
\node[neuron-small] (tl7) at ($(tl1)+(1.0cm,-1.2cm)$) {};
|
||
\node[neuron-tiny] (tl8) at ($(tl1)+(1.8cm,-0.8cm)$) {};
|
||
\draw[connection-accent] (tl1) -- (tl2);
|
||
\draw[connection-accent] (tl1) -- (tl3);
|
||
\draw[connection] (tl2) -- (tl4);
|
||
\draw[connection] (tl3) -- (tl4);
|
||
\draw[connection] (tl1) -- (tl5);
|
||
\draw[connection] (tl2) -- (tl6);
|
||
\draw[connection] (tl4) -- (tl7);
|
||
\draw[connection] (tl6) -- (tl8);
|
||
\draw[connection] (tl4) -- (tl8);
|
||
|
||
% TOP-RIGHT: sparse cluster (4 nodes) — light counterweight
|
||
\node[neuron] (tr1) at ($(current page.north east)+(-1.6cm,-1.5cm)$) {};
|
||
\node[neuron-small] (tr2) at ($(tr1)+(-0.5cm,-0.4cm)$) {};
|
||
\node[neuron-tiny] (tr3) at ($(tr1)+(-0.9cm,-0.2cm)$) {};
|
||
\node[neuron-tiny] (tr4) at ($(tr1)+(-0.3cm,-0.9cm)$) {};
|
||
\draw[connection] (tr1) -- (tr2);
|
||
\draw[connection] (tr2) -- (tr3);
|
||
\draw[connection] (tr1) -- (tr4);
|
||
|
||
% BOTTOM-LEFT: sparse cluster (4 nodes) — mirrors top-right
|
||
\node[neuron] (bl1) at ($(current page.south west)+(1.5cm,1.6cm)$) {};
|
||
\node[neuron-small] (bl2) at ($(bl1)+(0.5cm,0.4cm)$) {};
|
||
\node[neuron-tiny] (bl3) at ($(bl1)+(0.9cm,0.1cm)$) {};
|
||
\node[neuron-tiny] (bl4) at ($(bl1)+(0.2cm,0.9cm)$) {};
|
||
\draw[connection] (bl1) -- (bl2);
|
||
\draw[connection] (bl2) -- (bl3);
|
||
\draw[connection] (bl1) -- (bl4);
|
||
|
||
% BOTTOM-RIGHT: dense secondary cluster (8 nodes) — diagonal balance
|
||
\node[neuron-large] (br1) at ($(current page.south east)+(-2.0cm, 2.0cm)$) {};
|
||
\node[neuron-accent] (br2) at ($(br1)+(-0.7cm, 0.2cm)$) {};
|
||
\node[neuron] (br3) at ($(br1)+(-0.4cm, 0.8cm)$) {};
|
||
\node[neuron] (br4) at ($(br1)+(-1.2cm, 0.6cm)$) {};
|
||
\node[neuron-small] (br5) at ($(br1)+(-0.5cm,-0.5cm)$) {};
|
||
\node[neuron-small] (br6) at ($(br1)+(-1.5cm, 0.1cm)$) {};
|
||
\node[neuron-small] (br7) at ($(br1)+(-1.0cm, 1.2cm)$) {};
|
||
\node[neuron-tiny] (br8) at ($(br1)+(-1.8cm, 0.8cm)$) {};
|
||
\draw[connection-accent] (br1) -- (br2);
|
||
\draw[connection-accent] (br1) -- (br3);
|
||
\draw[connection] (br2) -- (br4);
|
||
\draw[connection] (br3) -- (br4);
|
||
\draw[connection] (br1) -- (br5);
|
||
\draw[connection] (br2) -- (br6);
|
||
\draw[connection] (br4) -- (br7);
|
||
\draw[connection] (br6) -- (br8);
|
||
\draw[connection] (br4) -- (br8);
|
||
|
||
% Left edge: scattered pathway nodes (organic placement)
|
||
\node[neuron-small] (le1) at ($(current page.west)+(0.9cm, 4.5cm)$) {};
|
||
\node[neuron-tiny] (le2) at ($(current page.west)+(1.2cm, 2.8cm)$) {};
|
||
\node[neuron-tiny] (le3) at ($(current page.west)+(0.7cm, 0.5cm)$) {};
|
||
\node[neuron-small] (le4) at ($(current page.west)+(1.0cm,-1.5cm)$) {};
|
||
\draw[connection] (le1) -- (le2);
|
||
\draw[connection] (le3) -- (le4);
|
||
|
||
% Right edge: scattered pathway nodes (organic placement)
|
||
\node[neuron-tiny] (re1) at ($(current page.east)+(-0.8cm, 2.0cm)$) {};
|
||
\node[neuron-small] (re2) at ($(current page.east)+(-1.1cm,-0.5cm)$) {};
|
||
\node[neuron-tiny] (re3) at ($(current page.east)+(-0.9cm,-3.0cm)$) {};
|
||
\draw[connection] (re1) -- (re2);
|
||
|
||
% Diagonal flow — top-left to bottom-right emphasis
|
||
\draw[connection] (tl7) to[out=-45, in= 135] (le2);
|
||
\draw[connection] (tl8) to[out=-30, in= 160] (re1);
|
||
\draw[connection] (br7) to[out=135, in= -45] (re2);
|
||
\draw[connection] (br8) to[out=150, in= -20] (le4);
|
||
\end{tikzpicture}
|
||
|
||
\centering
|
||
\vspace*{0.6cm}
|
||
|
||
% ── TinyTorch logo ────────────────────────────────────────────────────────
|
||
\includegraphics[width=\textwidth]{../assets/images/logos/logo-tinytorch.png}
|
||
\vspace{5pt}
|
||
|
||
% ── Tagline — `import torch` set in the mono family so it reads as code
|
||
{\fontsize{16}{20}\selectfont\color{flameorange}%
|
||
Don't just \texttt{import torch}. Build it.\par}
|
||
\vspace{14pt}
|
||
|
||
% ── Main title — the visual anchor
|
||
{\fontsize{26}{30}\selectfont\bfseries\color{torchnavy}%
|
||
Build Your Own ML Framework\par}
|
||
|
||
\vspace{24pt}
|
||
|
||
% ── Author block — tight cluster, no affiliation separator
|
||
{\Large\color{torchnavy}\textbf{Prof. Vijay Janapa Reddi}\par}
|
||
\vspace{3pt}
|
||
{\large\color{bodygray}Harvard University\par}
|
||
|
||
\vspace{70pt}
|
||
|
||
% ── MLSysBook badge — light airy footer, anchors the PDF to its parent
|
||
\begin{tcolorbox}[
|
||
colback=bodygray!4,
|
||
colframe=bodygray!4,
|
||
boxrule=0pt,
|
||
arc=6pt,
|
||
width=0.58\textwidth,
|
||
halign=center,
|
||
left=24pt,
|
||
right=24pt,
|
||
top=14pt,
|
||
bottom=16pt
|
||
]
|
||
{\fontsize{9}{11}\selectfont\color{torchnavy}\textit{From Tensors to Systems}\par}
|
||
\vspace{8pt}
|
||
{\fontsize{7}{9}\selectfont\color{bodygray!60}A Build-It-Yourself Companion to the\par}
|
||
\vspace{8pt}
|
||
{\fontsize{8.5}{11}\selectfont\color{torchnavy}\textbf{Machine Learning Systems} textbook\par}
|
||
\vspace{6pt}
|
||
{\fontsize{7}{9}\selectfont\color{flameorange}\textit{\href{https://mlsysbook.ai}{mlsysbook.ai}}\par}
|
||
\end{tcolorbox}
|
||
|
||
% ── Back of the titlepage — draft-edition marker (kept minimal) ──────────
|
||
\clearpage
|
||
{\fontsize{8}{10}\selectfont\color{bodygray!40}\textit{Draft Edition --- Last updated: \today}\par}
|
||
\vspace{0.6cm}
|
||
|
||
\end{titlepage}
|