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 long 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"
81 # By default, InsetExternal is displayed as a grey button
82 # containing this text.
83 GuiName "Raster image"
84 # This text is used in the External dialog.
85 # Provide enough information to explain to the user just
86 # what the template can provide him with.
90 # ANY file type can be displayed as a RasterImage.
91 # Specifically, LyX will attempt to interrogate the file itself
92 # in order to deduce its format.
94 # Globbing pattern used when browsing for a Raster image file.
95 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
96 # Set to "true" if the file represented by the template
97 # must be generated by LyX.
98 AutomaticProduction true
99 # LyX has hard-coded support for these transformations
104 # LyX preview options:
105 # Off: LyX will not attempt to show this material on screen.
106 # Graphics: LyX will attempt to show this material as-is or via a
107 # conversion to a showable format.
108 # InstantPreview: LyX will attempt to use the 'instant preview'
109 # mechanism in order to show this material.
112 TransformOption Rotate RotationLatexOption
113 TransformOption Resize ResizeLatexOption
114 TransformOption Clip ClipLatexOption
115 TransformOption Extra ExtraOption
116 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
117 # This string is what is output to the LaTeX file.
118 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
120 UpdateResult "$$AbsPath$$Basename.eps"
121 Requirement "graphicx"
122 ReferencedFile latex "$$AbsPath$$Basename.eps"
123 ReferencedFile dvi "$$AbsPath$$Basename.eps"
126 TransformOption Rotate RotationLatexOption
127 TransformOption Resize ResizeLatexOption
128 TransformOption Clip ClipLatexOption
129 TransformOption Extra ExtraOption
130 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
131 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
133 UpdateResult "$$AbsPath$$Basename.png"
134 Requirement "graphicx"
135 ReferencedFile pdflatex "$$AbsPath$$Basename.png"
138 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
139 UpdateFormat asciiimage
140 UpdateResult "$$AbsPath$$Basename.asc"
143 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
145 UpdateResult "$$AbsPath$$Basename.eps"
146 ReferencedFile docbook "$$AbsPath$$Basename.eps"
147 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
153 GuiName "Xfig figure"
159 AutomaticProduction true
162 Preview InstantPreview
164 TransformCommand Rotate RotationLatexCommand
165 TransformCommand Resize ResizeLatexCommand
166 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
168 UpdateResult "$$AbsPath$$Basename.pstex_t"
170 Requirement "graphicx"
171 # Preamble WarnNotFound
172 # Preamble InputOrWarn
173 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
174 ReferencedFile latex "$$AbsPath$$Basename.eps"
175 ReferencedFile dvi "$$AbsPath$$Basename.eps"
178 TransformCommand Rotate RotationLatexCommand
179 TransformCommand Resize ResizeLatexCommand
180 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
182 UpdateResult "$$AbsPath$$Basename.pdftex_t"
184 Requirement "graphicx"
185 # Preamble WarnNotFound
186 # Preamble InputOrWarn
187 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
188 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
191 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
192 UpdateFormat asciixfig
193 UpdateResult "$$AbsPath$$Basename.asc"
196 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
198 UpdateResult "$$AbsPath$$Basename.eps"
199 ReferencedFile docbook "$$AbsPath$$Basename.eps"
200 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
205 Template ChessDiagram
206 GuiName "Chess diagram"
208 A chess position diagram.
209 This template will use XBoard to edit the position.
210 Use the 'File->Save Position' in XBoard to save
211 the position that you want to display.
212 Make sure to give it a '.fen' extension
213 and remember to type in a relative path
214 to the LyX document location.
215 Within XBoard, use 'Edit->Edit Position'
216 to enable general editing of the board.
217 You might also check out the
218 'Options->Test legality' option, and
219 remember to middle and right click to
220 insert new material in the board.
221 In order for this to work, you have to
222 put the bundled lyxskak.sty in a place
223 that TeX will find it, and you will need
224 to install the skak package from CTAN.
228 AutomaticProduction true
229 Preview InstantPreview
231 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
234 UpdateResult "$$AbsPath$$Basename$$Extension"
235 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
238 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
241 UpdateResult "$$AbsPath$$Basename$$Extension"
242 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
245 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
246 UpdateFormat asciichess
247 UpdateResult "$$AbsPath$$Basename.asc"
250 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
256 GuiName "Lilypond typeset music"
258 Sheet music typeset by GNU LilyPond,
259 converted to .pdf or .eps for inclusion
260 Using .eps requires at least lilypond 2.6
261 Using .pdf requires at least lilypond 2.9
263 InputFormat "lilypond"
265 AutomaticProduction true
270 Preview InstantPreview
272 TransformOption Rotate RotationLatexOption
273 TransformOption Resize ResizeLatexOption
274 TransformOption Clip ClipLatexOption
275 TransformOption Extra ExtraOption
276 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
277 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
279 UpdateResult "$$AbsPath$$Basename.eps"
280 Requirement "graphicx"
281 ReferencedFile latex "$$AbsPath$$Basename.eps"
282 ReferencedFile dvi "$$AbsPath$$Basename.eps"
285 TransformOption Rotate RotationLatexOption
286 TransformOption Resize ResizeLatexOption
287 TransformOption Clip ClipLatexOption
288 TransformOption Extra ExtraOption
289 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
290 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
292 UpdateResult "$$AbsPath$$Basename.pdf"
293 Requirement "graphicx"
294 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
297 Product "[LilyPond: $$FName]"
300 Product "[LilyPond: $$FName]"
307 Includes PDF documents, using the 'pdfpages' package.
308 To include multiple pages, use the 'pages'-option,
309 which must be inserted to 'Options'.
311 * pages={x-y} (for a range of pages)
312 * pages={x,y,z} (for specific pages)
313 * pages=- (to include all pages)
314 * pages=last-1 (to include all pages in reverse order)
315 With the option 'noautoscale' the PDF pages are
316 inserted in their original size.
317 Read the documentation of the pdfpages package
318 for further options and details.
322 AutomaticProduction true
328 TransformOption Rotate RotationLatexOption
329 TransformOption Resize ResizeLatexOption
330 TransformOption Extra ExtraOption
331 Option Arg "[$$Extra,$$Rotate,$$Resize]"
332 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
334 UpdateResult "$$AbsPath$$Basename.pdf"
335 Requirement "pdfpages"
336 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
339 Product "[PDFPages: $$FName]"
342 Product "[PDFPages: $$FName]"
351 Read 'info date' for more information.
355 AutomaticProduction true
358 Product "$$Contents(\"$$Tempname\")"
360 UpdateResult "$$Tempname"
363 Product "$$Contents(\"$$Tempname\")"
365 UpdateResult "$$Tempname"
368 Product "$$Contents(\"$$Tempname\")"
370 UpdateResult "$$Tempname"
373 Product "$$Contents(\"$$Tempname\")"
375 UpdateResult "$$Tempname"
380 GuiName "Dia diagram"
386 AutomaticProduction true
387 # LyX has hard-coded support for these transformations
392 Preview InstantPreview
394 TransformOption Rotate RotationLatexOption
395 TransformOption Resize ResizeLatexOption
396 TransformOption Clip ClipLatexOption
397 TransformOption Extra ExtraOption
398 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
399 # This string is what is output to the LaTeX file.
400 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
402 UpdateResult "$$AbsPath$$Basename.eps"
403 Requirement "graphicx"
404 ReferencedFile latex "$$AbsPath$$Basename.eps"
405 ReferencedFile dvi "$$AbsPath$$Basename.eps"
408 TransformOption Rotate RotationLatexOption
409 TransformOption Resize ResizeLatexOption
410 TransformOption Clip ClipLatexOption
411 TransformOption Extra ExtraOption
412 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
413 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
415 UpdateResult "$$AbsPath$$Basename.pdf"
416 Requirement "graphicx"
417 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
420 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
421 UpdateFormat asciiimage
422 UpdateResult "$$AbsPath$$Basename.asc"
425 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
427 UpdateResult "$$AbsPath$$Basename.eps"
428 ReferencedFile docbook "$$AbsPath$$Basename.eps"
429 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"