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,xlsx}"
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]"
85 Product "$$Contents(\"$$AbsPath$$Basename.html\")</p>"
86 UpdateFormat html_table
87 UpdateResult "$$AbsPath$$Basename.html"
92 # By default, InsetExternal is displayed as a grey button
93 # containing this text.
94 GuiName "Raster image"
95 # This text is used in the External dialog.
96 # Provide enough information to explain to the user just
97 # what the template can provide him with.
100 Use this template to include bitmap images of any kind.
102 # ANY file type can be displayed as a RasterImage.
103 # Specifically, LyX will attempt to interrogate the file itself
104 # in order to deduce its format.
106 # Globbing pattern used when browsing for a Raster image file.
107 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
108 # Set to "true" if the file represented by the template
109 # must be generated by LyX.
110 AutomaticProduction true
111 # LyX has hard-coded support for these transformations
116 # LyX preview options:
117 # Off: LyX will not attempt to show this material on screen.
118 # Graphics: LyX will attempt to show this material as-is or via a
119 # conversion to a showable format.
120 # InstantPreview: LyX will attempt to use the 'instant preview'
121 # mechanism in order to show this material.
124 TransformOption Rotate RotationLatexOption
125 TransformOption Resize ResizeLatexOption
126 TransformOption Clip ClipLatexOption
127 TransformOption Extra ExtraOption
128 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
129 # This string is what is output to the LaTeX file.
130 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
132 UpdateResult "$$AbsPath$$Basename.eps"
133 Requirement "graphicx"
134 ReferencedFile latex "$$AbsPath$$Basename.eps"
135 ReferencedFile dvi "$$AbsPath$$Basename.eps"
138 TransformOption Rotate RotationLatexOption
139 TransformOption Resize ResizeLatexOption
140 TransformOption Clip ClipLatexOption
141 TransformOption Extra ExtraOption
142 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
143 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
144 UpdateFormat "$$pngOrjpg"
145 UpdateResult "$$AbsPath$$Basename.$$pngOrjpg"
146 Requirement "graphicx"
147 ReferencedFile pdflatex "$$AbsPath$$Basename.$$pngOrjpg"
150 Product "[RasterImage: $$FName]"
153 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
155 UpdateResult "$$AbsPath$$Basename.eps"
156 ReferencedFile docbook "$$AbsPath$$Basename.eps"
157 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
160 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
162 UpdateResult "$$AbsPath$$Basename.png"
163 ReferencedFile xhtml "$$AbsPath$$Basename.png"
167 Template VectorGraphics
168 GuiName "Vector graphics"
170 A vector graphics file.
171 Use this template to include vector graphics of any kind.
172 LyX will try to retain the vector properties of the image for
174 Note that specialized templates exist for Xfig figures and Dia diagrams.
175 The specialized templates allow to automatically use the document font in
176 the figures, which is not possible with this general template.
178 # ANY file type can be displayed as a VectorGraphics.
179 # Specifically, LyX will attempt to interrogate the file itself
180 # in order to deduce its format.
182 # Globbing pattern used when browsing for a vector graphics file.
183 # xfig, dia, fen and ly are exlcuded, since we have specialized templates
184 FileFilter "*.{agr,dot,emf,eps,odg,obj,sxd,svg,svgz,tgo,pdf,wmf}"
185 AutomaticProduction true
186 # LyX has hard-coded support for these transformations
193 TransformOption Rotate RotationLatexOption
194 TransformOption Resize ResizeLatexOption
195 TransformOption Clip ClipLatexOption
196 TransformOption Extra ExtraOption
197 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
198 # This string is what is output to the LaTeX file.
199 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
201 UpdateResult "$$AbsPath$$Basename.eps"
202 Requirement "graphicx"
203 ReferencedFile latex "$$AbsPath$$Basename.eps"
204 ReferencedFile dvi "$$AbsPath$$Basename.eps"
207 TransformOption Rotate RotationLatexOption
208 TransformOption Resize ResizeLatexOption
209 TransformOption Clip ClipLatexOption
210 TransformOption Extra ExtraOption
211 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
212 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
214 UpdateResult "$$AbsPath$$Basename.pdf"
215 Requirement "graphicx"
216 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
219 Product "[VectorGraphics: $$FName]"
222 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
224 UpdateResult "$$AbsPath$$Basename.eps"
225 ReferencedFile docbook "$$AbsPath$$Basename.eps"
226 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
229 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
231 UpdateResult "$$AbsPath$$Basename.svg"
232 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
237 GuiName "Xfig figure"
243 AutomaticProduction true
246 Preview InstantPreview
248 TransformCommand Rotate RotationLatexCommand
249 TransformCommand Resize ResizeLatexCommand
250 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
252 UpdateResult "$$AbsPath$$Basename.pstex_t"
254 Requirement "graphicx"
255 # Preamble WarnNotFound
256 # Preamble InputOrWarn
257 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
258 ReferencedFile latex "$$AbsPath$$Basename.eps"
259 ReferencedFile dvi "$$AbsPath$$Basename.eps"
262 TransformCommand Rotate RotationLatexCommand
263 TransformCommand Resize ResizeLatexCommand
264 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
266 UpdateResult "$$AbsPath$$Basename.pdftex_t"
268 Requirement "graphicx"
269 # Preamble WarnNotFound
270 # Preamble InputOrWarn
271 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
272 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
275 Product "[XFig: $$FName]"
278 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
280 UpdateResult "$$AbsPath$$Basename.eps"
281 ReferencedFile docbook "$$AbsPath$$Basename.eps"
282 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
285 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
287 UpdateResult "$$AbsPath$$Basename.svg"
288 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
294 GuiName "Inkscape figure"
297 This template should work flawlessly with Inkscape 0.48.
298 For Inkscape 0.91, there is a bug in the LaTeX + PDF output
299 which makes a workaround necessary, see Embedded Objects manual.
303 AutomaticProduction true
305 Preview InstantPreview
307 TransformCommand Rotate RotationLatexCommand
308 # Resize is not desirable here, as fonts are sized to surrounding LaTeX font
309 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.pdf_tex}$$RotateBack"
311 UpdateResult "$$AbsPath$$Basename.pdf_tex"
313 Requirement "graphicx"
314 # Preamble WarnNotFound
315 # Preamble InputOrWarn
316 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdf_tex"
317 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
320 TransformCommand Rotate RotationLatexCommand
321 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.eps_tex}$$RotateBack"
323 UpdateResult "$$AbsPath$$Basename.eps_tex"
325 Requirement "graphicx"
326 # Preamble WarnNotFound
327 # Preamble InputOrWarn
328 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.eps_tex"
329 ReferencedFile latex "$$AbsPath$$Basename.eps"
330 ReferencedFile dvi "$$AbsPath$$Basename.eps"
335 Template ChessDiagram
336 GuiName "Chess diagram"
338 A chess position diagram.
339 This template will use XBoard to edit the position.
340 Use the 'File->Save Position' in XBoard to save
341 the position that you want to display.
342 Make sure to give it a '.fen' extension
343 and remember to type in a relative path
344 to the LyX document location.
345 Within XBoard, use 'Edit->Edit Position'
346 to enable general editing of the board.
347 You might also check out the
348 'Options->Test legality' option, and
349 remember to middle and right click to
350 insert new material in the board.
351 In order for this to work, you have to
352 put the bundled lyxskak.sty in a place
353 that TeX will find it, and you will need
354 to install the skak package from CTAN.
358 AutomaticProduction true
359 Preview InstantPreview
361 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
364 UpdateResult "$$AbsPath$$Basename$$Extension"
365 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
368 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
371 UpdateResult "$$AbsPath$$Basename$$Extension"
372 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
375 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
376 UpdateFormat asciichess
377 UpdateResult "$$AbsPath$$Basename.asc"
380 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
383 Product "<pre>$$Contents(\"$$AbsPath$$Basename.asc\")</pre>"
384 UpdateFormat asciichess
385 UpdateResult "$$AbsPath$$Basename.asc"
391 GuiName "Lilypond typeset music"
393 Sheet music typeset by GNU LilyPond,
394 converted to .pdf or .eps for inclusion
395 Using .eps requires at least lilypond 2.6
396 Using .pdf requires at least lilypond 2.9
398 InputFormat "lilypond"
400 AutomaticProduction true
405 Preview InstantPreview
407 TransformOption Rotate RotationLatexOption
408 TransformOption Resize ResizeLatexOption
409 TransformOption Clip ClipLatexOption
410 TransformOption Extra ExtraOption
411 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
412 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
414 UpdateResult "$$AbsPath$$Basename.eps"
415 Requirement "graphicx"
416 ReferencedFile latex "$$AbsPath$$Basename.eps"
417 ReferencedFile dvi "$$AbsPath$$Basename.eps"
420 TransformOption Rotate RotationLatexOption
421 TransformOption Resize ResizeLatexOption
422 TransformOption Clip ClipLatexOption
423 TransformOption Extra ExtraOption
424 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
425 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
427 UpdateResult "$$AbsPath$$Basename.pdf"
428 Requirement "graphicx"
429 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
432 Product "[LilyPond: $$FName]"
435 Product "[LilyPond: $$FName]"
438 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
440 UpdateResult "$$AbsPath$$Basename.png"
441 ReferencedFile xhtml "$$AbsPath$$Basename.png"
448 Includes PDF documents, using the 'pdfpages' package.
449 To include multiple pages, use the 'pages'-option,
450 which must be inserted to 'Options'.
452 * pages={x-y} (for a range of pages)
453 * pages={x,y,z} (for specific pages)
454 * pages=- (to include all pages)
455 * pages=last-1 (to include all pages in reverse order)
456 With the option 'noautoscale' the PDF pages are
457 inserted in their original size.
458 Read the documentation of the pdfpages package
459 for further options and details.
463 AutomaticProduction true
469 TransformOption Rotate RotationLatexOption
470 TransformOption Resize ResizeLatexOption
471 TransformOption Extra ExtraOption
472 Option Arg "[$$Extra,$$Rotate,$$Resize]"
473 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
475 UpdateResult "$$AbsPath$$Basename.pdf"
476 Requirement "pdfpages"
477 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
480 Product "[PDFPages: $$FName]"
483 Product "[PDFPages: $$FName]"
486 Product "[PDFPages: $$FName]"
492 GuiName "Dia diagram"
498 AutomaticProduction true
499 # LyX has hard-coded support for these transformations
504 Preview InstantPreview
506 TransformOption Rotate RotationLatexOption
507 TransformOption Resize ResizeLatexOption
508 TransformOption Clip ClipLatexOption
509 TransformOption Extra ExtraOption
510 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
511 # This string is what is output to the LaTeX file.
512 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
514 UpdateResult "$$AbsPath$$Basename.eps"
515 Requirement "graphicx"
516 ReferencedFile latex "$$AbsPath$$Basename.eps"
517 ReferencedFile dvi "$$AbsPath$$Basename.eps"
520 TransformOption Rotate RotationLatexOption
521 TransformOption Resize ResizeLatexOption
522 TransformOption Clip ClipLatexOption
523 TransformOption Extra ExtraOption
524 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
525 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
527 UpdateResult "$$AbsPath$$Basename.pdf"
528 Requirement "graphicx"
529 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
532 Product "[Dia: $$FName]"
535 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
537 UpdateResult "$$AbsPath$$Basename.eps"
538 ReferencedFile docbook "$$AbsPath$$Basename.eps"
539 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
542 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
544 UpdateResult "$$AbsPath$$Basename.svg"
545 ReferencedFile xhtml "$$AbsPath$$Basename.svg"