% asy_tut.sty
%  Asymptote tutorial LaTeX style file for use by LaTeX files.
%
% 2024-Mar-12 JH Init.

% \usepackage[utf8]{inputenc}
% \usepackage[osf,scaled=.92,loosest]{heuristica}
% \usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
% \usepackage[T1]{fontenc}
% \renewcommand*\oldstylenums[1]{\textosf{#1}}

\AtBeginDocument{\let\widering\relax} % Get rid of Command \widering already defined.  Something to do with mf logo packages
\usepackage{fourier}
\usepackage[T1]{fontenc}

% Get MetaFont logo
\usepackage{mflogo}
\usepackage{metalogox}

\usepackage{../asy_sty/colors}

\usepackage{mathtools}
\usepackage{microtype}

% urls and path names
\usepackage[obeyspaces]{url}
% \DeclareUrlCommand\path{\urlstyle{tt}}

% Paper layout
\usepackage[letterpaper,
    top=1in, bottom=1in, textwidth=426pt,
    includehead, ignorefoot]{geometry}

% Page headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{\thepage}
\fancyhead[C]{}
\fancyhead[R]{\textbf{The performance of new graduates}}
\fancyfoot[L,C,R]{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\fancyhead{} % clear all header fields
\fancyhead[RO,LE]{\textit{Page \thepage}}
\fancyhead[RE,LO]{\textit{\nouppercase\leftmark}}
\fancyfoot{} % clear all footer fields
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.0pt}

% Between chapters, if there is an even page then make it empty
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
 \clearpage
 {\pagestyle{empty}\origdoublepage}%
}
\let\cleardoublepage\clearemptydoublepage

% Display of titles, including chapters and section headers
\usepackage{titlesec}
% General command
% \titleformat{⟨command ⟩}[⟨shape⟩]{⟨format⟩}{⟨label ⟩}{⟨sep⟩}{⟨before-code⟩}[⟨after-code⟩]
% \titlespacing*{⟨command ⟩}{⟨left⟩}{⟨before-sep⟩}{⟨after-sep⟩}[⟨right-sep⟩]
\titleformat{\chapter}[hang]{\LARGE\bfseries\color{bold_color}}{Chapter \thechapter:}{0.5em}{}
\titleformat{\section}[runin]{\bfseries\color{bold_color}}{}{0em}{}
% \titleformat{\subsection}[runin]{}{}{0.5em}{}

\titlespacing*{\chapter}
 {0pt}{-11ex plus .1ex minus .2ex}{3.5ex minus .1ex}

\assignpagestyle{\chapter}{empty}


% Use Minted for the source code listings
\usepackage{minted}
% Bug in minted gives weird spacing in using bgcolor
%   https://github.com/gpoore/minted/issues/220
% \usepackage{etoolbox}
% \AtBeginEnvironment{snugshade*}{\par\vspace{-\FrameSep}}
% \AfterEndEnvironment{snugshade*}{\par\vspace{-\FrameSep}}
% \BeforeBeginEnvironment{minted}{\par\vspace{-\baselineskip}}
% \AfterEndEnvironment{minted}{\par\vspace{-\baselineskip}}
\setminted[Asymptote]{linenos=true,
 % bgcolor=bgcolor,
 frame=leftline,
 fontsize=\footnotesize,
 stepnumber=5,stepnumberoffsetvalues=true, % number lines multiple of five
}
\setmintedinline[Asymptote]{
 fontsize=\small,
}
\setminted[TeX]{linenos=true,
 % bgcolor=bgcolor,
 frame=leftline,
 fontsize=\footnotesize,
 stepnumber=5,stepnumberoffsetvalues=true, % number lines multiple of five
}
\setmintedinline[TeX]{
 fontsize=\small,
}
\setminted[Bash]{% bgcolor=bgcolor,
 frame=leftline,
 fontsize=\footnotesize}
\setmintedinline[Bash]{
 fontsize=\small,
}
\setminted[Python]{% bgcolor=bgcolor,
 frame=leftline,
 fontsize=\footnotesize}
\setmintedinline[Python]{
 fontsize=\small,
}


% You are often advised to put hyperref last, or almost last
\usepackage[hidelinks,pdfa]{hyperref}
\hypersetup{
   bookmarks=false,         % show bookmarks bar?
   unicode=false,          % non-Latin characters in Acrobat’s bookmarks
   pdftoolbar=True,        % show Acrobat’s toolbar?
   pdfmenubar=True,        % show Acrobat’s menu?
   pdffitwindow=false,     % window fit to page when opened
   pdfstartview={FitH},    % fits the width of the page to the window
   pdftitle={First Impressions of Asymptote},    % title
   pdfauthor={Jim Hefferon},     % author
   pdfsubject={Asymptote},   % subject of the document
   pdfcreator={pdflatex},   % creator of the document
   pdfproducer={pdflatex}, % producer of the document
   pdfkeywords={Asymptote, mathematics, graphics}, % list of keywords
   pdfnewwindow=false,      % links in new PDF window
   colorlinks=true,       % false: boxed links; true: colored links
   linkcolor=name_color,          % color of internal links (change box color with linkbordercolor)
   citecolor=name_color,        % color of links to bibliography
   filecolor=name_color,         % color of file links
   urlcolor=name_color        % color of external links
}


% =============== Macros ===================
\newcommand{\Asy}{\textit{Asymptote}}

% ---------------------------------
% Vertically center graphics
% ex: \vcenteredhbox{\usegraphics{mygraph.png}}
% From http://tex.stackexchange.com/questions/7219/how-to-vertically-center-two-images
\newcommand*{\vcenteredhbox}[1]{\begingroup
\setbox0=\hbox{#1}\parbox{\wd0}{\box0}\endgroup}