]> git.lyx.org Git - lyx.git/blob - lib/external_templates
Convert odg to (cropped) eps without external script.
[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, 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 latex "$$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                 Read the documentation of the pdfpages package
311                 for further options and details.
312         HelpTextEnd
313         InputFormat pdf
314         FileFilter "*.pdf"
315         AutomaticProduction true
316         Transform Rotate
317         Transform Resize
318         Transform Extra
319         Preview Graphics
320         Format LaTeX
321                 TransformOption Rotate RotationLatexOption
322                 TransformOption Resize ResizeLatexOption
323                 TransformOption Extra  ExtraOption
324                 Option Arg "[$$Extra,$$Rotate,$$Resize]"
325                 Product "\\includepdf$$Arg{$$AbsOrRelPathMaster$$Basename}"
326                 UpdateFormat pdf
327                 UpdateResult "$$AbsPath$$Basename.pdf"
328                 Requirement "pdfpages"
329                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
330         FormatEnd
331         Format Ascii
332                 Product "[PDFPages: $$FName]"
333         FormatEnd
334         Format DocBook
335                 Product "[PDFPages: $$FName]"
336         FormatEnd
337 TemplateEnd
338
339
340 Template Date
341         GuiName "Date"
342         HelpText
343                 Today's date.
344                 Read 'info date' for more information.
345         HelpTextEnd
346         InputFormat date
347         FileFilter "*"
348         AutomaticProduction true
349         Preview Off
350         Format LaTeX
351                 Product "$$Contents(\"$$Tempname\")"
352                 UpdateFormat dateout
353                 UpdateResult "$$Tempname"
354         FormatEnd
355         Format PDFLaTeX
356                 Product "$$Contents(\"$$Tempname\")"
357                 UpdateFormat dateout
358                 UpdateResult "$$Tempname"
359         FormatEnd
360         Format Ascii
361                 Product "$$Contents(\"$$Tempname\")"
362                 UpdateFormat dateout
363                 UpdateResult "$$Tempname"
364         FormatEnd
365         Format DocBook
366                 Product "$$Contents(\"$$Tempname\")"
367                 UpdateFormat dateout
368                 UpdateResult "$$Tempname"
369         FormatEnd
370 TemplateEnd
371
372 Template Dia
373         GuiName "Dia diagram"
374         HelpText
375                 Dia diagram.
376         HelpTextEnd
377         InputFormat dia
378         FileFilter "*.dia"
379         AutomaticProduction true
380         # LyX has hard-coded support for these transformations
381         Transform Rotate
382         Transform Resize
383         Transform Clip
384         Transform Extra
385         Preview InstantPreview
386         Format LaTeX
387                 TransformOption Rotate RotationLatexOption
388                 TransformOption Resize ResizeLatexOption
389                 TransformOption Clip   ClipLatexOption
390                 TransformOption Extra  ExtraOption
391                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
392                 # This string is what is output to the LaTeX file.
393                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
394                 UpdateFormat eps
395                 UpdateResult "$$AbsPath$$Basename.eps"
396                 Requirement "graphicx"
397                 ReferencedFile latex "$$AbsPath$$Basename.eps"
398                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
399         FormatEnd
400         Format PDFLaTeX
401                 TransformOption Rotate RotationLatexOption
402                 TransformOption Resize ResizeLatexOption
403                 TransformOption Clip   ClipLatexOption
404                 TransformOption Extra  ExtraOption
405                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
406                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
407                 UpdateFormat pdf
408                 UpdateResult "$$AbsPath$$Basename.pdf"
409                 Requirement "graphicx"
410                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
411         FormatEnd
412         Format Ascii
413                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
414                 UpdateFormat asciiimage
415                 UpdateResult "$$AbsPath$$Basename.asc"
416         FormatEnd
417         Format DocBook
418                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
419                 UpdateFormat eps
420                 UpdateResult "$$AbsPath$$Basename.eps"
421                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
422                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
423         FormatEnd
424 TemplateEnd
425