SPB Git

Repository Public MIT Research preview

atlas-code.tex 1.8 KB 29 lines latex

1% atlas-code.tex — code and terminal listings (frames using them must be [fragile]).2%   \begin{AtlasCode}{Python}{label} ... \end{AtlasCode}3%   \begin{AtlasTerminal}{label} ... \end{AtlasTerminal}     (commands and their real output)4\lstdefinestyle{atlas}{5  basicstyle=\ttfamily\fontsize{8.6}{11.4}\selectfont\color{atlasFg},6  keywordstyle=\color{atlasFlow}\bfseries,7  commentstyle=\color{atlasMuted}\itshape,8  stringstyle=\color{atlasValid},9  columns=fullflexible, keepspaces=true, showstringspaces=false,10  breaklines=true, breakatwhitespace=true, tabsize=4, upquote=true,11  aboveskip=0pt, belowskip=0pt,12  literate={é}{{\'e}}1 {è}{{\`e}}1 {à}{{\`a}}1 {ê}{{\^e}}1 {ç}{{\c{c}}}1 {ù}{{\`u}}1 {ô}{{\^o}}113           {î}{{\^i}}1 {â}{{\^a}}1 {É}{{\'E}}1 {→}{{$\rightarrow$}}1 {…}{{...}}1,14}15% JSON has no predefined listings language: declare an empty one so that AtlasCode{JSON} works.16\lstdefinelanguage{JSON}{}17\newtcblisting{AtlasCode}[3][]{enhanced, listing only, boxrule=0pt, frame hidden, sharp corners,18  colback=atlasCodeBg, borderline west={1.1mm}{0pt}{atlasRule},19  left=4.6mm, right=3mm, top=2mm, bottom=2.2mm, boxsep=0pt, before skip=2.2mm, after skip=2.2mm,20  listing options={style=atlas, language=#2},21  before upper={{\AtlasSizeTiny\bfseries\color{atlasMuted}#2\ifblank{#3}{}{\enspace\textbullet\enspace #3}\par}\vskip 1mm},22  #1}23\newtcblisting{AtlasTerminal}[2][]{enhanced, listing only, boxrule=0pt, frame hidden, sharp corners,24  colback=atlasCodeBg, borderline west={1.1mm}{0pt}{atlasValid},25  left=4.6mm, right=3mm, top=2mm, bottom=2.2mm, boxsep=0pt, before skip=2.2mm, after skip=2.2mm,26  listing options={style=atlas, language={}},27  before upper={{\AtlasSizeTiny\bfseries\color{atlasValid}Terminal\ifblank{#2}{}{\enspace\textbullet\enspace #2}\par}\vskip 1mm},28  #1}29
Files main
Menu

Theme