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}}}
38 # By default, InsetExternal is displayed as a grey button
39 # containing this text.
40 GuiName "Bitmap: $$AbsOrRelPathParent$$Basename"
41 # This text is used in the External dialog.
42 # Provide enough information to explain to the user just
43 # what the template can provide him with.
47 # ANY file type can be displayed as a RasterImage.
48 # Specifically, LyX will attempt to interrogate the file itself
49 # in order to deduce its format.
51 # Globbing pattern used when browsing for a Raster image file.
52 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
53 # Set to "true" if the file represented by the template
54 # must be generated by LyX.
55 AutomaticProduction true
56 # LyX has hard-coded support for these transformations
61 # LyX preview options:
62 # Off: LyX will not attempt to show this material on screen.
63 # Graphics: LyX will attempt to show this material as-is or via a
64 # conversion to a showable format.
65 # InstantPreview: LyX will attempt to use the 'instant preview'
66 # mechanism in order to show this material.
69 TransformOption Rotate RotationLatexOption
70 TransformOption Resize ResizeLatexOption
71 TransformOption Clip ClipLatexOption
72 TransformOption Extra ExtraOption
73 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
74 # This string is what is output to the LaTeX file.
75 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
77 UpdateResult "$$AbsPath$$Basename.eps"
78 Requirement "graphicx"
79 ReferencedFile latex "$$AbsPath$$Basename.eps"
80 ReferencedFile dvi "$$AbsPath$$Basename.eps"
83 TransformOption Rotate RotationLatexOption
84 TransformOption Resize ResizeLatexOption
85 TransformOption Clip ClipLatexOption
86 TransformOption Extra ExtraOption
87 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
88 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
90 UpdateResult "$$AbsPath$$Basename.png"
91 Requirement "graphicx"
92 ReferencedFile pdflatex "$$AbsPath$$Basename.png"
95 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
96 UpdateFormat asciiimage
97 UpdateResult "$$AbsPath$$Basename.asc"
100 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
102 UpdateResult "$$AbsPath$$Basename.eps"
103 ReferencedFile docbook "$$AbsPath$$Basename.eps"
104 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
110 GuiName "Xfig: $$AbsOrRelPathParent$$Basename"
116 AutomaticProduction true
119 Preview InstantPreview
121 TransformCommand Rotate RotationLatexCommand
122 TransformCommand Resize ResizeLatexCommand
123 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
125 UpdateResult "$$AbsPath$$Basename.pstex_t"
127 Requirement "graphicx"
128 # Preamble WarnNotFound
129 # Preamble InputOrWarn
130 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
131 ReferencedFile latex "$$AbsPath$$Basename.eps"
132 ReferencedFile dvi "$$AbsPath$$Basename.eps"
135 TransformCommand Rotate RotationLatexCommand
136 TransformCommand Resize ResizeLatexCommand
137 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
139 UpdateResult "$$AbsPath$$Basename.pdftex_t"
141 Requirement "graphicx"
142 # Preamble WarnNotFound
143 # Preamble InputOrWarn
144 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
145 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
148 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
149 UpdateFormat asciixfig
150 UpdateResult "$$AbsPath$$Basename.asc"
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"
162 Template ChessDiagram
163 GuiName "Chess: $$AbsOrRelPathParent$$Basename"
165 A chess position diagram.
166 This template will use XBoard to edit the position.
167 Use the 'File->Save Position' in XBoard to save
168 the position that you want to display.
169 Make sure to give it a '.fen' extension
170 and remember to type in a relative path
171 to the LyX document location.
172 Within XBoard, use 'Edit->Edit Position'
173 to enable general editing of the board.
174 You might also check out the
175 'Options->Test legality' option, and
176 remember to middle and right click to
177 insert new material in the board.
178 In order for this to work, you have to
179 put the bundled lyxskak.sty in a place
180 that TeX will find it, and you will need
181 to install the skak package from CTAN.
185 AutomaticProduction true
186 Preview InstantPreview
188 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
191 UpdateResult "$$AbsPath$$Basename$$Extension"
192 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
195 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
198 UpdateResult "$$AbsPath$$Basename$$Extension"
199 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
202 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
203 UpdateFormat asciichess
204 UpdateResult "$$AbsPath$$Basename.asc"
207 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
213 GuiName "Lilypond typeset music"
215 Sheet music typeset by GNU LilyPond,
216 converted to .pdf or .eps for inclusion
217 Using .eps requires at least lilypond 2.6
218 Using .pdf requires at least lilypond 2.9
220 InputFormat "lilypond"
222 AutomaticProduction true
227 Preview InstantPreview
229 TransformOption Rotate RotationLatexOption
230 TransformOption Resize ResizeLatexOption
231 TransformOption Clip ClipLatexOption
232 TransformOption Extra ExtraOption
233 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
234 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
236 UpdateResult "$$AbsPath$$Basename.eps"
237 Requirement "graphicx"
238 ReferencedFile latex "$$AbsPath$$Basename.eps"
239 ReferencedFile dvi "$$AbsPath$$Basename.eps"
242 TransformOption Rotate RotationLatexOption
243 TransformOption Resize ResizeLatexOption
244 TransformOption Clip ClipLatexOption
245 TransformOption Extra ExtraOption
246 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
247 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
249 UpdateResult "$$AbsPath$$Basename.pdf"
250 Requirement "graphicx"
251 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
254 Product "[LilyPond: $$FName]"
257 Product "[LilyPond: $$FName]"
262 GuiName "PDF pages: $$AbsOrRelPathParent$$Basename"
264 Includes PDF documents, using the 'pdfpages' package.
265 To include multiple pages, use the 'pages'-option,
266 which must be inserted to 'Options'.
268 * pages={x-y} (for a range of pages)
269 * pages={x,y,z} (for specific pages)
270 * pages=- (to include all pages)
271 Read the documentation of the pdfpages package
272 for further options and details.
276 AutomaticProduction true
282 TransformOption Rotate RotationLatexOption
283 TransformOption Resize ResizeLatexOption
284 TransformOption Extra ExtraOption
285 Option Arg "[$$Extra,$$Rotate,$$Resize]"
286 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
288 UpdateResult "$$AbsPath$$Basename.pdf"
289 Requirement "pdfpages"
290 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
293 Product "[PDFPages: $$FName]"
296 Product "[PDFPages: $$FName]"
305 Read 'info date' for more information.
309 AutomaticProduction true
312 Product "$$Contents(\"$$Tempname\")"
314 UpdateResult "$$Tempname"
317 Product "$$Contents(\"$$Tempname\")"
319 UpdateResult "$$Tempname"
322 Product "$$Contents(\"$$Tempname\")"
324 UpdateResult "$$Tempname"
327 Product "$$Contents(\"$$Tempname\")"
329 UpdateResult "$$Tempname"
334 GuiName "Dia: $$AbsOrRelPathParent$$Basename"
340 AutomaticProduction true
341 # LyX has hard-coded support for these transformations
346 Preview InstantPreview
348 TransformOption Rotate RotationLatexOption
349 TransformOption Resize ResizeLatexOption
350 TransformOption Clip ClipLatexOption
351 TransformOption Extra ExtraOption
352 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
353 # This string is what is output to the LaTeX file.
354 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
356 UpdateResult "$$AbsPath$$Basename.eps"
357 Requirement "graphicx"
358 ReferencedFile latex "$$AbsPath$$Basename.eps"
359 ReferencedFile dvi "$$AbsPath$$Basename.eps"
362 TransformOption Rotate RotationLatexOption
363 TransformOption Resize ResizeLatexOption
364 TransformOption Clip ClipLatexOption
365 TransformOption Extra ExtraOption
366 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
367 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
369 UpdateResult "$$AbsPath$$Basename.pdf"
370 Requirement "graphicx"
371 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
374 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
375 UpdateFormat asciiimage
376 UpdateResult "$$AbsPath$$Basename.asc"
379 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
381 UpdateResult "$$AbsPath$$Basename.eps"
382 ReferencedFile docbook "$$AbsPath$$Basename.eps"
383 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"