% arara: pdflatex: {shell: yes}
% arara: bibtex
% arara: pdflatex: {shell: yes}
% arara: pdflatex: {shell: yes}
% arara: pdflatex: {shell: yes}
\documentclass[10pt]{article}
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% See .
\usepackage[left=4.5cm,right=2.5cm,showframe=false,
top=2cm,bottom=1.5cm,marginparsep=2cm]{geometry} % page setup
\usepackage{lmodern}
\usepackage{parskip} % paragraph skips
\usepackage{booktabs} % beautiful tables
\usepackage{listings} % nice verbatim environments
\usepackage{titlesec} % customize headings
\usepackage{titletoc} % customize headings
\usepackage{multicol}
\usepackage{changepage} % adjust width of page
\usepackage{fancyhdr} % headers & footers
\usepackage{wrapfig}
\usepackage{fontawesome}
\usepackage[sc,format=hang,font=small]{caption} % captions
\usepackage[backend=bibtex]{biblatex} % bibliography
\usepackage{tcolorbox} % framed environments
\usepackage{tikz}
\usepackage{xparse}
\usepackage[charter]{mathdesign} % changes font
\usepackage[expansion=false,kerning=true]{microtype} % better kerning
\usepackage{enumitem} % custom lists
\usepackage{longtable}
\usepackage{array}
\usepackage{totalcount}
\usepackage{standalone}
% setup gitinfo2, as in the manual, details just above begin{document}
\usepackage[mark,grumpy]{gitinfo2}
% tikz, tcolorbox libraries
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations,shapes}
\usepackage{varioref} % the documentation library from tcolorbox loads hyperref
\tcbuselibrary{breakable,minted,xparse,documentation,hooks,raster}
\hypersetup{
pdfauthor={Chris Hughes},
pdftitle={latexindent.pl package},
pdfkeywords={perl;beautify;indentation},
bookmarksnumbered,
bookmarksopen,
linktocpage,
colorlinks=true,
linkcolor=blue,
citecolor=black,
}
\usepackage{cleveref}
% create my own star style, for re-use at various points
\tikzset{cmhstar/.style={star,star point ratio=2.25,fill=cmhgold,draw=orange,}}
% shortcut command for displaying star in documentation
\newcommand{\stardemo}[1][]{\begin{tikzpicture}
\node at (10:.1cm)[very thin,cmhstar,scale=0.25,rotate=20,#1]{};
\node at (120:.1cm)[very thin,cmhstar,scale=0.15,rotate=-10,#1]{};
\node at (235:.1cm)[very thin,cmhstar,scale=0.2,rotate=-20,#1]{};
\end{tikzpicture}}
% totalcount
\DeclareTotalCounter{lstlisting}
% customise the \tcbdocnew command
\tcbset{doclang/new={{\bfseries\color{green!50!black}N\normalfont\color{black}}}}
\tcbset{doclang/updated={{\bfseries\color{green!50!black}U\normalfont\color{black}}}}
\tcbset{doc marginnote={width=1.6cm}}
\NewDocumentCommand{\announce}{ s m s m }{%
\IfBooleanTF{#1}%
{% \announce*
\tcbdocmarginnote[overlay={\node at ([yshift=0mm,xshift=1mm]frame.north east) {\stardemo}; }]{%
\IfBooleanTF{#3}%
{% \announce*{date}*[text] means *updated* as of
\tcbdocupdated{#2}%
}%
{% \announce*{date}[text] means *new* as of
\tcbdocnew{#2}%
}%
}%
\IfBooleanTF{#3}%
{%
\addcontentsline{new}{cmhtitle}{#4 (U)}%
}%
{%
\addcontentsline{new}{cmhtitle}{#4 (N)}%
}%
}%
{% \announce
\tcbdocmarginnote{%
\IfBooleanTF{#3}%
{% \announce{date}*[text] means *updated* as of
\tcbdocupdated{#2}%
}%
{% \announce{date}[text] means *new* as of
\tcbdocnew{#2}%
}%
}%
}}
\reversemarginpar
% bibliographies
\addbibresource{latex-indent}
\addbibresource{contributors}
% http://tex.stackexchange.com/questions/122135/how-to-add-a-png-icon-on-the-right-side-of-a-tcolorbox-title
\newtcolorbox{warning}{parbox=false,breakable,enhanced,arc=0mm,colback=red!5,colframe=red,leftrule=12mm,%
overlay={\node[anchor=north west,outer sep=2pt] at (frame.north west) {\includegraphics[width=8mm]{warning}}; }
}
\definecolor{harvestgold}{cmyk}{0.00, 0.05, 0.51, 0.07} %EDE275
\definecolor{cmhgold}{cmyk}{0,0.178,0.909,0.008} %FDD017
\colorlet{cmhgray}{gray!30!white}
\makeatletter
\tcbset{
addtolol/.style={list entry={\kvtcb@title},add to list={lol}{lstlisting}},
addtololstar/.style={list entry={\kvtcb@title},add to list={lol}{lstlistingstar}},
cmhlistings/.style={
% width=\linewidth,
%breakable,
colback=blue!5!white,
colframe=white!25!black,colback=white,
top=0cm,
bottom=0cm,
left=0mm,
listing only,
center title,
listing engine=minted,
minted style=colorful,
minted options={obeytabs=true,showtabs=true,tabsize=4,showspaces=true},
boxrule=0pt,
toprule=1pt,bottomrule=1pt,
titlerule=1pt,
colframe=white!40!black,
colback=white,
sharp corners,
colbacktitle=white!75!black
},
yaml-TCB/.style={
listing only,
listing engine=listings,
left=0cm,
boxrule=0pt,
sharp corners,
center title,
colbacktitle=white!75!blue,
colframe=white!25!blue,
colback=white!90!blue,
toprule=2pt,
titlerule=2pt,
},
MLB-TCB/.style={
yaml-TCB,
center title,
colframe=cmhgold,
colbacktitle=harvestgold,
colback=white!60!cmhgold,
width=0.9\linewidth,
before=\centering,
enhanced,
overlay={\node[anchor=north east,outer sep=2pt,draw=cmhgold,very thick,double,fill=harvestgold,font =\small] at ([yshift=-3mm]frame.north east) {\texttt{-m}}; }
},
replace-TCB/.style={
yaml-TCB,
center title,
colbacktitle=white!75!green,
colframe=white!25!green,
colback=white!90!green,
width=0.9\linewidth,
before=\centering,
enhanced,
overlay={\node[anchor=north east,outer sep=2pt,draw=white!25!green,very thick,circle,fill=white!75!green,font =\small] at ([yshift=-3mm]frame.north east) {\texttt{-r}}; }
},
yaml-obsolete/.style={
listing only,
listing engine=listings,
left=0cm,
boxrule=0pt,
sharp corners,
center title,
toprule=2pt,
titlerule=2pt,
colframe=white!25!red,
colbacktitle=white!75!red,
colback=white!90!red,
},
new-to-this-version/.style={
enhanced,
overlay app={\node at ([yshift=0mm,xshift=0mm]frame.north east) {\stardemo[scale=1.2]}; },
addtololstar,
},
}
\DeclareTCBListing[use counter=lstlisting]{cmhlistings}{s O{} m m}{%
cmhlistings,
IfBooleanTF={#1}{new-to-this-version}{addtolol},
center title,
title={\color{black}{\scshape Listing \thetcbcounter}: ~#3},label={#4},
listing engine=listings,
listing options={#2},
}
\DeclareDocumentEnvironment{cmhtcbraster}{O{}}{\begin{tcbraster}[
new-to-this-version/.style={
enhanced,
overlay app={\node[anchor=south east] at ([yshift=-3mm,xshift=3mm]frame.north east) {\stardemo[scale=1.2]}; },
addtololstar,
},
raster valign=top,raster columns=2,#1]}{\end{tcbraster}}
% \cmhlistingsfromfile
% * no star: not new, star: new
% [ listing/minted options ]
% * no star: uses minted library, star: uses listings library star:
% {}
% []
% {}
% {