% ac-paper-layout.sty — Aesthetic Computer paper layout master template % Usage: \usepackage{ac-paper-layout} in each arxiv-* paper % % This package provides the shared visual identity for all AC working drafts: % - AC color palette % - YWFT Processing font commands (\acbold, \aclight) % - Draft watermark in Processing Light font % - Pals logo watermark (top-left, rotated, semi-opaque) % - Section/subsection formatting % - Header/footer (draft notice + page numbers) % - List and paragraph settings % - \ac command for "Aesthetic Computer" small caps % % Papers still define their own: % - \hypersetup{pdftitle=...} % - \graphicspath{...} % - Additional \newcommand macros (e.g. \wg, \acos) % - Extra packages (listings, multicol, etc.) % - Extra font families (ComicRelief for KidLisp, etc.) \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{ac-paper-layout}[2026/03/16 Aesthetic Computer paper layout] % === FONTS === % Requires fontspec (loaded by the document before this package) \newfontfamily\acbold{ywft-processing-bold}[ Path=../../system/public/type/webfonts/, Extension=.ttf ] \newfontfamily\aclight{ywft-processing-light}[ Path=../../system/public/type/webfonts/, Extension=.ttf ] % === COLORS (AC palette) === \definecolor{acpink}{RGB}{180,72,135} \definecolor{acpurple}{RGB}{120,80,180} \definecolor{acdark}{RGB}{64,56,74} \definecolor{acgray}{RGB}{119,119,119} \definecolor{draftcolor}{RGB}{180,72,135} % === DRAFT WATERMARK (Processing font + pals logo) === \RequirePackage{eso-pic} \RequirePackage{tikz} \usetikzlibrary{shadows.blur} \AddToShipoutPictureBG{% \begin{tikzpicture}[remember picture, overlay] % --- Pals logo stamps: mirroring bios.mjs side-stamp pattern % (drawTextAtPosition(0, 90) on the left, (canvasWidth, -90) on the right). % Both pals stamps anchored to their respective page edges, one-third of % the way down from the top. Rotated +90 / -90 so they run vertically up % each side. Sinusoidally wiggling per page, semi-opaque, drop-shadowed, % bleeding off the edge. --- \pgfmathsetmacro{\palswiggle}{7*sin(\thepage * 67)}% \node[opacity=0.10, anchor=center, rotate={90 + \palswiggle}, blur shadow={shadow blur steps=5, shadow blur extra rounding=1pt, shadow xshift=4pt, shadow yshift=-4pt, shadow opacity=0.18}] at ([xshift=-1.0cm, yshift=-0.33\paperheight]current page.north west) {\includegraphics[width=14cm]{pals}}; \node[opacity=0.10, anchor=center, rotate={-90 + \palswiggle}, blur shadow={shadow blur steps=5, shadow blur extra rounding=1pt, shadow xshift=-4pt, shadow yshift=-4pt, shadow opacity=0.18}] at ([xshift=1.0cm, yshift=-0.33\paperheight]current page.north east) {\includegraphics[width=14cm]{pals}}; % --- "WORKING DRAFT" text in Processing Light font --- \node[opacity=0.12, rotate=45, anchor=center] at (current page.center) {{\aclight\fontsize{2.5cm}{3cm}\selectfont\color{acpink} WORKING DRAFT}}; \end{tikzpicture}% } % === SECTION FORMATTING === \RequirePackage{titlesec} \titleformat{\section} {\normalfont\bfseries\normalsize\uppercase} {\thesection.} {0.5em} {} \titlespacing{\section}{0pt}{1.2em}{0.3em} \titleformat{\subsection} {\normalfont\bfseries\small} {\thesubsection} {0.5em} {} \titlespacing{\subsection}{0pt}{0.8em}{0.2em} % === HEADER/FOOTER === \RequirePackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancyhead[C]{\footnotesize\color{acpink}\textit{Working Draft --- not for citation}} \fancyfoot[C]{\footnotesize\thepage} % === LIST SETTINGS === \RequirePackage{enumitem} \setlist[itemize]{nosep, leftmargin=1.2em, itemsep=0.1em} \setlist[enumerate]{nosep, leftmargin=1.2em} % === PARAGRAPH SETTINGS === \setlength{\columnsep}{1.8em} \setlength{\parindent}{1em} \setlength{\parskip}{0.3em} % === HYPERREF COLORS === \RequirePackage{hyperref} \RequirePackage{xurl} \hypersetup{ colorlinks=true, linkcolor=acpurple, urlcolor=acpurple, citecolor=acpurple, } % === COMMON COMMANDS === \newcommand{\ac}{\textsc{Aesthetic Computer}} \newcommand{\acdot}{{\color{acpink}.}} % === BREAKABLE CODE (\code) === % \code{...} sets its argument in \ttfamily and lets long identifiers, paths, % env-var names, op:// refs, and tokens WRAP instead of overflowing the measure % (in body text and inside tabularx/p{} cells alike) — so nothing breaks the % columnar arrangement. It breaks after the separators _ / . : - @ (preferred, % zero cost) and, only when a separator break would still overflow, between any % two characters (last resort, high penalty) so even a separator-less blob % wraps. The argument is re-tokenized wholesale (\scantokens) under active % separators rather than scanned token-by-token, so \char-based content % survives, e.g. \code{\char`\~/.hermes/config.yaml} keeps its ~, and \#, \$ % escapes render as usual. Gate any paper with tools/check-columns.mjs. \newcommand{\codebreak}{\discretionary{}{}{}} % zero-cost break at separators \newcommand{\codesoftbreak}{\penalty9999\relax} % last-resort break in long runs \begingroup \catcode`\_=12 \catcode`\/=12 \catcode`\.=12 \catcode`\:=12 \catcode`\-=12 \catcode`\@=12 \gdef\codeUS{_}\gdef\codeSL{/}\gdef\codeDT{.}% \gdef\codeCL{:}\gdef\codeDS{-}\gdef\codeAT{@}% \endgroup \begingroup \catcode`\_=\active \catcode`\/=\active \catcode`\.=\active \catcode`\:=\active \catcode`\-=\active \catcode`\@=\active \gdef\codeActivate{% \def_{\codeUS\codebreak}\def/{\codeSL\codebreak}\def.{\codeDT\codebreak}% \def:{\codeCL\codebreak}\def-{\codeDS\codebreak}\def@{\codeAT\codebreak}% \def\_{\codeUS\codebreak}}% underscores usually arrive as the \_ macro \endgroup \newcommand{\code}[1]{% \begingroup \ttfamily \catcode`\_=\active \catcode`\/=\active \catcode`\.=\active \catcode`\:=\active \catcode`\-=\active \catcode`\@=\active \codeActivate \ifdefined\XeTeXinterchartokenstate \XeTeXinterchartokenstate=1 \XeTeXinterchartoks 0 0 = {\codesoftbreak}% \fi \endlinechar=-1 \everyeof{}% \scantokens{#1}% \endgroup} \endinput