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