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