code_style.tex 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %% This file contains the style of the codes show in slides. %%
  3. %% The package used is listings, but it possible to used others. %%
  4. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  5. % color used in the code style
  6. \definecolor{codegreen}{rgb}{0,0.6,0}
  7. \definecolor{codegray}{rgb}{0.5,0.5,0.5}
  8. \definecolor{codepurple}{rgb}{0.58,0,0.82}
  9. \definecolor{codebackground}{rgb}{0.95,0.95,0.92}
  10. % style of the code!
  11. \lstdefinestyle{codestyle}{
  12. backgroundcolor=\color{codebackground},
  13. commentstyle=\color{codegreen},
  14. keywordstyle=\color{magenta},
  15. numberstyle=\tiny\color{codegray},
  16. stringstyle=\color{codepurple},
  17. basicstyle=\ttfamily\footnotesize,
  18. frame=single,
  19. breakatwhitespace=false,
  20. breaklines=true,
  21. captionpos=b,
  22. keepspaces=true,
  23. numbers=left,
  24. numbersep=5pt,
  25. showspaces=false,
  26. showstringspaces=false,
  27. showtabs=false,
  28. tabsize=2,
  29. title=\lstname
  30. }
  31. \lstset{style=codestyle}