haskell-lectures/common/common_configuration.tex

32 lines
1.1 KiB
TeX

% color definition
\definecolor{solarized}{HTML}{002B36}
\definecolor{mygreen}{HTML}{009900}
\definecolor{myblue}{HTML}{0000FF}
\definecolor{mygrey}{rgb}{0.95,0.95,0.95}
% minted
%% fix the minted@colorbg environment
\makeatletter
\renewenvironment{minted@colorbg}[1]
{\def\minted@bgcol{#1}%
\noindent
\begin{lrbox}{\minted@bgbox}
\begin{minipage}{\linewidth-2\fboxsep}}
{\end{minipage}%
\end{lrbox}%
\setlength{\topsep}{\smallskipamount}% set the vertical space
\trivlist\item\relax % ensure going to a new line
\colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}%
\endtrivlist % close the trivlist
}
\makeatother
\usemintedstyle{friendly}
\newminted{haskell}{bgcolor=mygrey,frame=single,numbers=left}
\newminted{cpp}{bgcolor=mygrey,frame=single,numbers=left}
\newminted{c}{bgcolor=mygrey,frame=single,numbers=left}
\newcommand{\hinline}[1]{\mintinline{haskell}{#1}}
\newcommand{\cinline}[1]{\mintinline{c}{#1}}
\newcommand{\cppinline}[1]{\mintinline{cpp}{#1}}
\renewcommand{\theFancyVerbLine}{\ttfamily
\textcolor[rgb]{0.0,0.0,0.0}{\footnotesize
\oldstylenums{\arabic{FancyVerbLine}}}}