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