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