]> git.lyx.org Git - lyx.git/blob - lib/examples/Graphics_and_Insets/Minted_File_Listing.lyx
French Additional manual, translation of chapter 4 up to sec. 4.3
[lyx.git] / lib / examples / Graphics_and_Insets / Minted_File_Listing.lyx
1 #LyX 2.4 created this file. For more info see https://www.lyx.org/
2 \lyxformat 620
3 \begin_document
4 \begin_header
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/Graphics_and_Insets/
7 \textclass article
8 \begin_preamble
9 \usepackage{xcolor}
10 \definecolor{lgray}{rgb}{0.95, 0.95, 0.95}
11 \usepackage{eso-pic}
12 \newlength{\boxwidth}
13 \newlength{\boxheight}
14 \setlength{\boxwidth}{\paperwidth}
15 \setlength{\boxheight}{\paperheight}
16 \addtolength{\boxwidth}{-1.2cm}
17 \addtolength{\boxheight}{-2.5cm}
18 \AddToShipoutPicture{%
19    \setlength{\@tempdimb}{0.5cm}%
20    \setlength{\@tempdimc}{1.0cm}%
21    \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
22      \hbox{\fboxrule=0.6pt\fbox{\vbox to \boxheight{%
23      \vss\hbox to \boxwidth{\hss}\vss}}}}%
24    \addtolength{\@tempdimc}{\boxheight}%
25    \addtolength{\@tempdimc}{6.5pt}%
26    \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
27      \hbox{\fboxrule=0.6pt\fcolorbox{black}{lgray}{\vbox to 3.5mm{%
28      \vss\hbox to \boxwidth{\hss\textbf{\textsf{\small\titlename}}\hss%
29      \hbox to 0pt{\hss\textsf{\footnotesize Page \arabic{page}/\pageref{lastpage}~}}}\vss}}}}%
30 }
31 \end_preamble
32 \use_default_options true
33 \maintain_unincluded_children no
34 \language english
35 \language_package default
36 \inputencoding utf8
37 \fontencoding auto
38 \font_roman "times" "DejaVu Sans Mono"
39 \font_sans "helvet" "DejaVu Sans"
40 \font_typewriter "courier" "DejaVu Sans Mono"
41 \font_math "auto" "default"
42 \font_default_family default
43 \use_non_tex_fonts true
44 \font_sc false
45 \font_roman_osf false
46 \font_sans_osf false
47 \font_typewriter_osf false
48 \font_sf_scale 95 95
49 \font_tt_scale 110 110
50 \use_microtype false
51 \use_dash_ligatures true
52 \graphics default
53 \default_output_format pdf4
54 \output_sync 0
55 \bibtex_command default
56 \index_command default
57 \paperfontsize 12
58 \spacing single
59 \use_hyperref false
60 \papersize default
61 \use_geometry true
62 \use_package amsmath 1
63 \use_package amssymb 1
64 \use_package cancel 1
65 \use_package esint 1
66 \use_package mathdots 1
67 \use_package mathtools 1
68 \use_package mhchem 1
69 \use_package stackrel 1
70 \use_package stmaryrd 1
71 \use_package undertilde 1
72 \cite_engine basic
73 \cite_engine_type default
74 \biblio_style plain
75 \use_bibtopic false
76 \use_indices false
77 \paperorientation landscape
78 \suppress_date false
79 \justification true
80 \use_refstyle 1
81 \use_minted 1
82 \use_lineno 0
83 \index Index
84 \shortcut idx
85 \color #008000
86 \end_index
87 \leftmargin 0.5cm
88 \topmargin 1.35cm
89 \rightmargin 0.5cm
90 \bottommargin 1.05cm
91 \secnumdepth 3
92 \tocdepth 3
93 \paragraph_separation indent
94 \paragraph_indentation default
95 \is_math_indent 0
96 \math_numbering_side default
97 \quotes_style english
98 \dynamic_quotes 0
99 \papercolumns 2
100 \papersides 1
101 \paperpagestyle empty
102 \tablestyle default
103 \tracking_changes false
104 \output_changes false
105 \change_bars false
106 \postpone_fragile_content false
107 \html_math_output 0
108 \html_css_as_file 0
109 \html_be_strict false
110 \docbook_table_output 0
111 \docbook_mathml_prefix 1
112 \end_header
113
114 \begin_body
115
116 \begin_layout Standard
117 \begin_inset Note Note
118 status open
119
120 \begin_layout Plain Layout
121 This example shows a possible use of the minted package (version 2.1 or later) for typesetting listings containing unicode characters.
122  For this reason,
123  the default output format is 
124 \family typewriter
125 PDF (XeTeX)
126 \family default
127 .
128  The listing is typeset using the DejaVu font.
129  If this font is not installed on your system,
130  you need to choose a different one in Document\SpecialChar menuseparator
131 Settings\SpecialChar menuseparator
132 Fonts.
133 \end_layout
134
135 \begin_layout Plain Layout
136 Other than the minted latex package,
137  you also need the pygments python module.
138  See the minted documentation for directions on how to install it and what you have to do for using it with LaTeX.
139  If you use a linux system,
140  you can possibly install a suitable package through your package manager.
141  Look for python packages named 
142 \family typewriter
143 python-pygments
144 \family default
145  or similar.
146 \end_layout
147
148 \begin_layout Plain Layout
149 Another required package is the 
150 \family typewriter
151 eso-pic
152 \family default
153  latex package,
154  so you also need to install it.
155  It is used to draw a page frame around the listing.
156 \end_layout
157
158 \end_inset
159
160
161 \end_layout
162
163 \begin_layout Standard
164 \begin_inset ERT
165 status open
166
167 \begin_layout Plain Layout
168
169
170 \backslash
171 def
172 \backslash
173 titlename{lyxpak.py}
174 \end_layout
175
176 \end_inset
177
178
179 \begin_inset Note Note
180 status open
181
182 \begin_layout Plain Layout
183 This is the title of the listing appearing in the headers.
184 \end_layout
185
186 \end_inset
187
188
189 \end_layout
190
191 \begin_layout Standard
192 \begin_inset CommandInset include
193 LatexCommand inputminted
194 filename "../../scripts/lyxpak.py"
195 lstparams "language=python,style=bw,fontsize={\\tiny},baselinestretch={1.05},frame=leftline,framesep=10pt,breaklines,breakanywhere"
196 literal "true"
197
198 \end_inset
199
200
201 \end_layout
202
203 \begin_layout Standard
204 \begin_inset CommandInset label
205 LatexCommand label
206 name "lastpage"
207
208 \end_inset
209
210
211 \begin_inset Note Note
212 status open
213
214 \begin_layout Plain Layout
215 This label is needed to show the total number of pages in upper-right corner of the PDF.
216 \end_layout
217
218 \end_inset
219
220
221 \end_layout
222
223 \end_body
224 \end_document