Advertisement
Guest User

Untitled

a guest
Jan 10th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.19 KB | None | 0 0
  1. %% Everything related to code/listings
  2. \definecolor{comment_green}{rgb}{0.0, 0.35, 0.0}
  3. \definecolor{keyword_blue}{rgb}{0.0, 0.0, 0.5}
  4. \definecolor{attribute_purple}{rgb}{0.4, 0.0, 0.4}
  5. \colorlet{background_gray}{gray!25}
  6.  
  7. \lstdefinestyle{codeinline}{
  8.    backgroundcolor=\color{background_gray},
  9.    basicstyle=\footnotesize\ttfamily,
  10.    breaklines=true,
  11. }
  12.  
  13. \lstdefinestyle{codelisting}{
  14.    backgroundcolor=\color{background_gray},
  15.    basicstyle=\footnotesize\ttfamily,
  16.    commentstyle=\color{comment_green},
  17.    keywordstyle=\color{keyword_blue},
  18.    frame=none,
  19.    breaklines=true,
  20.    numbers=left
  21. }
  22.  
  23. \lstdefinestyle{ebnflisting}{
  24.    backgroundcolor=\color{white},
  25.    basicstyle=\footnotesize\ttfamily,
  26.    commentstyle=\color{comment_green},
  27.    keywordstyle=\color{keyword_blue},
  28.    frame=none,
  29.    breaklines=false,
  30.    numbers=none
  31. }
  32.  
  33. %% Commands that map to other latex commands or style
  34. \newcommand{\code}[1]{\colorbox{background_gray}{\lstinline[style=codeinline]$#1$}}
  35. \newcommand{\rustcode}[1]{\colorbox{background_gray}\lstinline[style=codeinline, language=Rust]$#1$}
  36.  
  37. \floatstyle{ruled}
  38. \newfloat{listing}{htbp!}{lol}[chapter]
  39. \floatname{listing}{Code Listing}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement