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 "[RasterImage: $$FName]"
148 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
150 UpdateResult "$$AbsPath$$Basename.eps"
151 ReferencedFile docbook "$$AbsPath$$Basename.eps"
152 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
155 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
157 UpdateResult "$$AbsPath$$Basename.png"
158 ReferencedFile xhtml "$$AbsPath$$Basename.png"
162 Template VectorGraphics
163 GuiName "Vector graphics"
165 A vector graphics file.
166 Use this template to include vector graphics of any kind.
167 LyX will try to retain the vector properties of the image for
169 Note that specialized templates exist for Xfig figures and Dia diagrams.
170 The specialized templates allow to automatically use the document font in
171 the figures, which is not possible with this general template.
173 # ANY file type can be displayed as a VectorGraphics.
174 # Specifically, LyX will attempt to interrogate the file itself
175 # in order to deduce its format.
177 # Globbing pattern used when browsing for a vector graphics file.
178 # xfig, dia, fen and ly are exlcuded, since we have specialized templates
179 FileFilter "*.{agr,dot,emf,eps,odg,obj,sxd,svg,svgz,tgo,pdf,wmf}"
180 AutomaticProduction true
181 # LyX has hard-coded support for these transformations
188 TransformOption Rotate RotationLatexOption
189 TransformOption Resize ResizeLatexOption
190 TransformOption Clip ClipLatexOption
191 TransformOption Extra ExtraOption
192 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
193 # This string is what is output to the LaTeX file.
194 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
196 UpdateResult "$$AbsPath$$Basename.eps"
197 Requirement "graphicx"
198 ReferencedFile latex "$$AbsPath$$Basename.eps"
199 ReferencedFile dvi "$$AbsPath$$Basename.eps"
202 TransformOption Rotate RotationLatexOption
203 TransformOption Resize ResizeLatexOption
204 TransformOption Clip ClipLatexOption
205 TransformOption Extra ExtraOption
206 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
207 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
209 UpdateResult "$$AbsPath$$Basename.pdf"
210 Requirement "graphicx"
211 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
214 Product "[VectorGraphics: $$FName]"
217 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
219 UpdateResult "$$AbsPath$$Basename.eps"
220 ReferencedFile docbook "$$AbsPath$$Basename.eps"
221 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
224 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
226 UpdateResult "$$AbsPath$$Basename.svg"
227 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
232 GuiName "Xfig figure"
238 AutomaticProduction true
241 Preview InstantPreview
243 TransformCommand Rotate RotationLatexCommand
244 TransformCommand Resize ResizeLatexCommand
245 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
247 UpdateResult "$$AbsPath$$Basename.pstex_t"
249 Requirement "graphicx"
250 # Preamble WarnNotFound
251 # Preamble InputOrWarn
252 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
253 ReferencedFile latex "$$AbsPath$$Basename.eps"
254 ReferencedFile dvi "$$AbsPath$$Basename.eps"
257 TransformCommand Rotate RotationLatexCommand
258 TransformCommand Resize ResizeLatexCommand
259 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
261 UpdateResult "$$AbsPath$$Basename.pdftex_t"
263 Requirement "graphicx"
264 # Preamble WarnNotFound
265 # Preamble InputOrWarn
266 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
267 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
270 Product "[XFig: $$FName]"
273 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
275 UpdateResult "$$AbsPath$$Basename.eps"
276 ReferencedFile docbook "$$AbsPath$$Basename.eps"
277 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
280 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
282 UpdateResult "$$AbsPath$$Basename.svg"
283 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
288 Template ChessDiagram
289 GuiName "Chess diagram"
291 A chess position diagram.
292 This template will use XBoard to edit the position.
293 Use the 'File->Save Position' in XBoard to save
294 the position that you want to display.
295 Make sure to give it a '.fen' extension
296 and remember to type in a relative path
297 to the LyX document location.
298 Within XBoard, use 'Edit->Edit Position'
299 to enable general editing of the board.
300 You might also check out the
301 'Options->Test legality' option, and
302 remember to middle and right click to
303 insert new material in the board.
304 In order for this to work, you have to
305 put the bundled lyxskak.sty in a place
306 that TeX will find it, and you will need
307 to install the skak package from CTAN.
311 AutomaticProduction true
312 Preview InstantPreview
314 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
317 UpdateResult "$$AbsPath$$Basename$$Extension"
318 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
321 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
324 UpdateResult "$$AbsPath$$Basename$$Extension"
325 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
328 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
329 UpdateFormat asciichess
330 UpdateResult "$$AbsPath$$Basename.asc"
333 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
336 Product "<pre>$$Contents(\"$$AbsPath$$Basename.asc\")</pre>"
337 UpdateFormat asciichess
338 UpdateResult "$$AbsPath$$Basename.asc"
344 GuiName "Lilypond typeset music"
346 Sheet music typeset by GNU LilyPond,
347 converted to .pdf or .eps for inclusion
348 Using .eps requires at least lilypond 2.6
349 Using .pdf requires at least lilypond 2.9
351 InputFormat "lilypond"
353 AutomaticProduction true
358 Preview InstantPreview
360 TransformOption Rotate RotationLatexOption
361 TransformOption Resize ResizeLatexOption
362 TransformOption Clip ClipLatexOption
363 TransformOption Extra ExtraOption
364 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
365 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
367 UpdateResult "$$AbsPath$$Basename.eps"
368 Requirement "graphicx"
369 ReferencedFile latex "$$AbsPath$$Basename.eps"
370 ReferencedFile dvi "$$AbsPath$$Basename.eps"
373 TransformOption Rotate RotationLatexOption
374 TransformOption Resize ResizeLatexOption
375 TransformOption Clip ClipLatexOption
376 TransformOption Extra ExtraOption
377 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
378 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
380 UpdateResult "$$AbsPath$$Basename.pdf"
381 Requirement "graphicx"
382 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
385 Product "[LilyPond: $$FName]"
388 Product "[LilyPond: $$FName]"
391 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
393 UpdateResult "$$AbsPath$$Basename.png"
394 ReferencedFile xhtml "$$AbsPath$$Basename.png"
401 Includes PDF documents, using the 'pdfpages' package.
402 To include multiple pages, use the 'pages'-option,
403 which must be inserted to 'Options'.
405 * pages={x-y} (for a range of pages)
406 * pages={x,y,z} (for specific pages)
407 * pages=- (to include all pages)
408 * pages=last-1 (to include all pages in reverse order)
409 With the option 'noautoscale' the PDF pages are
410 inserted in their original size.
411 Read the documentation of the pdfpages package
412 for further options and details.
416 AutomaticProduction true
422 TransformOption Rotate RotationLatexOption
423 TransformOption Resize ResizeLatexOption
424 TransformOption Extra ExtraOption
425 Option Arg "[$$Extra,$$Rotate,$$Resize]"
426 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
428 UpdateResult "$$AbsPath$$Basename.pdf"
429 Requirement "pdfpages"
430 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
433 Product "[PDFPages: $$FName]"
436 Product "[PDFPages: $$FName]"
439 Product "[PDFPages: $$FName]"
445 GuiName "Dia diagram"
451 AutomaticProduction true
452 # LyX has hard-coded support for these transformations
457 Preview InstantPreview
459 TransformOption Rotate RotationLatexOption
460 TransformOption Resize ResizeLatexOption
461 TransformOption Clip ClipLatexOption
462 TransformOption Extra ExtraOption
463 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
464 # This string is what is output to the LaTeX file.
465 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
467 UpdateResult "$$AbsPath$$Basename.eps"
468 Requirement "graphicx"
469 ReferencedFile latex "$$AbsPath$$Basename.eps"
470 ReferencedFile dvi "$$AbsPath$$Basename.eps"
473 TransformOption Rotate RotationLatexOption
474 TransformOption Resize ResizeLatexOption
475 TransformOption Clip ClipLatexOption
476 TransformOption Extra ExtraOption
477 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
478 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
480 UpdateResult "$$AbsPath$$Basename.pdf"
481 Requirement "graphicx"
482 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
485 Product "[Dia: $$FName]"
488 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
490 UpdateResult "$$AbsPath$$Basename.eps"
491 ReferencedFile docbook "$$AbsPath$$Basename.eps"
492 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
495 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
497 UpdateResult "$$AbsPath$$Basename.svg"
498 ReferencedFile xhtml "$$AbsPath$$Basename.svg"