gt22

Untitled

Nov 12th, 2019
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.87 KB | None | 0 0
  1. \usepackage{listings}
  2.  
  3. \usepackage{xcolor}
  4.  
  5. \definecolor{lstKeyword}{HTML}{000080}
  6. \definecolor{lstBG}{HTML}{FFFFFF}
  7. \definecolor{lstString}{HTML}{008000}
  8. \definecolor{lstNumber}{HTML}{0000FF}
  9. \definecolor{lstComment}{HTML}{808080}
  10. \definecolor{lstLineNumber}{HTML}{999999}
  11.  
  12. \lstdefinestyle{custompython}{
  13.    backgroundcolor=\color{lstBG},
  14.    commentstyle=\color{lstComment},
  15.    keywordstyle=\color{lstKeyword},
  16.    numberstyle=\tiny\color{lstLineNumber},
  17.    stringstyle=\color{lstString},
  18.    basicstyle=\ttfamily,
  19.    breakatwhitespace=false,    
  20.    breaklines=false,    
  21.    captionpos=b,    
  22.    keepspaces=true,    
  23.    numbers=left,    
  24.    numbersep=5pt,    
  25.    showspaces=false,
  26.    showstringspaces=false,
  27.    showtabs=false,
  28.    tabsize=4
  29. }  
  30.  
  31. \lstdefinestyle{customc}{
  32.    belowcaptionskip=1\baselineskip,
  33.    breaklines=true,
  34.    frame=L,
  35.    xleftmargin=\parindent,
  36.    language=C,
  37.    backgroundcolor=\color{lstBG},
  38.    commentstyle=\itshape\color{lstComment},
  39.    keywordstyle=\bfseries\color{lstKeyword},
  40.    numberstyle=\tiny\color{lstLineNumber},
  41.    stringstyle=\color{lstString},
  42.    basicstyle=\ttfamily,
  43.    breakatwhitespace=false,    
  44.    breaklines=false,    
  45.    captionpos=b,    
  46.    keepspaces=true,    
  47.    numbers=left,    
  48.    numbersep=5pt,    
  49.    showspaces=false,
  50.    showstringspaces=false,
  51.    showtabs=false,
  52.    tabsize=4
  53. }
  54.  
  55. \lstdefinestyle{customasm}{
  56.  belowcaptionskip=1\baselineskip,
  57.  frame=L,
  58.  xleftmargin=\parindent,
  59.  language=[x86masm]Assembler,
  60.  basicstyle=\footnotesize\ttfamily,
  61.  commentstyle=\itshape\color{purple!40!black},
  62. }
  63.  
  64. \lstset{escapechar=@,style=customc}
  65. \usepackage{xparse}
  66.  
  67. \newcommand{\includecodecap}[2][c]{\lstinputlisting[caption=#2, escapechar=, style=custom#1]{#2}}
  68. \newcommand{\includecode}[2][c]{\lstinputlisting[escapechar=, style=custom#1]{#2}}
Advertisement
Add Comment
Please, Sign In to add comment