]> git.lyx.org Git - features.git/blob - lib/external_templates
0eef01bdaee91af8bd845f52c9d2d0061ba99ea0
[features.git] / lib / external_templates
1 #
2 # file external_templates
3 # This file is part of LyX, the document processor.
4 # Licence details can be found in the file COPYING.
5 #
6 # author Asger Alstrup Nielsen
7 # author Angus Leeming
8 # author Johnathan Burchill
9 #
10 # Full author contact details are available in file CREDITS.
11
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.
20
21
22 PreambleDef WarnNotFound
23         %% Print a warning encased in an fbox.
24         \def\lyxstripprefix#1>{}
25         \newcommand{\warnNotFound}[1]{%
26                 \def\lyxtempfilename{#1}%
27                 \fbox{Could not find
28                         \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
29                 \typeout{Could not find \lyxtempfilename!}%
30         }
31 PreambleDefEnd
32
33
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}}}
38 PreambleDefEnd
39
40 Template GnumericSpreadsheet
41         GuiName "Spreadsheet"
42         HelpText
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.
48         HelpTextEnd
49         InputFormat "gnumeric"
50         FileFilter "*.{gnumeric,ods,xls}"
51         AutomaticProduction true
52         Format LaTeX
53                 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
54                 UpdateFormat latex
55                 UpdateResult "$$AbsPath$$Basename.tex"
56                 Requirement "color"
57                 Requirement "array"
58                 Requirement "longtable"
59                 Requirement "calc"
60                 Requirement "multirow"
61                 Requirement "hhline"
62                 Requirement "ifthen"
63                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.tex"
64                 FormatEnd
65         Format PDFLaTeX
66                 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
67                 UpdateFormat latex
68                 UpdateResult "$$AbsPath$$Basename.tex"
69                 Requirement "color"
70                 Requirement "array"
71                 Requirement "longtable"
72                 Requirement "calc"
73                 Requirement "multirow"
74                 Requirement "hhline"
75                 Requirement "ifthen"
76                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.tex"
77         FormatEnd
78 TemplateEnd
79
80 Template RasterImage
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.
87         HelpText
88                 A bitmap file.
89                 Use this template to include bitmap images of any kind except
90                 photos in JPEG format: These will be uncompressed by this
91                 template, therefore it is better to include them with a
92                 graphics inset, since the graphics inset preserves the
93                 compression if the pdflatex compiler is used.
94         HelpTextEnd
95         # ANY file type can be displayed as a RasterImage.
96         # Specifically, LyX will attempt to interrogate the file itself
97         # in order to deduce its format.
98         InputFormat "*"
99         # Globbing pattern used when browsing for a Raster image file.
100         FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
101         # Set to "true" if the file represented by the template
102         # must be generated by LyX.
103         AutomaticProduction true
104         # LyX has hard-coded support for these transformations
105         Transform Rotate
106         Transform Resize
107         Transform Clip
108         Transform Extra
109         # LyX preview options:
110         # Off: LyX will not attempt to show this material on screen.
111         # Graphics: LyX will attempt to show this material as-is or via a
112         #           conversion to a showable format.
113         # InstantPreview: LyX will attempt to use the 'instant preview'
114         #                 mechanism in order to show this material.
115         Preview Graphics
116         Format LaTeX
117                 TransformOption Rotate RotationLatexOption
118                 TransformOption Resize ResizeLatexOption
119                 TransformOption Clip   ClipLatexOption
120                 TransformOption Extra  ExtraOption
121                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
122                 # This string is what is output to the LaTeX file.
123                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
124                 UpdateFormat eps
125                 UpdateResult "$$AbsPath$$Basename.eps"
126                 Requirement "graphicx"
127                 ReferencedFile latex "$$AbsPath$$Basename.eps"
128                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
129         FormatEnd
130         Format PDFLaTeX
131                 TransformOption Rotate RotationLatexOption
132                 TransformOption Resize ResizeLatexOption
133                 TransformOption Clip   ClipLatexOption
134                 TransformOption Extra  ExtraOption
135                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
136                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
137                 UpdateFormat png
138                 UpdateResult "$$AbsPath$$Basename.png"
139                 Requirement "graphicx"
140                 ReferencedFile pdflatex "$$AbsPath$$Basename.png"
141         FormatEnd
142         Format Ascii
143                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
144                 UpdateFormat asciiimage
145                 UpdateResult "$$AbsPath$$Basename.asc"
146         FormatEnd
147         Format DocBook
148                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
149                 UpdateFormat eps
150                 UpdateResult "$$AbsPath$$Basename.eps"
151                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
152                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
153         FormatEnd
154 TemplateEnd
155
156 Template VectorGraphics
157         GuiName "Vector graphics"
158         HelpText
159                 A vector graphics file.
160                 Use this template to include vector graphics of any kind.
161                 LyX will try to retain the vector properties of the image for
162                 the final output.
163                 Note that specialized templates exist for Xfig figures and Dia diagrams.
164                 The specialized templates allow to automatically use the document font in
165                 the figures, which is not possible with this general template.
166         HelpTextEnd
167         # ANY file type can be displayed as a VectorGraphics.
168         # Specifically, LyX will attempt to interrogate the file itself
169         # in order to deduce its format.
170         InputFormat "*"
171         # Globbing pattern used when browsing for a vector graphics file.
172         # xfig, dia, fen and ly are exlcuded, since we have specialized templates
173         FileFilter "*.{agr,dot,emf,eps,odg,obj,sxd,svg,svgz,tgo,pdf,wmf}"
174         AutomaticProduction true
175         # LyX has hard-coded support for these transformations
176         Transform Rotate
177         Transform Resize
178         Transform Clip
179         Transform Extra
180         Preview Graphics
181         Format LaTeX
182                 TransformOption Rotate RotationLatexOption
183                 TransformOption Resize ResizeLatexOption
184                 TransformOption Clip   ClipLatexOption
185                 TransformOption Extra  ExtraOption
186                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
187                 # This string is what is output to the LaTeX file.
188                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
189                 UpdateFormat eps
190                 UpdateResult "$$AbsPath$$Basename.eps"
191                 Requirement "graphicx"
192                 ReferencedFile latex "$$AbsPath$$Basename.eps"
193                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
194         FormatEnd
195         Format PDFLaTeX
196                 TransformOption Rotate RotationLatexOption
197                 TransformOption Resize ResizeLatexOption
198                 TransformOption Clip   ClipLatexOption
199                 TransformOption Extra  ExtraOption
200                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
201                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
202                 UpdateFormat pdf6
203                 UpdateResult "$$AbsPath$$Basename.pdf"
204                 Requirement "graphicx"
205                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
206         FormatEnd
207         Format Ascii
208                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
209                 UpdateFormat asciiimage
210                 UpdateResult "$$AbsPath$$Basename.asc"
211         FormatEnd
212         Format DocBook
213                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
214                 UpdateFormat eps
215                 UpdateResult "$$AbsPath$$Basename.eps"
216                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
217                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
218         FormatEnd
219 TemplateEnd
220
221 Template XFig
222         GuiName "Xfig figure"
223         HelpText
224                 An Xfig figure.
225         HelpTextEnd
226         InputFormat fig
227         FileFilter "*.fig"
228         AutomaticProduction true
229         Transform Rotate
230         Transform Resize
231         Preview InstantPreview
232         Format LaTeX
233                 TransformCommand Rotate RotationLatexCommand
234                 TransformCommand Resize ResizeLatexCommand
235                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
236                 UpdateFormat pstex
237                 UpdateResult "$$AbsPath$$Basename.pstex_t"
238                 Requirement "color"
239                 Requirement "graphicx"
240                 # Preamble WarnNotFound
241                 # Preamble InputOrWarn
242                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
243                 ReferencedFile latex "$$AbsPath$$Basename.eps"
244                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
245         FormatEnd
246         Format PDFLaTeX
247                 TransformCommand Rotate RotationLatexCommand
248                 TransformCommand Resize ResizeLatexCommand
249                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
250                 UpdateFormat pdftex
251                 UpdateResult "$$AbsPath$$Basename.pdftex_t"
252                 Requirement "color"
253                 Requirement "graphicx"
254                 # Preamble WarnNotFound
255                 # Preamble InputOrWarn
256                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
257                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
258         FormatEnd
259         Format Ascii
260                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
261                 UpdateFormat asciixfig
262                 UpdateResult "$$AbsPath$$Basename.asc"
263         FormatEnd
264         Format DocBook
265                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
266                 UpdateFormat eps
267                 UpdateResult "$$AbsPath$$Basename.eps"
268                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
269                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
270         FormatEnd
271 TemplateEnd
272
273
274 Template ChessDiagram
275         GuiName "Chess diagram"
276         HelpText
277                 A chess position diagram.
278                 This template will use XBoard to edit the position.
279                 Use the 'File->Save Position' in XBoard to save
280                 the position that you want to display.
281                 Make sure to give it a '.fen' extension
282                 and remember to type in a relative path
283                 to the LyX document location.
284                 Within XBoard, use 'Edit->Edit Position'
285                 to enable general editing of the board.
286                 You might also check out the
287                 'Options->Test legality' option, and
288                 remember to middle and right click to
289                 insert new material in the board.
290                 In order for this to work, you have to
291                 put the bundled lyxskak.sty in a place
292                 that TeX will find it, and you will need
293                 to install the skak package from CTAN.
294         HelpTextEnd
295         InputFormat fen
296         FileFilter "*.fen"
297         AutomaticProduction true
298         Preview InstantPreview
299         Format LaTeX
300                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
301                 Requirement "chess"
302                 UpdateFormat fen
303                 UpdateResult "$$AbsPath$$Basename$$Extension"
304                 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
305         FormatEnd
306         Format PDFLaTeX
307                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
308                 Requirement "chess"
309                 UpdateFormat fen
310                 UpdateResult "$$AbsPath$$Basename$$Extension"
311                 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
312         FormatEnd
313         Format Ascii
314                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
315                 UpdateFormat asciichess
316                 UpdateResult "$$AbsPath$$Basename.asc"
317         FormatEnd
318         Format DocBook
319                 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
320         FormatEnd
321 TemplateEnd
322
323
324 Template LilyPond
325         GuiName "Lilypond typeset music"
326         HelpText
327                 Sheet music typeset by GNU LilyPond,
328                 converted to .pdf or .eps for inclusion
329                 Using .eps requires at least lilypond 2.6
330                 Using .pdf requires at least lilypond 2.9
331         HelpTextEnd
332         InputFormat "lilypond"
333         FileFilter "*.ly"
334         AutomaticProduction true
335         Transform Rotate
336         Transform Resize
337         Transform Clip
338         Transform Extra
339         Preview InstantPreview
340         Format LaTeX
341                 TransformOption Rotate RotationLatexOption
342                 TransformOption Resize ResizeLatexOption
343                 TransformOption Clip   ClipLatexOption
344                 TransformOption Extra  ExtraOption
345                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
346                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
347                 UpdateFormat eps
348                 UpdateResult "$$AbsPath$$Basename.eps"
349                 Requirement "graphicx"
350                 ReferencedFile latex "$$AbsPath$$Basename.eps"
351                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
352         FormatEnd
353         Format PDFLaTeX
354                 TransformOption Rotate RotationLatexOption
355                 TransformOption Resize ResizeLatexOption
356                 TransformOption Clip   ClipLatexOption
357                 TransformOption Extra  ExtraOption
358                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
359                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
360                 UpdateFormat pdf6
361                 UpdateResult "$$AbsPath$$Basename.pdf"
362                 Requirement "graphicx"
363                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
364         FormatEnd
365         Format Ascii
366                 Product "[LilyPond: $$FName]"
367         FormatEnd
368         Format DocBook
369                 Product "[LilyPond: $$FName]"
370         FormatEnd
371 TemplateEnd
372
373 Template PDFPages
374         GuiName "PDF pages"
375         HelpText
376                 Includes PDF documents, using the 'pdfpages' package.
377                 To include multiple pages, use the 'pages'-option,
378                 which must be inserted to 'Options'.
379                 Examples:
380                 * pages={x-y} (for a range of pages)
381                 * pages={x,y,z} (for specific pages)
382                 * pages=- (to include all pages)
383                 * pages=last-1 (to include all pages in reverse order)
384                 With the option 'noautoscale' the PDF pages are
385                 inserted in their original size.
386                 Read the documentation of the pdfpages package
387                 for further options and details.
388         HelpTextEnd
389         InputFormat pdf6
390         FileFilter "*.pdf"
391         AutomaticProduction true
392         Transform Rotate
393         Transform Resize
394         Transform Extra
395         Preview Graphics
396         Format LaTeX
397                 TransformOption Rotate RotationLatexOption
398                 TransformOption Resize ResizeLatexOption
399                 TransformOption Extra  ExtraOption
400                 Option Arg "[$$Extra,$$Rotate,$$Resize]"
401                 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
402                 UpdateFormat pdf6
403                 UpdateResult "$$AbsPath$$Basename.pdf"
404                 Requirement "pdfpages"
405                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
406         FormatEnd
407         Format Ascii
408                 Product "[PDFPages: $$FName]"
409         FormatEnd
410         Format DocBook
411                 Product "[PDFPages: $$FName]"
412         FormatEnd
413 TemplateEnd
414
415
416 Template Date
417         GuiName "Date"
418         HelpText
419                 Today's date.
420                 Read 'info date' for more information.
421         HelpTextEnd
422         InputFormat date
423         FileFilter "*"
424         AutomaticProduction true
425         Preview Off
426         Format LaTeX
427                 Product "$$Contents(\"$$Tempname\")"
428                 UpdateFormat dateout
429                 UpdateResult "$$Tempname"
430         FormatEnd
431         Format PDFLaTeX
432                 Product "$$Contents(\"$$Tempname\")"
433                 UpdateFormat dateout
434                 UpdateResult "$$Tempname"
435         FormatEnd
436         Format Ascii
437                 Product "$$Contents(\"$$Tempname\")"
438                 UpdateFormat dateout
439                 UpdateResult "$$Tempname"
440         FormatEnd
441         Format DocBook
442                 Product "$$Contents(\"$$Tempname\")"
443                 UpdateFormat dateout
444                 UpdateResult "$$Tempname"
445         FormatEnd
446 TemplateEnd
447
448 Template Dia
449         GuiName "Dia diagram"
450         HelpText
451                 Dia diagram.
452         HelpTextEnd
453         InputFormat dia
454         FileFilter "*.dia"
455         AutomaticProduction true
456         # LyX has hard-coded support for these transformations
457         Transform Rotate
458         Transform Resize
459         Transform Clip
460         Transform Extra
461         Preview InstantPreview
462         Format LaTeX
463                 TransformOption Rotate RotationLatexOption
464                 TransformOption Resize ResizeLatexOption
465                 TransformOption Clip   ClipLatexOption
466                 TransformOption Extra  ExtraOption
467                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
468                 # This string is what is output to the LaTeX file.
469                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
470                 UpdateFormat eps
471                 UpdateResult "$$AbsPath$$Basename.eps"
472                 Requirement "graphicx"
473                 ReferencedFile latex "$$AbsPath$$Basename.eps"
474                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
475         FormatEnd
476         Format PDFLaTeX
477                 TransformOption Rotate RotationLatexOption
478                 TransformOption Resize ResizeLatexOption
479                 TransformOption Clip   ClipLatexOption
480                 TransformOption Extra  ExtraOption
481                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
482                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
483                 UpdateFormat pdf6
484                 UpdateResult "$$AbsPath$$Basename.pdf"
485                 Requirement "graphicx"
486                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
487         FormatEnd
488         Format Ascii
489                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
490                 UpdateFormat asciiimage
491                 UpdateResult "$$AbsPath$$Basename.asc"
492         FormatEnd
493         Format DocBook
494                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
495                 UpdateFormat eps
496                 UpdateResult "$$AbsPath$$Basename.eps"
497                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
498                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
499         FormatEnd
500 TemplateEnd
501