Guest User

Gordon

a guest
Feb 25th, 2011
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.77 KB | None | 0 0
  1. \documentclass{article}
  2. \usepackage{listings}
  3. \lstset{ %
  4. language=c,                % choose the language of the code
  5. basicstyle=\footnotesize,       % the size of the fonts that are used for the code
  6. numbers=left,                   % where to put the line-numbers
  7. numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers
  8. stepnumber=2,                   % the step between two line-numbers. If it's 1 each line
  9.                                 % will be numbered
  10. numbersep=5pt,                  % how far the line-numbers are from the code
  11. backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}
  12. showspaces=false,               % show spaces adding particular underscores
  13. showstringspaces=false,         % underline spaces within strings
  14. showtabs=false,                 % show tabs within strings adding particular underscores
  15. frame=single,                   % adds a frame around the code
  16. tabsize=2,                      % sets default tabsize to 2 spaces
  17. captionpos=b,                   % sets the caption-position to bottom
  18. breaklines=true,                % sets automatic line breaking
  19. breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
  20. title=\lstname,                 % show the filename of files included with \lstinputlisting;
  21.                                 % also try caption instead of title
  22. escapeinside={\%*}{*)},         % if you want to add a comment within your code
  23. morekeywords={*,...},            % if you want to add more keywords to the set
  24. }
  25. \begin{document}
  26.  
  27. \begin{lstlisting}
  28. #include <stdio.h>
  29.  
  30. int main()
  31. {
  32.        setbuf(stdout, NULL);        // Kikapcsolja a bufferelest
  33.        printf(myid);
  34.        printf(mytask);
  35.        return(0);
  36. }
  37. \end{lstlisting}
  38. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment