diff --git a/latex/lectures/preamble.tex b/latex/lectures/preamble.tex index 95ec7a6..18b9cff 100644 --- a/latex/lectures/preamble.tex +++ b/latex/lectures/preamble.tex @@ -30,8 +30,14 @@ \usepackage[skins]{tcolorbox} +% inline highlighting of code \newcommand{\hilightchar}[1]{\colorbox{yellow!75}{\makebox[0pt]{\strut{#1}}}} -\newcommand{\hilight}[1]{\colorbox{yellow!75}{#1}} +\newcommand{\hilight}[1]{\hspace{-1\fboxsep}\colorbox{yellow!75}{#1}} + +% uses the same spacing as \hilight, but does no highlighting. Use on the +% original code when using incremental highlighting. +\newcommand{\nohilight}[1]{\hspace{-1\fboxsep}{\fboxrule0pt\fbox{#1}}} + \newcommand{\error}[1]{\colorbox{red!75}{#1}} \tcbset{enhanced,boxsep=0pt,top=6pt,bottom=6pt,left=8pt,right=0pt,drop fuzzy shadow} @@ -167,6 +173,16 @@ \vspace{-0.75\baselineskip} } +% command for figures that fit the page width +\newcommand{\fittedfig}[1] { + \begin{figure}[H] + \begin{center} + \resizebox{\textwidth}{!}{\includegraphics[draft=false]{#1}} + \vspace{-25pt} + \end{center} + \end{figure} +} + % suppress section numbers \setcounter{secnumdepth}{-2}