]> git.lyx.org Git - lyx.git/blob - lib/examples/minted-filelisting.lyx
Quick review of cs docs.
[lyx.git] / lib / examples / minted-filelisting.lyx
1 #LyX 2.3 created this file. For more info see http://www.lyx.org/
2 \lyxformat 544
3 \begin_document
4 \begin_header
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/
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 false
34 \language english
35 \language_package default
36 \inputencoding auto
37 \fontencoding global
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_osf false
46 \font_sf_scale 95 95
47 \font_tt_scale 110 110
48 \use_microtype false
49 \use_dash_ligatures true
50 \graphics default
51 \default_output_format pdf4
52 \output_sync 0
53 \bibtex_command default
54 \index_command default
55 \paperfontsize 12
56 \spacing single
57 \use_hyperref false
58 \papersize default
59 \use_geometry true
60 \use_package amsmath 1
61 \use_package amssymb 1
62 \use_package cancel 1
63 \use_package esint 1
64 \use_package mathdots 1
65 \use_package mathtools 1
66 \use_package mhchem 1
67 \use_package stackrel 1
68 \use_package stmaryrd 1
69 \use_package undertilde 1
70 \cite_engine basic
71 \cite_engine_type default
72 \biblio_style plain
73 \use_bibtopic false
74 \use_indices false
75 \paperorientation landscape
76 \suppress_date false
77 \justification true
78 \use_refstyle 1
79 \use_minted 1
80 \index Index
81 \shortcut idx
82 \color #008000
83 \end_index
84 \leftmargin 0.5cm
85 \topmargin 1.35cm
86 \rightmargin 0.5cm
87 \bottommargin 1.05cm
88 \secnumdepth 3
89 \tocdepth 3
90 \paragraph_separation indent
91 \paragraph_indentation default
92 \is_math_indent 0
93 \math_numbering_side default
94 \quotes_style english
95 \dynamic_quotes 0
96 \papercolumns 2
97 \papersides 1
98 \paperpagestyle empty
99 \tracking_changes false
100 \output_changes false
101 \html_math_output 0
102 \html_css_as_file 0
103 \html_be_strict false
104 \end_header
105
106 \begin_body
107
108 \begin_layout Standard
109 \begin_inset Note Note
110 status open
111
112 \begin_layout Plain Layout
113 This example shows a possible use of the minted package (version 2.1 or later)
114  for typesetting listings containing unicode characters.
115  For this reason, the default output format is 
116 \family typewriter
117 PDF (XeTeX)
118 \family default
119 .
120  The listing is typeset using the DejaVu font.
121  If this font is not installed on your system, you need to choose a different
122  one in Document\SpecialChar menuseparator
123 Settings\SpecialChar menuseparator
124 Fonts.
125 \end_layout
126
127 \begin_layout Plain Layout
128 Other than the minted latex package, you also need the pygments python module.
129  See the minted documentation for directions on how to install it and what
130  you have to do for using it with LaTeX.
131  If you use a linux system, you can possibly install a suitable package
132  through your package manager.
133  Look for python packages named 
134 \family typewriter
135 python-pygments
136 \family default
137  or similar.
138 \end_layout
139
140 \begin_layout Plain Layout
141 Another required package is the 
142 \family typewriter
143 eso-pic
144 \family default
145  latex package, so you also need to install it.
146  It is used to draw a page frame around the listing.
147 \end_layout
148
149 \end_inset
150
151
152 \end_layout
153
154 \begin_layout Standard
155 \begin_inset ERT
156 status open
157
158 \begin_layout Plain Layout
159
160
161 \backslash
162 def
163 \backslash
164 titlename{lyxpak.py}
165 \end_layout
166
167 \end_inset
168
169
170 \begin_inset Note Note
171 status open
172
173 \begin_layout Plain Layout
174 This is the title of the listing appearing in the headers.
175 \end_layout
176
177 \end_inset
178
179
180 \end_layout
181
182 \begin_layout Standard
183 \begin_inset CommandInset include
184 LatexCommand inputminted
185 filename "../scripts/lyxpak.py"
186 lstparams "language=python,style=bw,fontsize={\\tiny},baselinestretch={1.05},frame=leftline,framesep=10pt,breaklines,breakanywhere"
187
188 \end_inset
189
190
191 \end_layout
192
193 \begin_layout Standard
194 \begin_inset CommandInset label
195 LatexCommand label
196 name "lastpage"
197
198 \end_inset
199
200
201 \begin_inset Note Note
202 status open
203
204 \begin_layout Plain Layout
205 This label is needed to show the total number of pages in upper-right corner
206  of the PDF.
207 \end_layout
208
209 \end_inset
210
211
212 \end_layout
213
214 \end_body
215 \end_document