]> git.lyx.org Git - lyx.git/blob - lib/external_templates
f6ad4cce230ad26f57c54de45514178f9c46261b
[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         Format LaTeX
62                 TransformOption Rotate RotationLatexOption
63                 TransformOption Resize ResizeLatexOption
64                 TransformOption Clip   ClipLatexOption
65                 TransformOption Extra  ExtraOption
66                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
67                 # This string is what is output to the LaTeX file.
68                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
69                 UpdateFormat eps
70                 UpdateResult "$$AbsPath$$Basename.eps"
71                 Requirement "graphicx"
72                 ReferencedFile latex "$$AbsPath$$Basename.eps"
73                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
74         FormatEnd
75         Format PDFLaTeX
76                 TransformOption Rotate RotationLatexOption
77                 TransformOption Resize ResizeLatexOption
78                 TransformOption Clip   ClipLatexOption
79                 TransformOption Extra  ExtraOption
80                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
81                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
82                 UpdateFormat png
83                 UpdateResult "$$AbsPath$$Basename.png"
84                 Requirement "graphicx"
85                 ReferencedFile pdflatex "$$AbsPath$$Basename.png"
86         FormatEnd
87         Format Ascii
88                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
89                 UpdateFormat asciiimage
90                 UpdateResult "$$AbsPath$$Basename.asc"
91         FormatEnd
92         Format DocBook
93                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
94                 UpdateFormat eps
95                 UpdateResult "$$AbsPath$$Basename.eps"
96                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
97                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
98         FormatEnd
99         Format LinuxDoc
100                 Product "[Bitmap: $$FName]"
101         FormatEnd
102 TemplateEnd
103
104
105 Template XFig
106         GuiName "XFig: $$AbsOrRelPathParent$$Basename"
107         HelpText
108                 An XFig figure.
109         HelpTextEnd
110         InputFormat fig
111         FileFilter "*.fig"
112         AutomaticProduction true
113         Transform Rotate
114         Transform Resize
115         Format LaTeX
116                 TransformCommand Rotate RotationLatexCommand
117                 TransformCommand Resize ResizeLatexCommand
118                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
119                 UpdateFormat pstex
120                 UpdateResult "$$AbsPath$$Basename.pstex_t"
121                 Requirement "color"
122                 Requirement "graphicx"
123                 # Preamble WarnNotFound
124                 # Preamble InputOrWarn
125                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
126                 ReferencedFile latex "$$AbsPath$$Basename.eps"
127                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
128         FormatEnd
129         Format PDFLaTeX
130                 TransformCommand Rotate RotationLatexCommand
131                 TransformCommand Resize ResizeLatexCommand
132                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
133                 UpdateFormat pdftex
134                 UpdateResult "$$AbsPath$$Basename.pdftex_t"
135                 Requirement "color"
136                 Requirement "graphicx"
137                 # Preamble WarnNotFound
138                 # Preamble InputOrWarn
139                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
140                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
141         FormatEnd
142         Format Ascii
143                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
144                 UpdateFormat asciixfig
145                 UpdateResult "$$AbsPath$$Basename.asc"
146         FormatEnd
147         Format DocBook
148                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
149                 UpdateFormat eps
150                 UpdateResult "$$AbsPath$$Basename.eps"
151                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
152                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
153         FormatEnd
154         Format LinuxDoc
155                 Product "[XFig: $$FName]"
156         FormatEnd
157 TemplateEnd
158
159
160 Template ChessDiagram
161         GuiName "Chess: $$AbsOrRelPathParent$$Basename"
162         HelpText
163                 A chess position diagram.
164                 This template will use XBoard to edit the position.
165                 Use the 'File->Save Position' in XBoard to save
166                 the position that you want to display.
167                 Make sure to give it a '.fen' extension
168                 and remember to type in a relative path
169                 to the LyX document location.
170                 Within XBoard, use 'Edit->Edit Position'
171                 to enable general editing of the board.
172                 You might also check out the
173                 'Options->Test legality' option, and
174                 remember to middle and right click to
175                 insert new material in the board.
176                 In order for this to work, you have to
177                 put the bundled lyxskak.sty in a place
178                 that TeX will find it, and you will need
179                 to install the skak package from CTAN.
180         HelpTextEnd
181         InputFormat fen
182         FileFilter "*.fen"
183         AutomaticProduction true
184         Format LaTeX
185                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
186                 Requirement "chess"
187                 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
188         FormatEnd
189         Format PDFLaTeX
190                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
191                 Requirement "chess"
192                 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
193         FormatEnd
194         Format Ascii
195                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
196                 UpdateFormat asciichess
197                 UpdateResult "$$AbsPath$$Basename.asc"
198         FormatEnd
199         Format DocBook
200                 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
201         FormatEnd
202         Format LinuxDoc
203                 Product "[Chess: $$FName]"
204         FormatEnd
205 TemplateEnd
206
207
208 Template Date
209         GuiName "Date"
210         HelpText
211                 Today's date.
212                 Read 'info date' for more information.
213         HelpTextEnd
214         InputFormat date
215         FileFilter "*"
216         AutomaticProduction true
217         Format LaTeX
218                 Product "$$Contents(\"$$Tempname\")"
219                 UpdateFormat dateout
220                 UpdateResult "$$Tempname"
221         FormatEnd
222         Format PDFLaTeX
223                 Product "$$Contents(\"$$Tempname\")"
224                 UpdateFormat dateout
225                 UpdateResult "$$Tempname"
226         FormatEnd
227         Format Ascii
228                 Product "$$Contents(\"$$Tempname\")"
229                 UpdateFormat dateout
230                 UpdateResult "$$Tempname"
231         FormatEnd
232         Format DocBook
233                 Product "$$Contents(\"$$Tempname\")"
234                 UpdateFormat dateout
235                 UpdateResult "$$Tempname"
236         FormatEnd
237         Format LinuxDoc
238                 Product "$$Contents(\"$$Tempname\")"
239                 UpdateFormat dateout
240                 UpdateResult "$$Tempname"
241         FormatEnd
242 TemplateEnd