]> git.lyx.org Git - lyx.git/blob - lib/external_templates
6f11c71fe3bd5d9e33fc4e0693c957c4abf44b6d
[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         Format LaTeX
56                 Product "\\includegraphics{$$Basename}"
57                 UpdateFormat eps
58                 UpdateResult "$$Basename.eps"
59                 Requirement "graphicx"
60         FormatEnd
61         Format PDFLaTeX
62                 Product "\\includegraphics{$$Basename}"
63                 UpdateFormat png
64                 UpdateResult "$$Basename.png"
65                 Requirement "graphicx"
66         FormatEnd
67         Format Ascii
68                 Product "$$Contents(\"$$Basename.asc\")"
69                 UpdateFormat asciiimage
70                 UpdateResult "$$Basename.asc"
71         FormatEnd
72         Format DocBook
73                 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
74                 UpdateFormat eps
75                 UpdateResult "$$Basename.eps"
76         FormatEnd
77         Format LinuxDoc
78                 Product "[Bitmap: $$FName]"
79         FormatEnd
80 TemplateEnd
81
82
83 Template XFig
84         GuiName "XFig: $$Basename"
85         HelpText
86                 An XFig figure.
87                 This template uses XFig for editing.
88         HelpTextEnd
89         InputFormat fig
90         FileFilter "*.fig"
91         EditCommand "xfig $$FName"
92         AutomaticProduction true
93         Format LaTeX
94                 Product "\\inputOrWarn{$$Basename.pstex_t}"
95                 UpdateFormat pstex
96                 UpdateResult "$$Basename.pstex_t"
97                 Requirement "graphicx"
98                 Preamble WarnNotFound
99                 Preamble InputOrWarn
100         FormatEnd
101         Format PDFLaTeX
102                 Product "\\inputOrWarn{$$Basename.pdftex_t}"
103                 UpdateFormat pdftex
104                 UpdateResult "$$Basename.pdftex_t"
105                 Requirement "graphicx"
106                 Preamble WarnNotFound
107                 Preamble InputOrWarn
108         FormatEnd
109         Format Ascii
110                 Product "$$Contents(\"$$Basename.asc\")"
111                 UpdateFormat asciixfig
112                 UpdateResult "$$Basename.asc"
113         FormatEnd
114         Format DocBook
115                 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
116                 UpdateFormat eps
117                 UpdateResult "$$Basename.eps"
118         FormatEnd
119         Format LinuxDoc
120                 Product "[XFig: $$FName]"
121         FormatEnd
122 TemplateEnd
123
124
125 Template ChessDiagram
126         GuiName "Chess: $$Basename"
127         HelpText
128                 A chess position diagram.
129                 This template will use XBoard to edit the position.
130                 Use the 'File->Save Position' in XBoard to save
131                 the position that you want to display.
132                 Make sure to give it a '.fen' extension
133                 and remember to type in a relative path
134                 to the LyX document location.
135                 Within XBoard, use 'Edit->Edit Position'
136                 to enable general editing of the board.
137                 You might also check out the
138                 'Options->Test legality' option, and
139                 remember to middle and right click to
140                 insert new material in the board.
141                 In order for this to work, you have to
142                 put the bundled lyxskak.sty in a place
143                 that TeX will find it, and you will need
144                 to install the skak package from CTAN.
145         HelpTextEnd
146         InputFormat fen
147         FileFilter "*.fen"
148         EditCommand "xboard -lpf $$FName -mode EditPosition"
149         AutomaticProduction true
150         Format LaTeX
151                 Product "\\loadgame{$$FPath$$Basename}\\showboard"
152                 Requirement "chess"
153         FormatEnd
154         Format Ascii
155                 Product "$$Contents(\"$$Basename.asc\")"
156                 UpdateFormat asciichess
157                 UpdateResult "$$Basename.asc"
158         FormatEnd
159         Format DocBook
160                 Product "[Chess: $$Basename]"
161         FormatEnd
162         Format LinuxDoc
163                 Product "[Chess: $$FName]"
164         FormatEnd
165 TemplateEnd
166
167
168 Template Date
169         GuiName "Date"
170         HelpText
171                 Todays date.
172                 Read 'info date' for more information.
173         HelpTextEnd
174         InputFormat date
175         FileFilter "*"
176         AutomaticProduction true
177         Format LaTeX
178                 Product "$$Contents(\"$$Tempname\")"
179                 UpdateFormat dateout
180                 UpdateResult "$$Tempname"
181         FormatEnd
182         Format Ascii
183                 Product "$$Contents(\"$$Tempname\")"
184                 UpdateFormat dateout
185                 UpdateResult "$$Tempname"
186         FormatEnd
187         Format DocBook
188                 Product "$$Contents(\"$$Tempname\")"
189                 UpdateFormat dateout
190                 UpdateResult "$$Tempname"
191         FormatEnd
192         Format LinuxDoc
193                 Product "$$Contents(\"$$Tempname\")"
194                 UpdateFormat dateout
195                 UpdateResult "$$Tempname"
196         FormatEnd
197 TemplateEnd