2 # file external_templates
3 # This file is part of LyX, the document processor.
4 # Licence details can be found in the file COPYING.
6 # author Asger Alstrup Nielsen
8 # author Johnathan Burchill
10 # Full author contact details are available in file CREDITS.
12 # This file contains the definitions of those External Templates that are
13 # part of the official LyX distribution.
14 # Feel free to create your own External Templates, storing them in
15 # .lyx/external_templates
18 PreambleDef WarnNotFound
19 %% Print a warning encased in an fbox.
20 \def\lyxstripprefix#1>{}
21 \newcommand{\warnNotFound}[1]{%
22 \def\lyxtempfilename{#1}%
24 \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
25 \typeout{Could not find \lyxtempfilename!}%
30 PreambleDef InputOrWarn
31 %% Input the file if it exists, using \input, else print a warning
32 \newcommand{\inputOrWarn}[1]{%
33 \IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
36 Template GnumericSpreadsheet
39 A spreadsheet made with Gnumeric, LibreOffice, OpenOffice or Excel.
40 It imports as a long table, so any length
41 is ok. Excessive width could be a problem.
42 The gnumeric software is necessary for conversion,
43 both for gnumeric and excel files.
45 InputFormat "gnumeric"
46 FileFilter "*.{gnumeric,ods,xls}"
47 AutomaticProduction true
49 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
51 UpdateResult "$$AbsPath$$Basename.tex"
54 Requirement "longtable"
56 Requirement "multirow"
59 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.tex"
62 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
64 UpdateResult "$$AbsPath$$Basename.tex"
67 Requirement "longtable"
69 Requirement "multirow"
72 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.tex"
77 # By default, InsetExternal is displayed as a grey button
78 # containing this text.
79 GuiName "Raster image"
80 # This text is used in the External dialog.
81 # Provide enough information to explain to the user just
82 # what the template can provide him with.
86 # ANY file type can be displayed as a RasterImage.
87 # Specifically, LyX will attempt to interrogate the file itself
88 # in order to deduce its format.
90 # Globbing pattern used when browsing for a Raster image file.
91 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
92 # Set to "true" if the file represented by the template
93 # must be generated by LyX.
94 AutomaticProduction true
95 # LyX has hard-coded support for these transformations
100 # LyX preview options:
101 # Off: LyX will not attempt to show this material on screen.
102 # Graphics: LyX will attempt to show this material as-is or via a
103 # conversion to a showable format.
104 # InstantPreview: LyX will attempt to use the 'instant preview'
105 # mechanism in order to show this material.
108 TransformOption Rotate RotationLatexOption
109 TransformOption Resize ResizeLatexOption
110 TransformOption Clip ClipLatexOption
111 TransformOption Extra ExtraOption
112 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
113 # This string is what is output to the LaTeX file.
114 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
116 UpdateResult "$$AbsPath$$Basename.eps"
117 Requirement "graphicx"
118 ReferencedFile latex "$$AbsPath$$Basename.eps"
119 ReferencedFile dvi "$$AbsPath$$Basename.eps"
122 TransformOption Rotate RotationLatexOption
123 TransformOption Resize ResizeLatexOption
124 TransformOption Clip ClipLatexOption
125 TransformOption Extra ExtraOption
126 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
127 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
129 UpdateResult "$$AbsPath$$Basename.png"
130 Requirement "graphicx"
131 ReferencedFile pdflatex "$$AbsPath$$Basename.png"
134 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
135 UpdateFormat asciiimage
136 UpdateResult "$$AbsPath$$Basename.asc"
139 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
141 UpdateResult "$$AbsPath$$Basename.eps"
142 ReferencedFile docbook "$$AbsPath$$Basename.eps"
143 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
149 GuiName "Xfig figure"
155 AutomaticProduction true
158 Preview InstantPreview
160 TransformCommand Rotate RotationLatexCommand
161 TransformCommand Resize ResizeLatexCommand
162 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
164 UpdateResult "$$AbsPath$$Basename.pstex_t"
166 Requirement "graphicx"
167 # Preamble WarnNotFound
168 # Preamble InputOrWarn
169 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
170 ReferencedFile latex "$$AbsPath$$Basename.eps"
171 ReferencedFile dvi "$$AbsPath$$Basename.eps"
174 TransformCommand Rotate RotationLatexCommand
175 TransformCommand Resize ResizeLatexCommand
176 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
178 UpdateResult "$$AbsPath$$Basename.pdftex_t"
180 Requirement "graphicx"
181 # Preamble WarnNotFound
182 # Preamble InputOrWarn
183 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
184 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
187 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
188 UpdateFormat asciixfig
189 UpdateResult "$$AbsPath$$Basename.asc"
192 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
194 UpdateResult "$$AbsPath$$Basename.eps"
195 ReferencedFile docbook "$$AbsPath$$Basename.eps"
196 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
201 Template ChessDiagram
202 GuiName "Chess diagram"
204 A chess position diagram.
205 This template will use XBoard to edit the position.
206 Use the 'File->Save Position' in XBoard to save
207 the position that you want to display.
208 Make sure to give it a '.fen' extension
209 and remember to type in a relative path
210 to the LyX document location.
211 Within XBoard, use 'Edit->Edit Position'
212 to enable general editing of the board.
213 You might also check out the
214 'Options->Test legality' option, and
215 remember to middle and right click to
216 insert new material in the board.
217 In order for this to work, you have to
218 put the bundled lyxskak.sty in a place
219 that TeX will find it, and you will need
220 to install the skak package from CTAN.
224 AutomaticProduction true
225 Preview InstantPreview
227 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
230 UpdateResult "$$AbsPath$$Basename$$Extension"
231 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
234 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
237 UpdateResult "$$AbsPath$$Basename$$Extension"
238 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
241 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
242 UpdateFormat asciichess
243 UpdateResult "$$AbsPath$$Basename.asc"
246 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
252 GuiName "Lilypond typeset music"
254 Sheet music typeset by GNU LilyPond,
255 converted to .pdf or .eps for inclusion
256 Using .eps requires at least lilypond 2.6
257 Using .pdf requires at least lilypond 2.9
259 InputFormat "lilypond"
261 AutomaticProduction true
266 Preview InstantPreview
268 TransformOption Rotate RotationLatexOption
269 TransformOption Resize ResizeLatexOption
270 TransformOption Clip ClipLatexOption
271 TransformOption Extra ExtraOption
272 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
273 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
275 UpdateResult "$$AbsPath$$Basename.eps"
276 Requirement "graphicx"
277 ReferencedFile latex "$$AbsPath$$Basename.eps"
278 ReferencedFile dvi "$$AbsPath$$Basename.eps"
281 TransformOption Rotate RotationLatexOption
282 TransformOption Resize ResizeLatexOption
283 TransformOption Clip ClipLatexOption
284 TransformOption Extra ExtraOption
285 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
286 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
288 UpdateResult "$$AbsPath$$Basename.pdf"
289 Requirement "graphicx"
290 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
293 Product "[LilyPond: $$FName]"
296 Product "[LilyPond: $$FName]"
303 Includes PDF documents, using the 'pdfpages' package.
304 To include multiple pages, use the 'pages'-option,
305 which must be inserted to 'Options'.
307 * pages={x-y} (for a range of pages)
308 * pages={x,y,z} (for specific pages)
309 * pages=- (to include all pages)
310 * pages=last-1 (to include all pages in reverse order)
311 With the option 'noautoscale' the PDF pages are
312 inserted in their original size.
313 Read the documentation of the pdfpages package
314 for further options and details.
318 AutomaticProduction true
324 TransformOption Rotate RotationLatexOption
325 TransformOption Resize ResizeLatexOption
326 TransformOption Extra ExtraOption
327 Option Arg "[$$Extra,$$Rotate,$$Resize]"
328 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
330 UpdateResult "$$AbsPath$$Basename.pdf"
331 Requirement "pdfpages"
332 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
335 Product "[PDFPages: $$FName]"
338 Product "[PDFPages: $$FName]"
347 Read 'info date' for more information.
351 AutomaticProduction true
354 Product "$$Contents(\"$$Tempname\")"
356 UpdateResult "$$Tempname"
359 Product "$$Contents(\"$$Tempname\")"
361 UpdateResult "$$Tempname"
364 Product "$$Contents(\"$$Tempname\")"
366 UpdateResult "$$Tempname"
369 Product "$$Contents(\"$$Tempname\")"
371 UpdateResult "$$Tempname"
376 GuiName "Dia diagram"
382 AutomaticProduction true
383 # LyX has hard-coded support for these transformations
388 Preview InstantPreview
390 TransformOption Rotate RotationLatexOption
391 TransformOption Resize ResizeLatexOption
392 TransformOption Clip ClipLatexOption
393 TransformOption Extra ExtraOption
394 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
395 # This string is what is output to the LaTeX file.
396 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
398 UpdateResult "$$AbsPath$$Basename.eps"
399 Requirement "graphicx"
400 ReferencedFile latex "$$AbsPath$$Basename.eps"
401 ReferencedFile dvi "$$AbsPath$$Basename.eps"
404 TransformOption Rotate RotationLatexOption
405 TransformOption Resize ResizeLatexOption
406 TransformOption Clip ClipLatexOption
407 TransformOption Extra ExtraOption
408 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
409 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
411 UpdateResult "$$AbsPath$$Basename.pdf"
412 Requirement "graphicx"
413 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
416 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
417 UpdateFormat asciiimage
418 UpdateResult "$$AbsPath$$Basename.asc"
421 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
423 UpdateResult "$$AbsPath$$Basename.eps"
424 ReferencedFile docbook "$$AbsPath$$Basename.eps"
425 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"