1 #LyX 2.3 created this file. For more info see http://www.lyx.org/
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/
10 \definecolor{lgray}{rgb}{0.95, 0.95, 0.95}
12 \use_default_options true
13 \maintain_unincluded_children false
15 \language_package default
18 \font_roman "default" "default"
19 \font_sans "default" "default"
20 \font_typewriter "default" "default"
21 \font_math "auto" "auto"
22 \font_default_family default
23 \use_non_tex_fonts false
26 \font_sf_scale 100 100
27 \font_tt_scale 100 100
29 \use_dash_ligatures true
31 \default_output_format default
33 \bibtex_command default
34 \index_command default
35 \paperfontsize default
40 \use_package amsmath 1
41 \use_package amssymb 1
44 \use_package mathdots 1
45 \use_package mathtools 1
47 \use_package stackrel 1
48 \use_package stmaryrd 1
49 \use_package undertilde 1
51 \cite_engine_type default
55 \paperorientation portrait
66 \paragraph_separation indent
67 \paragraph_indentation default
69 \math_numbering_side default
74 \paperpagestyle default
75 \listings_params "breaklines=true"
76 \tracking_changes false
85 \begin_layout Standard
86 \begin_inset Note Note
89 \begin_layout Plain Layout
90 This example shows how to typeset code listings in a document using the
94 \begin_layout Plain Layout
95 Other than the minted package, you also need the pygments python module.
96 See the minted documentation for directions on how to install it and what
97 you have to do for using it with LaTeX.
98 If you use a linux system, you can possibly install a suitable package
99 through your package manager.
100 Look for python packages named
112 \begin_layout Standard
113 A common example of a C program is shown in Listing
118 \begin_inset CommandInset ref
127 using the default style, a light gray background, visible spaces, and numbered
129 The listing of some fortran code using the
133 style is instead shown in a non-floating listing below.
136 \begin_layout Standard
137 \begin_inset listings
138 lstparams "language=C,float=t,numbers=left,showspaces=true,bgcolor=lgray"
142 \begin_layout Plain Layout
147 \begin_layout Plain Layout
152 \begin_layout Plain Layout
155 \begin_inset Quotes eld
161 \begin_inset Quotes erd
167 \begin_layout Plain Layout
172 \begin_layout Plain Layout
177 \begin_layout Plain Layout
179 \begin_inset Caption Standard
181 \begin_layout Plain Layout
183 \begin_inset CommandInset label
202 \begin_layout Standard
203 \begin_inset listings
204 lstparams "language=Fortran,frame=lines,style=bw"
208 \begin_layout Plain Layout
210 * Compute machine precision
213 \begin_layout Plain Layout
217 \begin_layout Plain Layout
219 implicit double precision (a-h,o-z)
222 \begin_layout Plain Layout
227 \begin_layout Plain Layout
232 \begin_layout Plain Layout
237 \begin_layout Plain Layout
242 \begin_layout Plain Layout
248 \begin_layout Plain Layout
250 write(*,'(1pg24.17)') eps
253 \begin_layout Plain Layout
258 \begin_layout Plain Layout
268 \begin_layout Standard
269 Here is an inline listing of some TeX code:
270 \begin_inset listings
271 lstparams "language=TeX,fontfamily=tt"
275 \begin_layout Plain Layout