File: test-listings.tex

package info (click to toggle)
vim-vimtex 2.17-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,844 kB
  • sloc: makefile: 360; python: 103
file content (50 lines) | stat: -rw-r--r-- 869 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
\documentclass{article}
\usepackage{listings}

\begin{document}

% Comment out to compile!
\lstinputlisting[options]{file}

\lstinline|asdasd|
\lstinline{asdasd}

\lstinline[language=C]|int x;|
\lstinline[language=C]{int x;}

\begin{lstlisting}
testing
\end{lstlisting}

\begin{lstlisting}[directivestyle={\color{black}},
                   language=C,
                   emph={int,char,double,float,unsigned},
                   emphstyle={\color{blue}}]
#include<stdio.h>
main() {
  int i = 0;
  printf("Hello World");
}
\end{lstlisting}

\begin{lstlisting}[language=python]
def function(arg):
    pass
\end{lstlisting}

\lstset{language=rust,numbers=none}
\begin{lstlisting}
fn main() {
    println!("Hello World!");
}
\end{lstlisting}

\lstset{language=x,numbers=none}

\lstset{
  language=C,
  basicstyle=\color[RGB]{0,0,0},
  numberstyle=\small
}

\end{document}