]> git.lyx.org Git - lyx.git/blob - lib/external_templates
1145f3ab0b737e1b783e75133bec6aa69d82b4e0
[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 "$$Contents(\"$$AbsPath$$Basename.asc\")"
146                 UpdateFormat asciiimage
147                 UpdateResult "$$AbsPath$$Basename.asc"
148         FormatEnd
149         Format DocBook
150                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
151                 UpdateFormat eps
152                 UpdateResult "$$AbsPath$$Basename.eps"
153                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
154                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
155         FormatEnd
156         Format XHTML
157                 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
158                 UpdateFormat png
159                 UpdateResult "$$AbsPath$$Basename.png"
160                 ReferencedFile xhtml "$$AbsPath$$Basename.png"
161         FormatEnd
162 TemplateEnd
163
164 Template VectorGraphics
165         GuiName "Vector graphics"
166         HelpText
167                 A vector graphics file.
168                 Use this template to include vector graphics of any kind.
169                 LyX will try to retain the vector properties of the image for
170                 the final output.
171                 Note that specialized templates exist for Xfig figures and Dia diagrams.
172                 The specialized templates allow to automatically use the document font in
173                 the figures, which is not possible with this general template.
174         HelpTextEnd
175         # ANY file type can be displayed as a VectorGraphics.
176         # Specifically, LyX will attempt to interrogate the file itself
177         # in order to deduce its format.
178         InputFormat "*"
179         # Globbing pattern used when browsing for a vector graphics file.
180         # xfig, dia, fen and ly are exlcuded, since we have specialized templates
181         FileFilter "*.{agr,dot,emf,eps,odg,obj,sxd,svg,svgz,tgo,pdf,wmf}"
182         AutomaticProduction true
183         # LyX has hard-coded support for these transformations
184         Transform Rotate
185         Transform Resize
186         Transform Clip
187         Transform Extra
188         Preview Graphics
189         Format LaTeX
190                 TransformOption Rotate RotationLatexOption
191                 TransformOption Resize ResizeLatexOption
192                 TransformOption Clip   ClipLatexOption
193                 TransformOption Extra  ExtraOption
194                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
195                 # This string is what is output to the LaTeX file.
196                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
197                 UpdateFormat eps
198                 UpdateResult "$$AbsPath$$Basename.eps"
199                 Requirement "graphicx"
200                 ReferencedFile latex "$$AbsPath$$Basename.eps"
201                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
202         FormatEnd
203         Format PDFLaTeX
204                 TransformOption Rotate RotationLatexOption
205                 TransformOption Resize ResizeLatexOption
206                 TransformOption Clip   ClipLatexOption
207                 TransformOption Extra  ExtraOption
208                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
209                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
210                 UpdateFormat pdf6
211                 UpdateResult "$$AbsPath$$Basename.pdf"
212                 Requirement "graphicx"
213                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
214         FormatEnd
215         Format Ascii
216                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
217                 UpdateFormat asciiimage
218                 UpdateResult "$$AbsPath$$Basename.asc"
219         FormatEnd
220         Format DocBook
221                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
222                 UpdateFormat eps
223                 UpdateResult "$$AbsPath$$Basename.eps"
224                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
225                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
226         FormatEnd
227         Format XHTML
228                 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
229                 UpdateFormat svg
230                 UpdateResult "$$AbsPath$$Basename.svg"
231                 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
232         FormatEnd
233 TemplateEnd
234
235 Template XFig
236         GuiName "Xfig figure"
237         HelpText
238                 An Xfig figure.
239         HelpTextEnd
240         InputFormat fig
241         FileFilter "*.fig"
242         AutomaticProduction true
243         Transform Rotate
244         Transform Resize
245         Preview InstantPreview
246         Format LaTeX
247                 TransformCommand Rotate RotationLatexCommand
248                 TransformCommand Resize ResizeLatexCommand
249                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
250                 UpdateFormat pstex
251                 UpdateResult "$$AbsPath$$Basename.pstex_t"
252                 Requirement "color"
253                 Requirement "graphicx"
254                 # Preamble WarnNotFound
255                 # Preamble InputOrWarn
256                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
257                 ReferencedFile latex "$$AbsPath$$Basename.eps"
258                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
259         FormatEnd
260         Format PDFLaTeX
261                 TransformCommand Rotate RotationLatexCommand
262                 TransformCommand Resize ResizeLatexCommand
263                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
264                 UpdateFormat pdftex
265                 UpdateResult "$$AbsPath$$Basename.pdftex_t"
266                 Requirement "color"
267                 Requirement "graphicx"
268                 # Preamble WarnNotFound
269                 # Preamble InputOrWarn
270                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
271                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
272         FormatEnd
273         Format Ascii
274                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
275                 UpdateFormat asciixfig
276                 UpdateResult "$$AbsPath$$Basename.asc"
277         FormatEnd
278         Format DocBook
279                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
280                 UpdateFormat eps
281                 UpdateResult "$$AbsPath$$Basename.eps"
282                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
283                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
284         FormatEnd
285         Format XHTML
286                 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
287                 UpdateFormat svg
288                 UpdateResult "$$AbsPath$$Basename.svg"
289                 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
290         FormatEnd
291 TemplateEnd
292
293
294 Template ChessDiagram
295         GuiName "Chess diagram"
296         HelpText
297                 A chess position diagram.
298                 This template will use XBoard to edit the position.
299                 Use the 'File->Save Position' in XBoard to save
300                 the position that you want to display.
301                 Make sure to give it a '.fen' extension
302                 and remember to type in a relative path
303                 to the LyX document location.
304                 Within XBoard, use 'Edit->Edit Position'
305                 to enable general editing of the board.
306                 You might also check out the
307                 'Options->Test legality' option, and
308                 remember to middle and right click to
309                 insert new material in the board.
310                 In order for this to work, you have to
311                 put the bundled lyxskak.sty in a place
312                 that TeX will find it, and you will need
313                 to install the skak package from CTAN.
314         HelpTextEnd
315         InputFormat fen
316         FileFilter "*.fen"
317         AutomaticProduction true
318         Preview InstantPreview
319         Format LaTeX
320                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
321                 Requirement "chess"
322                 UpdateFormat fen
323                 UpdateResult "$$AbsPath$$Basename$$Extension"
324                 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
325         FormatEnd
326         Format PDFLaTeX
327                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
328                 Requirement "chess"
329                 UpdateFormat fen
330                 UpdateResult "$$AbsPath$$Basename$$Extension"
331                 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
332         FormatEnd
333         Format Ascii
334                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
335                 UpdateFormat asciichess
336                 UpdateResult "$$AbsPath$$Basename.asc"
337         FormatEnd
338         Format DocBook
339                 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
340         FormatEnd
341         Format XHTML
342                 Product "<pre>$$Contents(\"$$AbsPath$$Basename.asc\")</pre>"
343                 UpdateFormat asciichess
344                 UpdateResult "$$AbsPath$$Basename.asc"
345         FormatEnd
346 TemplateEnd
347
348
349 Template LilyPond
350         GuiName "Lilypond typeset music"
351         HelpText
352                 Sheet music typeset by GNU LilyPond,
353                 converted to .pdf or .eps for inclusion
354                 Using .eps requires at least lilypond 2.6
355                 Using .pdf requires at least lilypond 2.9
356         HelpTextEnd
357         InputFormat "lilypond"
358         FileFilter "*.ly"
359         AutomaticProduction true
360         Transform Rotate
361         Transform Resize
362         Transform Clip
363         Transform Extra
364         Preview InstantPreview
365         Format LaTeX
366                 TransformOption Rotate RotationLatexOption
367                 TransformOption Resize ResizeLatexOption
368                 TransformOption Clip   ClipLatexOption
369                 TransformOption Extra  ExtraOption
370                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
371                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
372                 UpdateFormat eps
373                 UpdateResult "$$AbsPath$$Basename.eps"
374                 Requirement "graphicx"
375                 ReferencedFile latex "$$AbsPath$$Basename.eps"
376                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
377         FormatEnd
378         Format PDFLaTeX
379                 TransformOption Rotate RotationLatexOption
380                 TransformOption Resize ResizeLatexOption
381                 TransformOption Clip   ClipLatexOption
382                 TransformOption Extra  ExtraOption
383                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
384                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
385                 UpdateFormat pdf6
386                 UpdateResult "$$AbsPath$$Basename.pdf"
387                 Requirement "graphicx"
388                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
389         FormatEnd
390         Format Ascii
391                 Product "[LilyPond: $$FName]"
392         FormatEnd
393         Format DocBook
394                 Product "[LilyPond: $$FName]"
395         FormatEnd
396         Format XHTML
397                 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.png\" />"
398                 UpdateFormat png
399                 UpdateResult "$$AbsPath$$Basename.png"
400                 ReferencedFile xhtml "$$AbsPath$$Basename.png"
401         FormatEnd
402 TemplateEnd
403
404 Template PDFPages
405         GuiName "PDF pages"
406         HelpText
407                 Includes PDF documents, using the 'pdfpages' package.
408                 To include multiple pages, use the 'pages'-option,
409                 which must be inserted to 'Options'.
410                 Examples:
411                 * pages={x-y} (for a range of pages)
412                 * pages={x,y,z} (for specific pages)
413                 * pages=- (to include all pages)
414                 * pages=last-1 (to include all pages in reverse order)
415                 With the option 'noautoscale' the PDF pages are
416                 inserted in their original size.
417                 Read the documentation of the pdfpages package
418                 for further options and details.
419         HelpTextEnd
420         InputFormat pdf6
421         FileFilter "*.pdf"
422         AutomaticProduction true
423         Transform Rotate
424         Transform Resize
425         Transform Extra
426         Preview Graphics
427         Format LaTeX
428                 TransformOption Rotate RotationLatexOption
429                 TransformOption Resize ResizeLatexOption
430                 TransformOption Extra  ExtraOption
431                 Option Arg "[$$Extra,$$Rotate,$$Resize]"
432                 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
433                 UpdateFormat pdf6
434                 UpdateResult "$$AbsPath$$Basename.pdf"
435                 Requirement "pdfpages"
436                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
437         FormatEnd
438         Format Ascii
439                 Product "[PDFPages: $$FName]"
440         FormatEnd
441         Format DocBook
442                 Product "[PDFPages: $$FName]"
443         FormatEnd
444         Format XHTML
445                 Product "[PDFPages: $$FName]"
446         FormatEnd
447 TemplateEnd
448
449
450 Template Date
451         GuiName "Date"
452         HelpText
453                 Today's date.
454                 Read 'info date' for more information.
455         HelpTextEnd
456         InputFormat date
457         FileFilter "*"
458         AutomaticProduction true
459         Preview Off
460         Format LaTeX
461                 Product "$$Contents(\"$$Tempname\")"
462                 UpdateFormat dateout
463                 UpdateResult "$$Tempname"
464         FormatEnd
465         Format PDFLaTeX
466                 Product "$$Contents(\"$$Tempname\")"
467                 UpdateFormat dateout
468                 UpdateResult "$$Tempname"
469         FormatEnd
470         Format Ascii
471                 Product "$$Contents(\"$$Tempname\")"
472                 UpdateFormat dateout
473                 UpdateResult "$$Tempname"
474         FormatEnd
475         Format DocBook
476                 Product "$$Contents(\"$$Tempname\")"
477                 UpdateFormat dateout
478                 UpdateResult "$$Tempname"
479         FormatEnd
480 TemplateEnd
481
482 Template Dia
483         GuiName "Dia diagram"
484         HelpText
485                 Dia diagram.
486         HelpTextEnd
487         InputFormat dia
488         FileFilter "*.dia"
489         AutomaticProduction true
490         # LyX has hard-coded support for these transformations
491         Transform Rotate
492         Transform Resize
493         Transform Clip
494         Transform Extra
495         Preview InstantPreview
496         Format LaTeX
497                 TransformOption Rotate RotationLatexOption
498                 TransformOption Resize ResizeLatexOption
499                 TransformOption Clip   ClipLatexOption
500                 TransformOption Extra  ExtraOption
501                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
502                 # This string is what is output to the LaTeX file.
503                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
504                 UpdateFormat eps
505                 UpdateResult "$$AbsPath$$Basename.eps"
506                 Requirement "graphicx"
507                 ReferencedFile latex "$$AbsPath$$Basename.eps"
508                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
509         FormatEnd
510         Format PDFLaTeX
511                 TransformOption Rotate RotationLatexOption
512                 TransformOption Resize ResizeLatexOption
513                 TransformOption Clip   ClipLatexOption
514                 TransformOption Extra  ExtraOption
515                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
516                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
517                 UpdateFormat pdf6
518                 UpdateResult "$$AbsPath$$Basename.pdf"
519                 Requirement "graphicx"
520                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
521         FormatEnd
522         Format Ascii
523                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
524                 UpdateFormat asciiimage
525                 UpdateResult "$$AbsPath$$Basename.asc"
526         FormatEnd
527         Format DocBook
528                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
529                 UpdateFormat eps
530                 UpdateResult "$$AbsPath$$Basename.eps"
531                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
532                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
533         FormatEnd
534         Format XHTML
535                 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
536                 UpdateFormat svg
537                 UpdateResult "$$AbsPath$$Basename.svg"
538                 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
539         FormatEnd
540 TemplateEnd
541