2017-05-23 09:01:04 +00:00
|
|
|
% Usage: \pic[<pct-of-columnwidth>]{<path-to-file>}
|
|
|
|
\newcommand{\pic}[2][50]{
|
|
|
|
\begin{center}
|
|
|
|
\transparent{0.4}
|
|
|
|
\includegraphics[width=0.#1\columnwidth]{#2}
|
|
|
|
\end{center}
|
|
|
|
}
|
|
|
|
|
|
|
|
% Usage: \fig{<path-to-file>}{<label>}{<caption>}
|
2017-05-30 15:59:54 +00:00
|
|
|
\newcommand{\fig}[3]{
|
2017-05-24 17:10:55 +00:00
|
|
|
\begin{figure}[h!]
|
2017-05-23 09:01:04 +00:00
|
|
|
\centering
|
|
|
|
\includegraphics[width=0.95\columnwidth]{#1}
|
|
|
|
\caption{#3}
|
|
|
|
\label{fig:#2}
|
|
|
|
\end{figure}
|
|
|
|
}
|
|
|
|
|
2017-06-01 12:52:30 +00:00
|
|
|
\newcommand{\xkcd}[2]{\fig{xkcd/#1}{#1}{#2\\%
|
|
|
|
{\tiny\MakeUppercase{https://imgs.xkcd.com/comics/#1.png}}}}
|
|
|
|
|
2017-05-23 09:01:04 +00:00
|
|
|
% Usage: \svg{<path-to-file>}{<label>}{<caption>}
|
|
|
|
\newcommand{\svg}[3]{
|
|
|
|
\begin{figure}[h]
|
|
|
|
\centering
|
|
|
|
\includesvg{#1}
|
|
|
|
\caption{#3}
|
|
|
|
\label{fig:#2}
|
|
|
|
\end{figure}
|
|
|
|
}
|
|
|
|
|
|
|
|
\newcommand{\notice}[2]{%
|
|
|
|
\shadowbox{%
|
|
|
|
\begin{varwidth}{0.85\linewidth}
|
|
|
|
\texttt{\textbf{#1}}\\
|
|
|
|
#2
|
|
|
|
\end{varwidth}
|
|
|
|
}
|
|
|
|
}
|
2017-05-24 22:37:49 +00:00
|
|
|
|
|
|
|
\newcommand{\cliline}[2][]{\lstinline[columns=fixed,#1]{#2}}
|
|
|
|
|
|
|
|
\newcommand{\utccurrenttime}[0]{%
|
2017-05-30 13:03:30 +00:00
|
|
|
\today%
|
|
|
|
T%
|
|
|
|
\DTMcurrenttime%
|
|
|
|
\DTMfetchTZhour{now}%
|
|
|
|
:%
|
|
|
|
\DTMfetchTZminute{now}
|
|
|
|
}
|
|
|
|
|
|
|
|
\newcommand{\itemtitle}[2]{\textbf{#1:}\\%
|
2017-05-30 19:50:54 +00:00
|
|
|
{\footnotesize #2}}
|
|
|
|
|
|
|
|
|
2017-06-01 12:52:30 +00:00
|
|
|
\newcommand{\myquote}[2]{%
|
|
|
|
\sbox0{#1}%
|
|
|
|
\ifdim\wd0=0pt
|
|
|
|
{\epigraph{#2}{\textit{{\tiny \theauthor}}}} %if #1 is empty
|
|
|
|
\else
|
|
|
|
{\epigraph{#2}{\textit{#1}}} %if quote is cited
|
|
|
|
\fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-05-30 19:50:54 +00:00
|
|
|
% Enviroment @var txt
|
|
|
|
% changes code styling to: in frame, white bg.
|
2017-05-30 20:25:51 +00:00
|
|
|
\lstnewenvironment{txt}{\lstset{style=plaintxt}}{}
|
|
|
|
|
|
|
|
|
|
|
|
% Enviroment @var cisco
|
|
|
|
\lstnewenvironment{cisco}{\lstset{style=cisco}}{}
|