You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

85 lines
2.4 KiB

  1. % packages
  2. \usepackage{xcolor}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{amsmath}
  5. \usepackage{amsfonts}
  6. \usepackage{amssymb}
  7. \usepackage{graphicx}
  8. \usepackage{listings}
  9. \usepackage{minted}
  10. \usepackage{xparse}
  11. % for \verb inside \item
  12. \usepackage[T1]{fontenc}
  13. \usepackage[Q=yes]{examplep}
  14. % color definition
  15. \definecolor{solarized}{HTML}{002B36}
  16. \definecolor{mygreen}{HTML}{009900}
  17. \definecolor{mygrey}{rgb}{0.95,0.95,0.95}
  18. % package configuration
  19. \DeclareGraphicsExtensions{.pdf,.png,.jpg}
  20. \beamertemplatenavigationsymbolsempty
  21. \setbeamertemplate{footline}[frame number]
  22. % minted
  23. %% fix the minted@colorbg environment
  24. \makeatletter
  25. \renewenvironment{minted@colorbg}[1]
  26. {\def\minted@bgcol{#1}%
  27. \noindent
  28. \begin{lrbox}{\minted@bgbox}
  29. \begin{minipage}{\linewidth-2\fboxsep}}
  30. {\end{minipage}%
  31. \end{lrbox}%
  32. \setlength{\topsep}{\smallskipamount}% set the vertical space
  33. \trivlist\item\relax % ensure going to a new line
  34. \colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}%
  35. \endtrivlist % close the trivlist
  36. }
  37. \makeatother
  38. \usemintedstyle{friendly}
  39. \newminted{haskell}{bgcolor=mygrey,frame=single,numbers=left}
  40. \newminted{cpp}{bgcolor=mygrey,frame=single,numbers=left}
  41. \newminted{c}{bgcolor=mygrey,frame=single,numbers=left}
  42. \renewcommand{\theFancyVerbLine}{\ttfamily
  43. \textcolor[rgb]{0.0,0.0,0.0}{\footnotesize
  44. \oldstylenums{\arabic{FancyVerbLine}}}}
  45. % macros and environments
  46. \newcommand{\code}[1]{\texttt{#1}}
  47. \newcommand{\slidep}{\onslide<+->}
  48. \newenvironment{itemizep}
  49. {\begin{itemize}[<+->]}
  50. {\end{itemize}}
  51. \NewDocumentCommand {\slide} { m O{} O{} }
  52. {\begin{frame}{#3}
  53. \frametitle{\thesection.\ifnum\thesubsection=0\else\thesubsection.\fi\ \currentname {#2}}
  54. \input{#1}
  55. \end{frame}}
  56. \NewDocumentCommand {\slidetoc} { }
  57. {\begin{frame}
  58. \frametitle{\thesection. \currentname}
  59. \tableofcontents[currentsection,hideothersubsections]
  60. \end{frame}}
  61. % sections numbered
  62. \setbeamertemplate{section in toc}[sections numbered]
  63. \setbeamertemplate{subsection in toc}[subsections numbered]
  64. \defbeamertemplate{subsubsection in toc}{subsubsections numbered}
  65. {\leavevmode\leftskip=3em%
  66. \rlap{\hskip-3em\inserttocsectionnumber.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber}%
  67. \inserttocsubsubsection\par}
  68. \setbeamertemplate{subsubsection in toc}[subsubsections numbered]
  69. % get current section name
  70. \usepackage{nameref}
  71. \makeatletter
  72. \newcommand*{\currentname}{\@currentlabelname}
  73. \makeatother