Repository Public License Research preview
1% atlas-tikz-core.tex — shared visual grammar (styles) for every ATLAS IA figure.2% Stroke weights: hairline .5pt · regular .9pt · emphasis 1.4pt. Never hard-code colours in a3% figure: use the semantic names (atlasFlow, atlasValid, atlasUncertain, atlasHazard, ...).4\tikzset{5 atlas font/.style={font=\AtlasSizeLabel},6 atlas nohyphen/.style={execute at begin node={\hyphenpenalty=10000\exhyphenpenalty=10000\relax}},7 atlas small/.style={font=\AtlasSizeTiny},8 every picture/.append style={line cap=round, line join=round},9 % --- Blocks: rounded compute blocks -------------------------------------------------10 atlas block/.style={draw=atlasRule, fill=atlasPanel, text=atlasFg, line width=.9pt,11 rounded corners=2.2pt, inner xsep=5pt, inner ysep=4.5pt, align=center, atlas font, atlas nohyphen},12 atlas block flow/.style={atlas block, draw=atlasFlow},13 atlas block valid/.style={atlas block, draw=atlasValid},14 atlas block uncertain/.style={atlas block, draw=atlasUncertain},15 atlas block hazard/.style={atlas block, draw=atlasHazard},16 atlas block strong/.style={atlas block, draw=atlasFlow, line width=1.4pt},17 % --- Tokens: small chips in a stream ------------------------------------------------18 atlas token/.style={draw=atlasFlow, fill=atlasPanel, text=atlasFg, line width=.9pt,19 rounded corners=1.4pt, inner xsep=4pt, inner ysep=3.2pt, minimum height=5.6mm,20 font=\ttfamily\AtlasSizeLabel},21 atlas token ghost/.style={atlas token, draw=atlasUncertain, dash pattern=on 2.4pt off 1.8pt},22 atlas token valid/.style={atlas token, draw=atlasValid},23 % --- Arrows: information flow -------------------------------------------------------24 atlas arrow/.style={-{Stealth[length=5.2pt,width=4.6pt]}, draw=atlasFlow, line width=1.1pt,25 shorten >=1.5pt, shorten <=1.5pt},26 atlas arrow muted/.style={atlas arrow, draw=atlasMuted, line width=.9pt},27 atlas arrow valid/.style={atlas arrow, draw=atlasValid},28 atlas arrow hazard/.style={atlas arrow, draw=atlasHazard},29 atlas arrow optional/.style={atlas arrow, draw=atlasMuted, dash pattern=on 3pt off 2pt},30 atlas link/.style={draw=atlasRule, line width=.9pt},31 % --- Regions, bands and boundaries --------------------------------------------------32 atlas region/.style={draw=atlasRule, line width=.9pt, rounded corners=5pt},33 atlas band/.style={draw=atlasFlow, fill=atlasPanel, line width=.9pt, rounded corners=1.5pt},34 atlas boundary/.style={draw=atlasHazard, line width=1.4pt, dash pattern=on 5pt off 3pt},35 atlas store/.style={cylinder, shape border rotate=90, aspect=.28, draw=atlasRule,36 fill=atlasPanel, text=atlasFg, line width=.9pt, inner xsep=5pt, inner ysep=3pt,37 align=center, atlas font},38 atlas gate/.style={diamond, aspect=1.5, draw=atlasUncertain, fill=atlasPanel, text=atlasFg,39 line width=.9pt, inner sep=1.6pt, align=center, atlas font},40 % --- Text helpers -------------------------------------------------------------------41 atlas label/.style={text=atlasFg, align=center, atlas font, inner sep=1.5pt, atlas nohyphen},42 atlas note/.style={text=atlasMuted, align=left, atlas small, inner sep=1.5pt, atlas nohyphen},43 atlas heading/.style={text=atlasFg, font=\AtlasSizeSmall\bfseries, inner sep=1.5pt},44 atlas tag/.style={draw=#1, text=#1, fill=atlasBg, line width=.7pt, rounded corners=4.2pt,45 inner xsep=4.5pt, inner ysep=2pt, font=\AtlasSizeTiny\bfseries},46 atlas tag/.default=atlasFlow,47 atlas step/.style={circle, draw=#1, text=#1, fill=atlasBg, line width=.9pt, inner sep=0pt,48 minimum size=5mm, font=\AtlasSizeTiny\bfseries},49 atlas step/.default=atlasFlow,50}51% \AtlasTokenRow{<prefix>}{<coordinate>}{tok1,tok2,...}[<style of last token>]52% Lays tokens out left to right starting at <coordinate>; nodes are named <prefix>-1, <prefix>-2, ...53\NewDocumentCommand{\AtlasTokenRow}{m m m O{atlas token}}{%54 \coordinate (#1-0) at #2;55 \foreach \atlas@tok [count=\atlas@i, remember=\atlas@i as \atlas@prev (initially 0)] in {#3}{%56 \ifnum\atlas@prev=057 \node[atlas token, anchor=west] (#1-\atlas@i) at (#1-0) {\atlas@tok};58 \else59 \node[atlas token, anchor=west] (#1-\atlas@i) at ([xshift=2.2pt]#1-\atlas@prev.east) {\atlas@tok};60 \fi61 \xdef\AtlasTokenCount{\atlas@i}%62 }%63}64% \AtlasContextBand{<name>}{<south-west coordinate>}{<width>}{<height>}65% A bounded horizontal band (finite context); fill segments with \AtlasBandSegment.66\NewDocumentCommand{\AtlasContextBand}{m m m m}{%67 \path #2 coordinate (#1-sw) ++(#3,#4) coordinate (#1-ne);68 \draw[atlas band] (#1-sw) rectangle (#1-ne);69}70% \AtlasBandSegment{<band>}{<from fraction>}{<to fraction>}{<colour>}{<label>}71\NewDocumentCommand{\AtlasBandSegment}{m m m m m}{%72 \path ($(#1-sw)!#2!(#1-sw -| #1-ne)$) coordinate (atlas@a)73 ($(#1-sw |- #1-ne)!#3!(#1-ne)$) coordinate (atlas@b);74 \fill[#4, fill opacity=.28, draw=#4, line width=.7pt] (atlas@a) rectangle (atlas@b);75 \node[atlas label] at ($(atlas@a)!.5!(atlas@b)$) {#5};76}77