]> git.lyx.org Git - lyx.git/blob - lib/external_templates
Merge remote-tracking branch 'origin/master' into features/latexargs
[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
17
18 PreambleDef WarnNotFound
19         %% Print a warning encased in an fbox.
20         \def\lyxstripprefix#1>{}
21         \newcommand{\warnNotFound}[1]{%
22                 \def\lyxtempfilename{#1}%
23                 \fbox{Could not find
24                         \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
25                 \typeout{Could not find \lyxtempfilename!}%
26         }
27 PreambleDefEnd
28
29
30 PreambleDef InputOrWarn
31         %% Input the file if it exists, using \input, else print a warning
32         \newcommand{\inputOrWarn}[1]{%
33                 \IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
34 PreambleDefEnd
35
36 Template GnumericSpreadsheet
37         GuiName "Spreadsheet"
38         HelpText
39                 A spreadsheet made with Gnumeric, LibreOffice, OpenOffice or Excel.
40                 It imports as a long table, so any length
41                 is ok. Excessive width could be a problem.
42                 The gnumeric software is necessary for conversion,
43                 both for gnumeric and excel files.
44         HelpTextEnd
45         InputFormat "gnumeric"
46         FileFilter "*.{gnumeric,ods,xls}"
47         AutomaticProduction true
48         Format LaTeX
49                 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
50                 UpdateFormat latex
51                 UpdateResult "$$AbsPath$$Basename.tex"
52                 Requirement "color"
53                 Requirement "array"
54                 Requirement "longtable"
55                 Requirement "calc"
56                 Requirement "multirow"
57                 Requirement "hhline"
58                 Requirement "ifthen"
59                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.tex"
60                 FormatEnd
61         Format PDFLaTeX
62                 Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}"
63                 UpdateFormat latex
64                 UpdateResult "$$AbsPath$$Basename.tex"
65                 Requirement "color"
66                 Requirement "array"
67                 Requirement "longtable"
68                 Requirement "calc"
69                 Requirement "multirow"
70                 Requirement "hhline"
71                 Requirement "ifthen"
72                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.tex"
73         FormatEnd
74 TemplateEnd
75
76 Template RasterImage
77         # By default, InsetExternal is displayed as a grey button
78         # containing this text.
79         GuiName "Raster image"
80         # This text is used in the External dialog.
81         # Provide enough information to explain to the user just
82         # what the template can provide him with.
83         HelpText
84                 A bitmap file.
85         HelpTextEnd
86         # ANY file type can be displayed as a RasterImage.
87         # Specifically, LyX will attempt to interrogate the file itself
88         # in order to deduce its format.
89         InputFormat "*"
90         # Globbing pattern used when browsing for a Raster image file.
91         FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
92         # Set to "true" if the file represented by the template
93         # must be generated by LyX.
94         AutomaticProduction true
95         # LyX has hard-coded support for these transformations
96         Transform Rotate
97         Transform Resize
98         Transform Clip
99         Transform Extra
100         # LyX preview options:
101         # Off: LyX will not attempt to show this material on screen.
102         # Graphics: LyX will attempt to show this material as-is or via a
103         #           conversion to a showable format.
104         # InstantPreview: LyX will attempt to use the 'instant preview'
105         #                 mechanism in order to show this material.
106         Preview Graphics
107         Format LaTeX
108                 TransformOption Rotate RotationLatexOption
109                 TransformOption Resize ResizeLatexOption
110                 TransformOption Clip   ClipLatexOption
111                 TransformOption Extra  ExtraOption
112                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
113                 # This string is what is output to the LaTeX file.
114                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
115                 UpdateFormat eps
116                 UpdateResult "$$AbsPath$$Basename.eps"
117                 Requirement "graphicx"
118                 ReferencedFile latex "$$AbsPath$$Basename.eps"
119                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
120         FormatEnd
121         Format PDFLaTeX
122                 TransformOption Rotate RotationLatexOption
123                 TransformOption Resize ResizeLatexOption
124                 TransformOption Clip   ClipLatexOption
125                 TransformOption Extra  ExtraOption
126                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
127                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
128                 UpdateFormat png
129                 UpdateResult "$$AbsPath$$Basename.png"
130                 Requirement "graphicx"
131                 ReferencedFile pdflatex "$$AbsPath$$Basename.png"
132         FormatEnd
133         Format Ascii
134                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
135                 UpdateFormat asciiimage
136                 UpdateResult "$$AbsPath$$Basename.asc"
137         FormatEnd
138         Format DocBook
139                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
140                 UpdateFormat eps
141                 UpdateResult "$$AbsPath$$Basename.eps"
142                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
143                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
144         FormatEnd
145 TemplateEnd
146
147
148 Template XFig
149         GuiName "Xfig figure"
150         HelpText
151                 An Xfig figure.
152         HelpTextEnd
153         InputFormat fig
154         FileFilter "*.fig"
155         AutomaticProduction true
156         Transform Rotate
157         Transform Resize
158         Preview InstantPreview
159         Format LaTeX
160                 TransformCommand Rotate RotationLatexCommand
161                 TransformCommand Resize ResizeLatexCommand
162                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
163                 UpdateFormat pstex
164                 UpdateResult "$$AbsPath$$Basename.pstex_t"
165                 Requirement "color"
166                 Requirement "graphicx"
167                 # Preamble WarnNotFound
168                 # Preamble InputOrWarn
169                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
170                 ReferencedFile latex "$$AbsPath$$Basename.eps"
171                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
172         FormatEnd
173         Format PDFLaTeX
174                 TransformCommand Rotate RotationLatexCommand
175                 TransformCommand Resize ResizeLatexCommand
176                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
177                 UpdateFormat pdftex
178                 UpdateResult "$$AbsPath$$Basename.pdftex_t"
179                 Requirement "color"
180                 Requirement "graphicx"
181                 # Preamble WarnNotFound
182                 # Preamble InputOrWarn
183                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
184                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
185         FormatEnd
186         Format Ascii
187                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
188                 UpdateFormat asciixfig
189                 UpdateResult "$$AbsPath$$Basename.asc"
190         FormatEnd
191         Format DocBook
192                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
193                 UpdateFormat eps
194                 UpdateResult "$$AbsPath$$Basename.eps"
195                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
196                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
197         FormatEnd
198 TemplateEnd
199
200
201 Template ChessDiagram
202         GuiName "Chess diagram"
203         HelpText
204                 A chess position diagram.
205                 This template will use XBoard to edit the position.
206                 Use the 'File->Save Position' in XBoard to save
207                 the position that you want to display.
208                 Make sure to give it a '.fen' extension
209                 and remember to type in a relative path
210                 to the LyX document location.
211                 Within XBoard, use 'Edit->Edit Position'
212                 to enable general editing of the board.
213                 You might also check out the
214                 'Options->Test legality' option, and
215                 remember to middle and right click to
216                 insert new material in the board.
217                 In order for this to work, you have to
218                 put the bundled lyxskak.sty in a place
219                 that TeX will find it, and you will need
220                 to install the skak package from CTAN.
221         HelpTextEnd
222         InputFormat fen
223         FileFilter "*.fen"
224         AutomaticProduction true
225         Preview InstantPreview
226         Format LaTeX
227                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
228                 Requirement "chess"
229                 UpdateFormat fen
230                 UpdateResult "$$AbsPath$$Basename$$Extension"
231                 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
232         FormatEnd
233         Format PDFLaTeX
234                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
235                 Requirement "chess"
236                 UpdateFormat fen
237                 UpdateResult "$$AbsPath$$Basename$$Extension"
238                 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
239         FormatEnd
240         Format Ascii
241                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
242                 UpdateFormat asciichess
243                 UpdateResult "$$AbsPath$$Basename.asc"
244         FormatEnd
245         Format DocBook
246                 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
247         FormatEnd
248 TemplateEnd
249
250
251 Template LilyPond
252         GuiName "Lilypond typeset music"
253         HelpText
254                 Sheet music typeset by GNU LilyPond,
255                 converted to .pdf or .eps for inclusion
256                 Using .eps requires at least lilypond 2.6
257                 Using .pdf requires at least lilypond 2.9
258         HelpTextEnd
259         InputFormat "lilypond"
260         FileFilter "*.ly"
261         AutomaticProduction true
262         Transform Rotate
263         Transform Resize
264         Transform Clip
265         Transform Extra
266         Preview InstantPreview
267         Format LaTeX
268                 TransformOption Rotate RotationLatexOption
269                 TransformOption Resize ResizeLatexOption
270                 TransformOption Clip   ClipLatexOption
271                 TransformOption Extra  ExtraOption
272                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
273                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
274                 UpdateFormat eps
275                 UpdateResult "$$AbsPath$$Basename.eps"
276                 Requirement "graphicx"
277                 ReferencedFile latex "$$AbsPath$$Basename.eps"
278                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
279         FormatEnd
280         Format PDFLaTeX
281                 TransformOption Rotate RotationLatexOption
282                 TransformOption Resize ResizeLatexOption
283                 TransformOption Clip   ClipLatexOption
284                 TransformOption Extra  ExtraOption
285                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
286                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
287                 UpdateFormat pdf
288                 UpdateResult "$$AbsPath$$Basename.pdf"
289                 Requirement "graphicx"
290                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
291         FormatEnd
292         Format Ascii
293                 Product "[LilyPond: $$FName]"
294         FormatEnd
295         Format DocBook
296                 Product "[LilyPond: $$FName]"
297         FormatEnd
298 TemplateEnd
299
300 Template PDFPages
301         GuiName "PDF pages"
302         HelpText
303                 Includes PDF documents, using the 'pdfpages' package.
304                 To include multiple pages, use the 'pages'-option,
305                 which must be inserted to 'Options'.
306                 Examples:
307                 * pages={x-y} (for a range of pages)
308                 * pages={x,y,z} (for specific pages)
309                 * pages=- (to include all pages)
310                 * pages=last-1 (to include all pages in reverse order)
311                 With the option 'noautoscale' the PDF pages are
312                 inserted in their original size. 
313                 Read the documentation of the pdfpages package
314                 for further options and details.
315         HelpTextEnd
316         InputFormat pdf
317         FileFilter "*.pdf"
318         AutomaticProduction true
319         Transform Rotate
320         Transform Resize
321         Transform Extra
322         Preview Graphics
323         Format LaTeX
324                 TransformOption Rotate RotationLatexOption
325                 TransformOption Resize ResizeLatexOption
326                 TransformOption Extra  ExtraOption
327                 Option Arg "[$$Extra,$$Rotate,$$Resize]"
328                 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
329                 UpdateFormat pdf
330                 UpdateResult "$$AbsPath$$Basename.pdf"
331                 Requirement "pdfpages"
332                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
333         FormatEnd
334         Format Ascii
335                 Product "[PDFPages: $$FName]"
336         FormatEnd
337         Format DocBook
338                 Product "[PDFPages: $$FName]"
339         FormatEnd
340 TemplateEnd
341
342
343 Template Date
344         GuiName "Date"
345         HelpText
346                 Today's date.
347                 Read 'info date' for more information.
348         HelpTextEnd
349         InputFormat date
350         FileFilter "*"
351         AutomaticProduction true
352         Preview Off
353         Format LaTeX
354                 Product "$$Contents(\"$$Tempname\")"
355                 UpdateFormat dateout
356                 UpdateResult "$$Tempname"
357         FormatEnd
358         Format PDFLaTeX
359                 Product "$$Contents(\"$$Tempname\")"
360                 UpdateFormat dateout
361                 UpdateResult "$$Tempname"
362         FormatEnd
363         Format Ascii
364                 Product "$$Contents(\"$$Tempname\")"
365                 UpdateFormat dateout
366                 UpdateResult "$$Tempname"
367         FormatEnd
368         Format DocBook
369                 Product "$$Contents(\"$$Tempname\")"
370                 UpdateFormat dateout
371                 UpdateResult "$$Tempname"
372         FormatEnd
373 TemplateEnd
374
375 Template Dia
376         GuiName "Dia diagram"
377         HelpText
378                 Dia diagram.
379         HelpTextEnd
380         InputFormat dia
381         FileFilter "*.dia"
382         AutomaticProduction true
383         # LyX has hard-coded support for these transformations
384         Transform Rotate
385         Transform Resize
386         Transform Clip
387         Transform Extra
388         Preview InstantPreview
389         Format LaTeX
390                 TransformOption Rotate RotationLatexOption
391                 TransformOption Resize ResizeLatexOption
392                 TransformOption Clip   ClipLatexOption
393                 TransformOption Extra  ExtraOption
394                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
395                 # This string is what is output to the LaTeX file.
396                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
397                 UpdateFormat eps
398                 UpdateResult "$$AbsPath$$Basename.eps"
399                 Requirement "graphicx"
400                 ReferencedFile latex "$$AbsPath$$Basename.eps"
401                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
402         FormatEnd
403         Format PDFLaTeX
404                 TransformOption Rotate RotationLatexOption
405                 TransformOption Resize ResizeLatexOption
406                 TransformOption Clip   ClipLatexOption
407                 TransformOption Extra  ExtraOption
408                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
409                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
410                 UpdateFormat pdf
411                 UpdateResult "$$AbsPath$$Basename.pdf"
412                 Requirement "graphicx"
413                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
414         FormatEnd
415         Format Ascii
416                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
417                 UpdateFormat asciiimage
418                 UpdateResult "$$AbsPath$$Basename.asc"
419         FormatEnd
420         Format DocBook
421                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
422                 UpdateFormat eps
423                 UpdateResult "$$AbsPath$$Basename.eps"
424                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
425                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
426         FormatEnd
427 TemplateEnd
428