]> git.lyx.org Git - lyx.git/blob - lib/external_templates
cbc3a755707360cfdbdb90a86fe7277f0c64fedf
[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         GuiName "Bitmap: $$Basename"
39         HelpText
40                 A bitmap file.
41                 In the parameters box, you can provide optional
42                 parameters for the ImageMagick convert program.
43                 E.g., use `-border 10x10 -bordercolor black'
44                 to surround the picture with a black border
45                 when you export to LaTeX.
46                 When you export to Ascii, you can provide a
47                 number describing how many columns the picture
48                 should expand to.
49                 This template uses Gimp for editing.
50         HelpTextEnd
51         InputFormat "*"
52         FileFilter "*.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm)"
53         EditCommand "gimp $$FName"
54         AutomaticProduction true
55         Transform Rotate
56         Transform Resize
57         Transform Clip
58         Transform Extra
59         Format LaTeX
60                 TransformOption Rotate RotationLatexOption
61                 TransformOption Resize ResizeLatexOption
62                 TransformOption Clip   ClipLatexOption
63                 TransformOption Extra  ExtraOption
64                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
65                 Product "\\includegraphics$$Arg{$$Basename}"
66                 UpdateFormat eps
67                 UpdateResult "$$Basename.eps"
68                 Requirement "graphicx"
69         FormatEnd
70         Format PDFLaTeX
71                 TransformOption Rotate RotationLatexOption
72                 TransformOption Resize ResizeLatexOption
73                 TransformOption Clip   ClipLatexOption
74                 TransformOption Extra  ExtraOption
75                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
76                 Product "\\includegraphics$$Arg{$$Basename}"
77                 UpdateFormat png
78                 UpdateResult "$$Basename.png"
79                 Requirement "graphicx"
80         FormatEnd
81         Format Ascii
82                 Product "$$Contents(\"$$Basename.asc\")"
83                 UpdateFormat asciiimage
84                 UpdateResult "$$Basename.asc"
85         FormatEnd
86         Format DocBook
87                 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
88                 UpdateFormat eps
89                 UpdateResult "$$Basename.eps"
90         FormatEnd
91         Format LinuxDoc
92                 Product "[Bitmap: $$FName]"
93         FormatEnd
94 TemplateEnd
95
96
97 Template XFig
98         GuiName "XFig: $$Basename"
99         HelpText
100                 An XFig figure.
101                 This template uses XFig for editing.
102         HelpTextEnd
103         InputFormat fig
104         FileFilter "*.fig"
105         EditCommand "xfig $$FName"
106         AutomaticProduction true
107         Transform Rotate
108         Transform Resize
109         Format LaTeX
110                 TransformCommand Rotate RotationLatexCommand
111                 TransformCommand Resize ResizeLatexCommand
112                 Product "$$RotateFront$$ResizeFront\\input{$$Basename.pstex_t}$$ResizeBack$$RotateBack"
113                 UpdateFormat pstex
114                 UpdateResult "$$Basename.pstex_t"
115                 Requirement "graphicx"
116                 Preamble WarnNotFound
117                 Preamble InputOrWarn
118         FormatEnd
119         Format PDFLaTeX
120                 TransformCommand Rotate RotationLatexCommand
121                 TransformCommand Resize ResizeLatexCommand
122                 Product "$$RotateFront$$ResizeFront\\input{$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
123                 UpdateFormat pdftex
124                 UpdateResult "$$Basename.pdftex_t"
125                 Requirement "graphicx"
126                 Preamble WarnNotFound
127                 Preamble InputOrWarn
128         FormatEnd
129         Format Ascii
130                 Product "$$Contents(\"$$Basename.asc\")"
131                 UpdateFormat asciixfig
132                 UpdateResult "$$Basename.asc"
133         FormatEnd
134         Format DocBook
135                 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
136                 UpdateFormat eps
137                 UpdateResult "$$Basename.eps"
138         FormatEnd
139         Format LinuxDoc
140                 Product "[XFig: $$FName]"
141         FormatEnd
142 TemplateEnd
143
144
145 Template ChessDiagram
146         GuiName "Chess: $$Basename"
147         HelpText
148                 A chess position diagram.
149                 This template will use XBoard to edit the position.
150                 Use the 'File->Save Position' in XBoard to save
151                 the position that you want to display.
152                 Make sure to give it a '.fen' extension
153                 and remember to type in a relative path
154                 to the LyX document location.
155                 Within XBoard, use 'Edit->Edit Position'
156                 to enable general editing of the board.
157                 You might also check out the
158                 'Options->Test legality' option, and
159                 remember to middle and right click to
160                 insert new material in the board.
161                 In order for this to work, you have to
162                 put the bundled lyxskak.sty in a place
163                 that TeX will find it, and you will need
164                 to install the skak package from CTAN.
165         HelpTextEnd
166         InputFormat fen
167         FileFilter "*.fen"
168         EditCommand "xboard -lpf $$FName -mode EditPosition"
169         AutomaticProduction true
170         Format LaTeX
171                 Product "\\loadgame{$$FPath$$Basename}\\showboard"
172                 Requirement "chess"
173         FormatEnd
174         Format Ascii
175                 Product "$$Contents(\"$$Basename.asc\")"
176                 UpdateFormat asciichess
177                 UpdateResult "$$Basename.asc"
178         FormatEnd
179         Format DocBook
180                 Product "[Chess: $$Basename]"
181         FormatEnd
182         Format LinuxDoc
183                 Product "[Chess: $$FName]"
184         FormatEnd
185 TemplateEnd
186
187
188 Template Date
189         GuiName "Date"
190         HelpText
191                 Todays date.
192                 Read 'info date' for more information.
193         HelpTextEnd
194         InputFormat date
195         FileFilter "*"
196         AutomaticProduction true
197         Format LaTeX
198                 Product "$$Contents(\"$$Tempname\")"
199                 UpdateFormat dateout
200                 UpdateResult "$$Tempname"
201         FormatEnd
202         Format Ascii
203                 Product "$$Contents(\"$$Tempname\")"
204                 UpdateFormat dateout
205                 UpdateResult "$$Tempname"
206         FormatEnd
207         Format DocBook
208                 Product "$$Contents(\"$$Tempname\")"
209                 UpdateFormat dateout
210                 UpdateResult "$$Tempname"
211         FormatEnd
212         Format LinuxDoc
213                 Product "$$Contents(\"$$Tempname\")"
214                 UpdateFormat dateout
215                 UpdateResult "$$Tempname"
216         FormatEnd
217 TemplateEnd