]> git.lyx.org Git - lyx.git/blob - lib/external_templates
German Intro.lyx: Updates from Hartmut
[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 TemplateEnd
100
101
102 Template XFig
103         GuiName "Xfig: $$AbsOrRelPathParent$$Basename"
104         HelpText
105                 An Xfig figure.
106         HelpTextEnd
107         InputFormat fig
108         FileFilter "*.fig"
109         AutomaticProduction true
110         Transform Rotate
111         Transform Resize
112         Format LaTeX
113                 TransformCommand Rotate RotationLatexCommand
114                 TransformCommand Resize ResizeLatexCommand
115                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
116                 UpdateFormat pstex
117                 UpdateResult "$$AbsPath$$Basename.pstex_t"
118                 Requirement "color"
119                 Requirement "graphicx"
120                 # Preamble WarnNotFound
121                 # Preamble InputOrWarn
122                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
123                 ReferencedFile latex "$$AbsPath$$Basename.eps"
124                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
125         FormatEnd
126         Format PDFLaTeX
127                 TransformCommand Rotate RotationLatexCommand
128                 TransformCommand Resize ResizeLatexCommand
129                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
130                 UpdateFormat pdftex
131                 UpdateResult "$$AbsPath$$Basename.pdftex_t"
132                 Requirement "color"
133                 Requirement "graphicx"
134                 # Preamble WarnNotFound
135                 # Preamble InputOrWarn
136                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
137                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
138         FormatEnd
139         Format Ascii
140                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
141                 UpdateFormat asciixfig
142                 UpdateResult "$$AbsPath$$Basename.asc"
143         FormatEnd
144         Format DocBook
145                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
146                 UpdateFormat eps
147                 UpdateResult "$$AbsPath$$Basename.eps"
148                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
149                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
150         FormatEnd
151 TemplateEnd
152
153
154 Template ChessDiagram
155         GuiName "Chess: $$AbsOrRelPathParent$$Basename"
156         HelpText
157                 A chess position diagram.
158                 This template will use XBoard to edit the position.
159                 Use the 'File->Save Position' in XBoard to save
160                 the position that you want to display.
161                 Make sure to give it a '.fen' extension
162                 and remember to type in a relative path
163                 to the LyX document location.
164                 Within XBoard, use 'Edit->Edit Position'
165                 to enable general editing of the board.
166                 You might also check out the
167                 'Options->Test legality' option, and
168                 remember to middle and right click to
169                 insert new material in the board.
170                 In order for this to work, you have to
171                 put the bundled lyxskak.sty in a place
172                 that TeX will find it, and you will need
173                 to install the skak package from CTAN.
174         HelpTextEnd
175         InputFormat fen
176         FileFilter "*.fen"
177         AutomaticProduction true
178         Format LaTeX
179                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
180                 Requirement "chess"
181                 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
182         FormatEnd
183         Format PDFLaTeX
184                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
185                 Requirement "chess"
186                 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
187         FormatEnd
188         Format Ascii
189                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
190                 UpdateFormat asciichess
191                 UpdateResult "$$AbsPath$$Basename.asc"
192         FormatEnd
193         Format DocBook
194                 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
195         FormatEnd
196 TemplateEnd
197
198
199 Template LilyPond
200         GuiName "Lilypond typeset music"
201         HelpText
202                 Sheet music typeset by GNU LilyPond,
203                 converted to .pdf or .eps for inclusion
204                 Using .eps requires at least lilypond 2.6
205                 Using .pdf requires at least lilypond 2.9
206         HelpTextEnd
207         InputFormat "lilypond"
208         FileFilter "*.ly"
209         AutomaticProduction true
210         Transform Rotate
211         Transform Resize
212         Transform Clip
213         Transform Extra
214         Format LaTeX
215                 TransformOption Rotate RotationLatexOption
216                 TransformOption Resize ResizeLatexOption
217                 TransformOption Clip   ClipLatexOption
218                 TransformOption Extra  ExtraOption
219                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
220                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
221                 UpdateFormat eps
222                 UpdateResult "$$AbsPath$$Basename.eps"
223                 Requirement "graphicx"
224                 ReferencedFile latex "$$AbsPath$$Basename.eps"
225                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
226         FormatEnd
227         Format PDFLaTeX
228                 TransformOption Rotate RotationLatexOption
229                 TransformOption Resize ResizeLatexOption
230                 TransformOption Clip   ClipLatexOption
231                 TransformOption Extra  ExtraOption
232                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
233                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
234                 UpdateFormat pdf
235                 UpdateResult "$$AbsPath$$Basename.pdf"
236                 Requirement "graphicx"
237                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
238         FormatEnd
239         Format Ascii
240                 Product "[LilyPond: $$FName]"
241         FormatEnd
242         Format DocBook
243                 Product "[LilyPond: $$FName]"
244         FormatEnd
245 TemplateEnd
246
247
248 Template Date
249         GuiName "Date"
250         HelpText
251                 Today's date.
252                 Read 'info date' for more information.
253         HelpTextEnd
254         InputFormat date
255         FileFilter "*"
256         AutomaticProduction true
257         Format LaTeX
258                 Product "$$Contents(\"$$Tempname\")"
259                 UpdateFormat dateout
260                 UpdateResult "$$Tempname"
261         FormatEnd
262         Format PDFLaTeX
263                 Product "$$Contents(\"$$Tempname\")"
264                 UpdateFormat dateout
265                 UpdateResult "$$Tempname"
266         FormatEnd
267         Format Ascii
268                 Product "$$Contents(\"$$Tempname\")"
269                 UpdateFormat dateout
270                 UpdateResult "$$Tempname"
271         FormatEnd
272         Format DocBook
273                 Product "$$Contents(\"$$Tempname\")"
274                 UpdateFormat dateout
275                 UpdateResult "$$Tempname"
276         FormatEnd
277 TemplateEnd