File: test-minted.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 (126 lines) | stat: -rw-r--r-- 2,522 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
\documentclass{minimal}
\usepackage{minted}

\begin{document}

\newminted{cpp}{gobble=2}                % -> cppcode
\newminted[cppcode_test]{cpp}{gobble=2}  % -> cppcode_test
\newmint[pymint]{python}{linenos}        % -> \pymint
\newmintinline{vim}{linenos}             % -> \viminline

Macros:
- \mint[lineos]{perl}|$x =~ /foo/|
- \mint[lineos]{perlxxx}|$x =~ /foo/|
- \pymint{print(1 + int(r'1'))} Cool!
- \viminline|let a=1|

\begin{minted}{perlxxx}
L1045 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ They do not!
L1044 +++$+++ u0 +++$+++ m0 +++$+++ CAMERON +++$+++ They do to!
L985 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ I hope so.!
\end{minted}

% This is not valid, but let's still highlight it as a texZone
\begin{minted}
L1045 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ They do not!
L1044 +++$+++ u0 +++$+++ m0 +++$+++ CAMERON +++$+++ They do to!
L985 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ I hope so.!
\end{minted}

\begin{minted}{c}
int main() {
  printf("hello, world");
  return 0;
}
\end{minted}

\begin{minted}[linenos]{python}
def function(arg):
    pass
\end{minted}

\begin{minted}[mathescape,
       linenos,
       numbersep=5pt,
       gobble=2,
       frame=lines,
       framesep=2mm]{python}
def function(arg):
    pass
\end{minted}

\begin{minted}[mathescape,
       linenos,
       numbersep=5pt,
       gobble=2,
       frame=lines,
       framesep=2mm]{csharp}
string title = "This is a Unicode π in the sky"
/*
Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
of an $n$-sided regular polygon circumscribing a
circle of diameter $d$.
*/
const double pi = 3.1415926535
\end{minted}

\paragraph{Some paragraph}

\begin{minted}{java}
class HelloWorld
{
  public static void main(String args[])
  {
      System.out.println("Hello world");
  }
}
\end{minted}

\begin{cppcode}
int main() {
  printf("hello, world");
  return 0;
}
\end{cppcode}

\begin{cppcode*}{a=0,
	 b=1}
int main() {
  printf("hello, world");
  return 0;
}
\end{cppcode*}

\begin{cppcode_test}
int main() {
  printf("hello, world");
  return 0;
}
\end{cppcode_test}

\begin{minted}{tex}
\begin{example}
  Hello world
\end{example}
\end{minted}

% Test newminted for stuff that does not exist
\newminted[log]{log}{breaklines}
\newminted[longss]{shell-session}{breaklines}

\begin{log}
destination d_local { file("/var/log/syslog-ng/messages_${HOST}"); };
\end{log}

\begin{longss}
$ ls -l
$ ls -l
\end{longss}

\begin{minted}[breaklines]{json}
{
  "test": 1
}
\end{minted}

\end{document}