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
16 # Note that a user-defined external_templates file would replace this
17 # definition. Thus, if you would like to keep the external templates defined
18 # in this file, please copy this file and add on futher external templates
19 # to the end. For more information, see http://www.lyx.org/trac/ticket/3983.
22 PreambleDef WarnNotFound
23 %% Print a warning encased in an fbox.
24 \def\lyxstripprefix#1>{}
25 \newcommand{\warnNotFound}[1]{%
26 \def\lyxtempfilename{#1}%
28 \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
29 \typeout{Could not find \lyxtempfilename!}%
34 PreambleDef InputOrWarn
35 %% Input the file if it exists, using \input, else print a warning
36 \newcommand{\inputOrWarn}[1]{%
37 \IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
40 Template GnumericSpreadsheet
43 A spreadsheet made with Gnumeric, LibreOffice, OpenOffice or Excel.
44 It imports as a multi-page table, so any length
45 is ok. Excessive width could be a problem.
46 The gnumeric software is necessary for conversion,
47 both for gnumeric and excel files.
49 InputFormat "gnumeric"
50 FileFilter "*.{gnumeric,ods,xls}"
51 AutomaticProduction true
53 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
55 UpdateResult "$$AbsPath$$Basename.tex"
58 Requirement "longtable"
60 Requirement "multirow"
63 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.tex"
66 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
68 UpdateResult "$$AbsPath$$Basename.tex"
71 Requirement "longtable"
73 Requirement "multirow"
76 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.tex"
79 Product "[Spreadsheet: $$FName]"
82 Product "[Spreadsheet: $$FName]"
87 # By default, InsetExternal is displayed as a grey button
88 # containing this text.
89 GuiName "Raster image"
90 # This text is used in the External dialog.
91 # Provide enough information to explain to the user just
92 # what the template can provide him with.
95 Use this template to include bitmap images of any kind.
97 # ANY file type can be displayed as a RasterImage.
98 # Specifically, LyX will attempt to interrogate the file itself
99 # in order to deduce its format.
101 # Globbing pattern used when browsing for a Raster image file.
102 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
103 # Set to "true" if the file represented by the template
104 # must be generated by LyX.
105 AutomaticProduction true
106 # LyX has hard-coded support for these transformations
111 # LyX preview options:
112 # Off: LyX will not attempt to show this material on screen.
113 # Graphics: LyX will attempt to show this material as-is or via a
114 # conversion to a showable format.
115 # InstantPreview: LyX will attempt to use the 'instant preview'
116 # mechanism in order to show this material.
119 TransformOption Rotate RotationLatexOption
120 TransformOption Resize ResizeLatexOption
121 TransformOption Clip ClipLatexOption
122 TransformOption Extra ExtraOption
123 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
124 # This string is what is output to the LaTeX file.
125 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
127 UpdateResult "$$AbsPath$$Basename.eps"
128 Requirement "graphicx"
129 ReferencedFile latex "$$AbsPath$$Basename.eps"
130 ReferencedFile dvi "$$AbsPath$$Basename.eps"
133 TransformOption Rotate RotationLatexOption
134 TransformOption Resize ResizeLatexOption
135 TransformOption Clip ClipLatexOption
136 TransformOption Extra ExtraOption
137 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
138 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
139 UpdateFormat "$$pngOrjpg"
140 UpdateResult "$$AbsPath$$Basename.$$pngOrjpg"
141 Requirement "graphicx"
142 ReferencedFile pdflatex "$$AbsPath$$Basename.$$pngOrjpg"
145 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
146 UpdateFormat asciiimage
147 UpdateResult "$$AbsPath$$Basename.asc"
150 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
152 UpdateResult "$$AbsPath$$Basename.eps"
153 ReferencedFile docbook "$$AbsPath$$Basename.eps"
154 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
157 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
159 UpdateResult "$$AbsPath$$Basename.png"
160 ReferencedFile xhtml "$$AbsPath$$Basename.png"
164 Template VectorGraphics
165 GuiName "Vector graphics"
167 A vector graphics file.
168 Use this template to include vector graphics of any kind.
169 LyX will try to retain the vector properties of the image for
171 Note that specialized templates exist for Xfig figures and Dia diagrams.
172 The specialized templates allow to automatically use the document font in
173 the figures, which is not possible with this general template.
175 # ANY file type can be displayed as a VectorGraphics.
176 # Specifically, LyX will attempt to interrogate the file itself
177 # in order to deduce its format.
179 # Globbing pattern used when browsing for a vector graphics file.
180 # xfig, dia, fen and ly are exlcuded, since we have specialized templates
181 FileFilter "*.{agr,dot,emf,eps,odg,obj,sxd,svg,svgz,tgo,pdf,wmf}"
182 AutomaticProduction true
183 # LyX has hard-coded support for these transformations
190 TransformOption Rotate RotationLatexOption
191 TransformOption Resize ResizeLatexOption
192 TransformOption Clip ClipLatexOption
193 TransformOption Extra ExtraOption
194 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
195 # This string is what is output to the LaTeX file.
196 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
198 UpdateResult "$$AbsPath$$Basename.eps"
199 Requirement "graphicx"
200 ReferencedFile latex "$$AbsPath$$Basename.eps"
201 ReferencedFile dvi "$$AbsPath$$Basename.eps"
204 TransformOption Rotate RotationLatexOption
205 TransformOption Resize ResizeLatexOption
206 TransformOption Clip ClipLatexOption
207 TransformOption Extra ExtraOption
208 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
209 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
211 UpdateResult "$$AbsPath$$Basename.pdf"
212 Requirement "graphicx"
213 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
216 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
217 UpdateFormat asciiimage
218 UpdateResult "$$AbsPath$$Basename.asc"
221 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
223 UpdateResult "$$AbsPath$$Basename.eps"
224 ReferencedFile docbook "$$AbsPath$$Basename.eps"
225 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
228 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
230 UpdateResult "$$AbsPath$$Basename.svg"
231 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
236 GuiName "Xfig figure"
242 AutomaticProduction true
245 Preview InstantPreview
247 TransformCommand Rotate RotationLatexCommand
248 TransformCommand Resize ResizeLatexCommand
249 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
251 UpdateResult "$$AbsPath$$Basename.pstex_t"
253 Requirement "graphicx"
254 # Preamble WarnNotFound
255 # Preamble InputOrWarn
256 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
257 ReferencedFile latex "$$AbsPath$$Basename.eps"
258 ReferencedFile dvi "$$AbsPath$$Basename.eps"
261 TransformCommand Rotate RotationLatexCommand
262 TransformCommand Resize ResizeLatexCommand
263 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
265 UpdateResult "$$AbsPath$$Basename.pdftex_t"
267 Requirement "graphicx"
268 # Preamble WarnNotFound
269 # Preamble InputOrWarn
270 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
271 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
274 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
275 UpdateFormat asciixfig
276 UpdateResult "$$AbsPath$$Basename.asc"
279 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
281 UpdateResult "$$AbsPath$$Basename.eps"
282 ReferencedFile docbook "$$AbsPath$$Basename.eps"
283 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
286 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
288 UpdateResult "$$AbsPath$$Basename.svg"
289 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
294 Template ChessDiagram
295 GuiName "Chess diagram"
297 A chess position diagram.
298 This template will use XBoard to edit the position.
299 Use the 'File->Save Position' in XBoard to save
300 the position that you want to display.
301 Make sure to give it a '.fen' extension
302 and remember to type in a relative path
303 to the LyX document location.
304 Within XBoard, use 'Edit->Edit Position'
305 to enable general editing of the board.
306 You might also check out the
307 'Options->Test legality' option, and
308 remember to middle and right click to
309 insert new material in the board.
310 In order for this to work, you have to
311 put the bundled lyxskak.sty in a place
312 that TeX will find it, and you will need
313 to install the skak package from CTAN.
317 AutomaticProduction true
318 Preview InstantPreview
320 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
323 UpdateResult "$$AbsPath$$Basename$$Extension"
324 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
327 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
330 UpdateResult "$$AbsPath$$Basename$$Extension"
331 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
334 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
335 UpdateFormat asciichess
336 UpdateResult "$$AbsPath$$Basename.asc"
339 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
342 Product "<pre>$$Contents(\"$$AbsPath$$Basename.asc\")</pre>"
343 UpdateFormat asciichess
344 UpdateResult "$$AbsPath$$Basename.asc"
350 GuiName "Lilypond typeset music"
352 Sheet music typeset by GNU LilyPond,
353 converted to .pdf or .eps for inclusion
354 Using .eps requires at least lilypond 2.6
355 Using .pdf requires at least lilypond 2.9
357 InputFormat "lilypond"
359 AutomaticProduction true
364 Preview InstantPreview
366 TransformOption Rotate RotationLatexOption
367 TransformOption Resize ResizeLatexOption
368 TransformOption Clip ClipLatexOption
369 TransformOption Extra ExtraOption
370 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
371 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
373 UpdateResult "$$AbsPath$$Basename.eps"
374 Requirement "graphicx"
375 ReferencedFile latex "$$AbsPath$$Basename.eps"
376 ReferencedFile dvi "$$AbsPath$$Basename.eps"
379 TransformOption Rotate RotationLatexOption
380 TransformOption Resize ResizeLatexOption
381 TransformOption Clip ClipLatexOption
382 TransformOption Extra ExtraOption
383 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
384 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
386 UpdateResult "$$AbsPath$$Basename.pdf"
387 Requirement "graphicx"
388 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
391 Product "[LilyPond: $$FName]"
394 Product "[LilyPond: $$FName]"
397 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
399 UpdateResult "$$AbsPath$$Basename.png"
400 ReferencedFile xhtml "$$AbsPath$$Basename.png"
407 Includes PDF documents, using the 'pdfpages' package.
408 To include multiple pages, use the 'pages'-option,
409 which must be inserted to 'Options'.
411 * pages={x-y} (for a range of pages)
412 * pages={x,y,z} (for specific pages)
413 * pages=- (to include all pages)
414 * pages=last-1 (to include all pages in reverse order)
415 With the option 'noautoscale' the PDF pages are
416 inserted in their original size.
417 Read the documentation of the pdfpages package
418 for further options and details.
422 AutomaticProduction true
428 TransformOption Rotate RotationLatexOption
429 TransformOption Resize ResizeLatexOption
430 TransformOption Extra ExtraOption
431 Option Arg "[$$Extra,$$Rotate,$$Resize]"
432 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
434 UpdateResult "$$AbsPath$$Basename.pdf"
435 Requirement "pdfpages"
436 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
439 Product "[PDFPages: $$FName]"
442 Product "[PDFPages: $$FName]"
445 Product "[PDFPages: $$FName]"
454 Read 'info date' for more information.
458 AutomaticProduction true
461 Product "$$Contents(\"$$Tempname\")"
463 UpdateResult "$$Tempname"
466 Product "$$Contents(\"$$Tempname\")"
468 UpdateResult "$$Tempname"
471 Product "$$Contents(\"$$Tempname\")"
473 UpdateResult "$$Tempname"
476 Product "$$Contents(\"$$Tempname\")"
478 UpdateResult "$$Tempname"
483 GuiName "Dia diagram"
489 AutomaticProduction true
490 # LyX has hard-coded support for these transformations
495 Preview InstantPreview
497 TransformOption Rotate RotationLatexOption
498 TransformOption Resize ResizeLatexOption
499 TransformOption Clip ClipLatexOption
500 TransformOption Extra ExtraOption
501 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
502 # This string is what is output to the LaTeX file.
503 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
505 UpdateResult "$$AbsPath$$Basename.eps"
506 Requirement "graphicx"
507 ReferencedFile latex "$$AbsPath$$Basename.eps"
508 ReferencedFile dvi "$$AbsPath$$Basename.eps"
511 TransformOption Rotate RotationLatexOption
512 TransformOption Resize ResizeLatexOption
513 TransformOption Clip ClipLatexOption
514 TransformOption Extra ExtraOption
515 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
516 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
518 UpdateResult "$$AbsPath$$Basename.pdf"
519 Requirement "graphicx"
520 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
523 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
524 UpdateFormat asciiimage
525 UpdateResult "$$AbsPath$$Basename.asc"
528 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
530 UpdateResult "$$AbsPath$$Basename.eps"
531 ReferencedFile docbook "$$AbsPath$$Basename.eps"
532 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
535 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
537 UpdateResult "$$AbsPath$$Basename.svg"
538 ReferencedFile xhtml "$$AbsPath$$Basename.svg"