]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/test/test-minted.lyx.lyx
Update tex2lyx tests
[lyx.git] / src / tex2lyx / test / test-minted.lyx.lyx
1 #LyX file created by tex2lyx 2.4
2 \lyxformat 612
3 \begin_document
4 \begin_header
5 \save_transient_properties true
6 \origin roundtrip
7 \textclass article
8 \begin_preamble
9 %% Do not edit unless you really know what you are doing.
10
11
12
13 \end_preamble
14 \use_default_options false
15 \maintain_unincluded_children no
16 \language english
17 \language_package none
18 \inputencoding iso8859-15
19 \fontencoding T1
20 \font_roman "default" "default"
21 \font_sans "default" "default"
22 \font_typewriter "default" "default"
23 \font_math "auto" "auto"
24 \font_default_family default
25 \use_non_tex_fonts false
26 \font_sc false
27 \font_roman_osf false
28 \font_sans_osf false
29 \font_typewriter_osf false
30 \font_sf_scale 100 100
31 \font_tt_scale 100 100
32 \use_microtype false
33 \use_dash_ligatures true
34 \graphics default
35 \default_output_format default
36 \output_sync 0
37 \bibtex_command default
38 \index_command default
39 \paperfontsize 12
40 \spacing single
41 \use_hyperref false
42 \papersize a4
43 \use_geometry false
44 \use_package amsmath 1
45 \use_package amssymb 0
46 \use_package cancel 0
47 \use_package esint 1
48 \use_package mathdots 0
49 \use_package mathtools 0
50 \use_package mhchem 0
51 \use_package stackrel 0
52 \use_package stmaryrd 0
53 \use_package undertilde 0
54 \cite_engine basic
55 \cite_engine_type default
56 \biblio_style plain
57 \use_bibtopic false
58 \use_indices false
59 \paperorientation portrait
60 \suppress_date false
61 \justification true
62 \use_refstyle 0
63 \use_minted 1
64 \use_lineno false
65 \index Index
66 \shortcut idx
67 \color #008000
68 \end_index
69 \secnumdepth 3
70 \tocdepth 3
71 \paragraph_separation indent
72 \paragraph_indentation default
73 \is_math_indent 0
74 \math_numbering_side default
75 \quotes_style english
76 \dynamic_quotes 0
77 \papercolumns 1
78 \papersides 1
79 \paperpagestyle default
80 \tracking_changes false
81 \output_changes false
82 \change_bars false
83 \html_math_output 0
84 \html_css_as_file 0
85 \html_be_strict false
86 \docbook_table_output 0
87 \docbook_mathml_prefix 1
88 \end_header
89
90 \begin_body
91
92 \begin_layout Standard
93
94 \begin_inset CommandInset toc
95 LatexCommand lstlistoflistings
96
97 \end_inset
98
99
100 \end_layout
101
102 \begin_layout Section
103 Minted Listings
104 \end_layout
105
106 \begin_layout Standard
107 Inline: 
108 \begin_inset listings
109 lstparams "style=bw,language=C++"
110 inline true
111 status open
112
113 \begin_layout Plain Layout
114 int a=5;
115 \end_layout
116
117 \end_inset
118
119
120 \begin_inset Newline newline
121 \end_inset
122
123  Float (Listing
124 \begin_inset space ~
125
126 \end_inset
127
128
129 \begin_inset CommandInset ref
130 LatexCommand ref
131 reference "Example-Listing"
132 plural "false"
133 caps "false"
134 noprefix "false"
135
136 \end_inset
137
138 ):
139 \end_layout
140
141 \begin_layout Standard
142
143 \begin_inset listings
144 lstparams "language=Python,float=h"
145 inline false
146 status open
147
148 \begin_layout Plain Layout
149 # Example listing float
150 \end_layout
151
152 \begin_layout Plain Layout
153 def func(param):
154 \end_layout
155
156 \begin_layout Plain Layout
157     'this is a python function'
158 \end_layout
159
160 \begin_layout Plain Layout
161     pass
162 \end_layout
163
164 \begin_layout Plain Layout
165
166 \begin_inset Caption Standard
167
168 \begin_layout Plain Layout
169 Example Listing float
170 \begin_inset CommandInset label
171 LatexCommand label
172 name "Example-Listing"
173
174 \end_inset
175
176  
177
178 \end_layout
179
180 \end_inset
181
182
183 \end_layout
184
185 \end_inset
186
187
188 \end_layout
189
190 \begin_layout Standard
191 Here is an example listing with left line numbering, language 
192 \begin_inset Quotes eld
193 \end_inset
194
195 Python
196 \begin_inset Quotes erd
197 \end_inset
198
199  and 
200 \begin_inset Quotes eld
201 \end_inset
202
203 Space
204 \begin_inset space ~
205
206 \end_inset
207
208 as
209 \begin_inset space ~
210
211 \end_inset
212
213 symbol
214 \begin_inset Quotes erd
215 \end_inset
216
217 , range lines from 4 to end:
218 \end_layout
219
220 \begin_layout Standard
221
222 \begin_inset listings
223 lstparams "firstline=4,numbers=left,showspaces=true,language=Python"
224 inline false
225 status open
226
227 \begin_layout Plain Layout
228 def func(param):
229 \end_layout
230
231 \begin_layout Plain Layout
232     'this is a python function'
233 \end_layout
234
235 \begin_layout Plain Layout
236     pass
237 \end_layout
238
239 \begin_layout Plain Layout
240 def func(param):
241 \end_layout
242
243 \begin_layout Plain Layout
244     'This is a German word: Tschüß'
245 \end_layout
246
247 \begin_layout Plain Layout
248     pass
249 \end_layout
250
251 \end_inset
252
253
254 \end_layout
255
256 \begin_layout Standard
257 A floating one-liner with [h] placement and without caption: 
258 \begin_inset listings
259 lstparams "fontfamily=tt,fontsize={\large},bgcolor=lightgray,language=ABAP,float=h"
260 inline false
261 status open
262
263 \begin_layout Plain Layout
264 hello
265 \end_layout
266
267
268 \end_inset
269
270
271 \end_layout
272
273 \begin_layout Standard
274 Another inline listing: 
275 \begin_inset listings
276 lstparams "language=TeX"
277 inline true
278 status open
279
280 \begin_layout Plain Layout
281
282 \backslash
283 begin{centering} hello
284 \end_layout
285
286 \end_inset
287
288
289 \end_layout
290
291 \begin_layout Standard
292 A non-floating listing with line frames and a top caption (Listing
293 \begin_inset space ~
294
295 \end_inset
296
297
298 \begin_inset CommandInset ref
299 LatexCommand ref
300 reference "hello-world"
301 plural "false"
302 caps "false"
303 noprefix "false"
304
305 \end_inset
306
307 ): 
308 \begin_inset listings
309 lstparams "numbers=left,frame=lines,language=C"
310 inline false
311 status open
312
313 \begin_layout Plain Layout
314
315 \begin_inset Caption Standard
316
317 \begin_layout Plain Layout
318 An example C program
319 \begin_inset CommandInset label
320 LatexCommand label
321 name "hello-world"
322
323 \end_inset
324
325
326
327 \end_layout
328
329 \end_inset
330
331
332 \end_layout
333
334 \begin_layout Plain Layout
335 int main()
336 \end_layout
337
338 \begin_layout Plain Layout
339 {
340 \end_layout
341
342 \begin_layout Plain Layout
343     printf("Hello world!
344 \backslash
345 n");
346 \end_layout
347
348 \begin_layout Plain Layout
349     return 0;
350 \end_layout
351
352 \begin_layout Plain Layout
353 }
354 \end_layout
355
356 \end_inset
357
358
359 \end_layout
360
361 \begin_layout Standard
362 A non-floating listing with line frames and a bottom caption (Listing
363 \begin_inset space ~
364
365 \end_inset
366
367
368 \begin_inset CommandInset ref
369 LatexCommand ref
370 reference "func"
371 plural "false"
372 caps "false"
373 noprefix "false"
374
375 \end_inset
376
377 ): 
378 \begin_inset listings
379 lstparams "numbers=left,frame=lines,language=Fortran"
380 inline false
381 status open
382
383 \begin_layout Plain Layout
384 subroutine incr(i)
385 \end_layout
386
387 \begin_layout Plain Layout
388   integer :: i
389 \end_layout
390
391 \begin_layout Plain Layout
392   i = i + 1 
393 \end_layout
394
395 \begin_layout Plain Layout
396   return 
397 \end_layout
398
399 \begin_layout Plain Layout
400 end subroutine function
401 \end_layout
402
403 \begin_layout Plain Layout
404
405 \begin_inset Caption Standard
406
407 \begin_layout Plain Layout
408
409 \begin_inset CommandInset label
410 LatexCommand label
411 name "func"
412
413 \end_inset
414
415 A Fortran subroutine
416
417 \end_layout
418
419 \end_inset
420
421
422 \end_layout
423
424 \end_inset
425
426 A framed floating listing with a caption and a label (Listing
427 \begin_inset space ~
428
429 \end_inset
430
431
432 \begin_inset CommandInset ref
433 LatexCommand ref
434 reference "python1"
435 plural "false"
436 caps "false"
437 noprefix "false"
438
439 \end_inset
440
441 ): 
442 \begin_inset listings
443 lstparams "frame=single,language=Python,float=h"
444 inline false
445 status open
446
447 \begin_layout Plain Layout
448 def boring(args = None):
449 \end_layout
450
451 \begin_layout Plain Layout
452     pass
453 \end_layout
454
455 \begin_layout Plain Layout
456
457 \begin_inset Caption Standard
458
459 \begin_layout Plain Layout
460 A Python function.
461 \begin_inset CommandInset label
462 LatexCommand label
463 name "python1"
464
465 \end_inset
466
467  
468
469 \end_layout
470
471 \end_inset
472
473
474 \end_layout
475
476 \end_inset
477
478
479 \end_layout
480
481 \begin_layout Standard
482 The same framed floating listing with a caption, a label and a stray math equation (Listing
483 \begin_inset space ~
484
485 \end_inset
486
487
488 \begin_inset CommandInset ref
489 LatexCommand ref
490 reference "python2"
491 plural "false"
492 caps "false"
493 noprefix "false"
494
495 \end_inset
496
497 ): \begin_inset listings
498 lstparams "frame=single,language=Python,float=h"
499 inline false
500 status open
501
502 \begin_layout Plain Layout
503 def boring(args = None):
504 \end_layout
505
506 \begin_layout Plain Layout
507     pass
508 \end_layout
509
510 \begin_layout Plain Layout
511
512 \begin_inset Caption Standard
513
514 \begin_layout Plain Layout
515 The previous Python function.
516 \begin_inset CommandInset label
517 LatexCommand label
518 name "python2"
519
520 \end_inset
521
522  
523
524 \begin_inset Formula $y=f(x)$
525 \end_inset
526
527  
528
529
530 \end_layout
531
532 \end_inset
533
534
535 \end_layout
536
537 \end_inset
538
539
540 \end_layout
541
542 \end_body
543 \end_document