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