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, 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 latex "$$AbsOrRelPathMaster$$Basename.tex"
77 # By default, InsetExternal is displayed as a grey button
78 # containing this text.
79 GuiName "Bitmap: $$AbsOrRelPathParent$$Basename"
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: $$AbsOrRelPathParent$$Basename"
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: $$AbsOrRelPathParent$$Basename"
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]"
301 GuiName "PDF pages: $$AbsOrRelPathParent$$Basename"
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 Read the documentation of the pdfpages package
311 for further options and details.
315 AutomaticProduction true
321 TransformOption Rotate RotationLatexOption
322 TransformOption Resize ResizeLatexOption
323 TransformOption Extra ExtraOption
324 Option Arg "[$$Extra,$$Rotate,$$Resize]"
325 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
327 UpdateResult "$$AbsPath$$Basename.pdf"
328 Requirement "pdfpages"
329 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
332 Product "[PDFPages: $$FName]"
335 Product "[PDFPages: $$FName]"
344 Read 'info date' for more information.
348 AutomaticProduction true
351 Product "$$Contents(\"$$Tempname\")"
353 UpdateResult "$$Tempname"
356 Product "$$Contents(\"$$Tempname\")"
358 UpdateResult "$$Tempname"
361 Product "$$Contents(\"$$Tempname\")"
363 UpdateResult "$$Tempname"
366 Product "$$Contents(\"$$Tempname\")"
368 UpdateResult "$$Tempname"
373 GuiName "Dia: $$AbsOrRelPathParent$$Basename"
379 AutomaticProduction true
380 # LyX has hard-coded support for these transformations
385 Preview InstantPreview
387 TransformOption Rotate RotationLatexOption
388 TransformOption Resize ResizeLatexOption
389 TransformOption Clip ClipLatexOption
390 TransformOption Extra ExtraOption
391 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
392 # This string is what is output to the LaTeX file.
393 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
395 UpdateResult "$$AbsPath$$Basename.eps"
396 Requirement "graphicx"
397 ReferencedFile latex "$$AbsPath$$Basename.eps"
398 ReferencedFile dvi "$$AbsPath$$Basename.eps"
401 TransformOption Rotate RotationLatexOption
402 TransformOption Resize ResizeLatexOption
403 TransformOption Clip ClipLatexOption
404 TransformOption Extra ExtraOption
405 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
406 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
408 UpdateResult "$$AbsPath$$Basename.pdf"
409 Requirement "graphicx"
410 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
413 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
414 UpdateFormat asciiimage
415 UpdateResult "$$AbsPath$$Basename.asc"
418 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
420 UpdateResult "$$AbsPath$$Basename.eps"
421 ReferencedFile docbook "$$AbsPath$$Basename.eps"
422 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"