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"
190 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
193 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
195 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
198 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
199 UpdateFormat asciichess
200 UpdateResult "$$AbsPath$$Basename.asc"
203 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
209 GuiName "Lilypond typeset music"
211 Sheet music typeset by GNU LilyPond,
212 converted to .pdf or .eps for inclusion
213 Using .eps requires at least lilypond 2.6
214 Using .pdf requires at least lilypond 2.9
216 InputFormat "lilypond"
218 AutomaticProduction true
223 Preview InstantPreview
225 TransformOption Rotate RotationLatexOption
226 TransformOption Resize ResizeLatexOption
227 TransformOption Clip ClipLatexOption
228 TransformOption Extra ExtraOption
229 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
230 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
232 UpdateResult "$$AbsPath$$Basename.eps"
233 Requirement "graphicx"
234 ReferencedFile latex "$$AbsPath$$Basename.eps"
235 ReferencedFile dvi "$$AbsPath$$Basename.eps"
238 TransformOption Rotate RotationLatexOption
239 TransformOption Resize ResizeLatexOption
240 TransformOption Clip ClipLatexOption
241 TransformOption Extra ExtraOption
242 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
243 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
245 UpdateResult "$$AbsPath$$Basename.pdf"
246 Requirement "graphicx"
247 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
250 Product "[LilyPond: $$FName]"
253 Product "[LilyPond: $$FName]"
258 GuiName "PDF pages: $$AbsOrRelPathParent$$Basename"
260 Includes PDF documents, using the 'pdfpages' package.
262 To include multiple pages, use the "pages"-option,
263 which must be inserted to "Options".
265 * pages={x-y} (for a range of pages)
266 * pages={x,y,z} (for specific pages)
267 * pages=- (to include all pages)
269 Read the documentation of the pdfpages package
270 for further options and details.
278 TransformOption Rotate RotationLatexOption
279 TransformOption Resize ResizeLatexOption
280 TransformOption Extra ExtraOption
281 Option Arg "[$$Extra,$$Rotate,$$Resize]"
282 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
284 UpdateResult "$$AbsPath$$Basename.pdf"
285 Requirement "pdfpages"
286 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
289 Product "[PDFPages: $$FName]"
292 Product "[PDFPages: $$FName]"
301 Read 'info date' for more information.
305 AutomaticProduction true
308 Product "$$Contents(\"$$Tempname\")"
310 UpdateResult "$$Tempname"
313 Product "$$Contents(\"$$Tempname\")"
315 UpdateResult "$$Tempname"
318 Product "$$Contents(\"$$Tempname\")"
320 UpdateResult "$$Tempname"
323 Product "$$Contents(\"$$Tempname\")"
325 UpdateResult "$$Tempname"