]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/test/test-minted.lyx.lyx
Update tex2lyx tests after the format change
[lyx.git] / src / tex2lyx / test / test-minted.lyx.lyx
1 #LyX file created by tex2lyx 2.4
2 \lyxformat 599
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 \end_header
88
89 \begin_body
90
91 \begin_layout Standard
92
93 \begin_inset CommandInset toc
94 LatexCommand lstlistoflistings
95
96 \end_inset
97
98
99 \end_layout
100
101 \begin_layout Section
102 Minted Listings
103 \end_layout
104
105 \begin_layout Standard
106 Inline: 
107 \begin_inset listings
108 lstparams "style=bw,language=C++"
109 inline true
110 status open
111
112 \begin_layout Plain Layout
113 int a=5;
114 \end_layout
115
116 \end_inset
117
118
119 \begin_inset Newline newline
120 \end_inset
121
122  Float (Listing
123 \begin_inset space ~
124
125 \end_inset
126
127
128 \begin_inset CommandInset ref
129 LatexCommand ref
130 reference "Example-Listing"
131 plural "false"
132 caps "false"
133 noprefix "false"
134
135 \end_inset
136
137 ):
138 \end_layout
139
140 \begin_layout Standard
141
142 \begin_inset listings
143 lstparams "language=Python,float=h"
144 inline false
145 status open
146
147 \begin_layout Plain Layout
148 # Example listing float
149 \end_layout
150
151 \begin_layout Plain Layout
152 def func(param):
153 \end_layout
154
155 \begin_layout Plain Layout
156     'this is a python function'
157 \end_layout
158
159 \begin_layout Plain Layout
160     pass
161 \end_layout
162
163 \begin_layout Plain Layout
164
165 \begin_inset Caption Standard
166
167 \begin_layout Plain Layout
168 Example Listing float
169 \begin_inset CommandInset label
170 LatexCommand label
171 name "Example-Listing"
172
173 \end_inset
174
175  
176
177 \end_layout
178
179 \end_inset
180
181
182 \end_layout
183
184 \end_inset
185
186
187 \end_layout
188
189 \begin_layout Standard
190 Here is an example listing with left line numbering, language 
191 \begin_inset Quotes eld
192 \end_inset
193
194 Python
195 \begin_inset Quotes erd
196 \end_inset
197
198  and 
199 \begin_inset Quotes eld
200 \end_inset
201
202 Space
203 \begin_inset space ~
204
205 \end_inset
206
207 as
208 \begin_inset space ~
209
210 \end_inset
211
212 symbol
213 \begin_inset Quotes erd
214 \end_inset
215
216 , range lines from 4 to end:
217 \end_layout
218
219 \begin_layout Standard
220
221 \begin_inset listings
222 lstparams "firstline=4,numbers=left,showspaces=true,language=Python"
223 inline false
224 status open
225
226 \begin_layout Plain Layout
227 def func(param):
228 \end_layout
229
230 \begin_layout Plain Layout
231     'this is a python function'
232 \end_layout
233
234 \begin_layout Plain Layout
235     pass
236 \end_layout
237
238 \begin_layout Plain Layout
239 def func(param):
240 \end_layout
241
242 \begin_layout Plain Layout
243     'This is a German word: Tschüß'
244 \end_layout
245
246 \begin_layout Plain Layout
247     pass
248 \end_layout
249
250 \end_inset
251
252
253 \end_layout
254
255 \begin_layout Standard
256 A floating one-liner with [h] placement and without caption: 
257 \begin_inset listings
258 lstparams "fontfamily=tt,fontsize={\large},bgcolor=lightgray,language=ABAP,float=h"
259 inline false
260 status open
261
262 \begin_layout Plain Layout
263 hello
264 \end_layout
265
266
267 \end_inset
268
269
270 \end_layout
271
272 \begin_layout Standard
273 Another inline listing: 
274 \begin_inset listings
275 lstparams "language=TeX"
276 inline true
277 status open
278
279 \begin_layout Plain Layout
280
281 \backslash
282 begin{centering} hello
283 \end_layout
284
285 \end_inset
286
287
288 \end_layout
289
290 \begin_layout Standard
291 A non-floating listing with line frames and a top caption (Listing
292 \begin_inset space ~
293
294 \end_inset
295
296
297 \begin_inset CommandInset ref
298 LatexCommand ref
299 reference "hello-world"
300 plural "false"
301 caps "false"
302 noprefix "false"
303
304 \end_inset
305
306 ): 
307 \begin_inset listings
308 lstparams "numbers=left,frame=lines,language=C"
309 inline false
310 status open
311
312 \begin_layout Plain Layout
313
314 \begin_inset Caption Standard
315
316 \begin_layout Plain Layout
317 An example C program
318 \begin_inset CommandInset label
319 LatexCommand label
320 name "hello-world"
321
322 \end_inset
323
324
325
326 \end_layout
327
328 \end_inset
329
330
331 \end_layout
332
333 \begin_layout Plain Layout
334 int main()
335 \end_layout
336
337 \begin_layout Plain Layout
338 {
339 \end_layout
340
341 \begin_layout Plain Layout
342     printf("Hello world!
343 \backslash
344 n");
345 \end_layout
346
347 \begin_layout Plain Layout
348     return 0;
349 \end_layout
350
351 \begin_layout Plain Layout
352 }
353 \end_layout
354
355 \end_inset
356
357
358 \end_layout
359
360 \begin_layout Standard
361 A non-floating listing with line frames and a bottom caption (Listing
362 \begin_inset space ~
363
364 \end_inset
365
366
367 \begin_inset CommandInset ref
368 LatexCommand ref
369 reference "func"
370 plural "false"
371 caps "false"
372 noprefix "false"
373
374 \end_inset
375
376 ): 
377 \begin_inset listings
378 lstparams "numbers=left,frame=lines,language=Fortran"
379 inline false
380 status open
381
382 \begin_layout Plain Layout
383 subroutine incr(i)
384 \end_layout
385
386 \begin_layout Plain Layout
387   integer :: i
388 \end_layout
389
390 \begin_layout Plain Layout
391   i = i + 1 
392 \end_layout
393
394 \begin_layout Plain Layout
395   return 
396 \end_layout
397
398 \begin_layout Plain Layout
399 end subroutine function
400 \end_layout
401
402 \begin_layout Plain Layout
403
404 \begin_inset Caption Standard
405
406 \begin_layout Plain Layout
407
408 \begin_inset CommandInset label
409 LatexCommand label
410 name "func"
411
412 \end_inset
413
414 A Fortran subroutine
415
416 \end_layout
417
418 \end_inset
419
420
421 \end_layout
422
423 \end_inset
424
425 A framed floating listing with a caption and a label (Listing
426 \begin_inset space ~
427
428 \end_inset
429
430
431 \begin_inset CommandInset ref
432 LatexCommand ref
433 reference "python1"
434 plural "false"
435 caps "false"
436 noprefix "false"
437
438 \end_inset
439
440 ): 
441 \begin_inset listings
442 lstparams "frame=single,language=Python,float=h"
443 inline false
444 status open
445
446 \begin_layout Plain Layout
447 def boring(args = None):
448 \end_layout
449
450 \begin_layout Plain Layout
451     pass
452 \end_layout
453
454 \begin_layout Plain Layout
455
456 \begin_inset Caption Standard
457
458 \begin_layout Plain Layout
459 A Python function.
460 \begin_inset CommandInset label
461 LatexCommand label
462 name "python1"
463
464 \end_inset
465
466  
467
468 \end_layout
469
470 \end_inset
471
472
473 \end_layout
474
475 \end_inset
476
477
478 \end_layout
479
480 \begin_layout Standard
481 The same framed floating listing with a caption, a label and a stray math equation (Listing
482 \begin_inset space ~
483
484 \end_inset
485
486
487 \begin_inset CommandInset ref
488 LatexCommand ref
489 reference "python2"
490 plural "false"
491 caps "false"
492 noprefix "false"
493
494 \end_inset
495
496 ): \begin_inset listings
497 lstparams "frame=single,language=Python,float=h"
498 inline false
499 status open
500
501 \begin_layout Plain Layout
502 def boring(args = None):
503 \end_layout
504
505 \begin_layout Plain Layout
506     pass
507 \end_layout
508
509 \begin_layout Plain Layout
510
511 \begin_inset Caption Standard
512
513 \begin_layout Plain Layout
514 The previous Python function.
515 \begin_inset CommandInset label
516 LatexCommand label
517 name "python2"
518
519 \end_inset
520
521  
522
523 \begin_inset Formula $y=f(x)$
524 \end_inset
525
526  
527
528
529 \end_layout
530
531 \end_inset
532
533
534 \end_layout
535
536 \end_inset
537
538
539 \end_layout
540
541 \end_body
542 \end_document