]> git.lyx.org Git - lyx.git/blob - lib/external_templates
update m4 files and remove warnings
[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         FormatEnd
73         Format PDFLaTeX
74                 TransformOption Rotate RotationLatexOption
75                 TransformOption Resize ResizeLatexOption
76                 TransformOption Clip   ClipLatexOption
77                 TransformOption Extra  ExtraOption
78                 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
79                 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
80                 UpdateFormat png
81                 UpdateResult "$$AbsPath$$Basename.png"
82                 Requirement "graphicx"
83         FormatEnd
84         Format Ascii
85                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
86                 UpdateFormat asciiimage
87                 UpdateResult "$$AbsPath$$Basename.asc"
88         FormatEnd
89         Format DocBook
90                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
91                 UpdateFormat eps
92                 UpdateResult "$$AbsPath$$Basename.eps"
93         FormatEnd
94         Format LinuxDoc
95                 Product "[Bitmap: $$FName]"
96         FormatEnd
97 TemplateEnd
98
99
100 Template XFig
101         GuiName "XFig: $$AbsOrRelPathParent$$Basename"
102         HelpText
103                 An XFig figure.
104         HelpTextEnd
105         InputFormat fig
106         FileFilter "*.fig"
107         AutomaticProduction true
108         Transform Rotate
109         Transform Resize
110         Format LaTeX
111                 TransformCommand Rotate RotationLatexCommand
112                 TransformCommand Resize ResizeLatexCommand
113                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
114                 UpdateFormat pstex
115                 UpdateResult "$$AbsPath$$Basename.pstex_t"
116                 Requirement "graphicx"
117                 # Preamble WarnNotFound
118                 # Preamble InputOrWarn
119         FormatEnd
120         Format PDFLaTeX
121                 TransformCommand Rotate RotationLatexCommand
122                 TransformCommand Resize ResizeLatexCommand
123                 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
124                 UpdateFormat pdftex
125                 UpdateResult "$$AbsPath$$Basename.pdftex_t"
126                 Requirement "graphicx"
127                 # Preamble WarnNotFound
128                 # Preamble InputOrWarn
129         FormatEnd
130         Format Ascii
131                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
132                 UpdateFormat asciixfig
133                 UpdateResult "$$AbsPath$$Basename.asc"
134         FormatEnd
135         Format DocBook
136                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
137                 UpdateFormat eps
138                 UpdateResult "$$AbsPath$$Basename.eps"
139         FormatEnd
140         Format LinuxDoc
141                 Product "[XFig: $$FName]"
142         FormatEnd
143 TemplateEnd
144
145
146 Template ChessDiagram
147         GuiName "Chess: $$AbsOrRelPathParent$$Basename"
148         HelpText
149                 A chess position diagram.
150                 This template will use XBoard to edit the position.
151                 Use the 'File->Save Position' in XBoard to save
152                 the position that you want to display.
153                 Make sure to give it a '.fen' extension
154                 and remember to type in a relative path
155                 to the LyX document location.
156                 Within XBoard, use 'Edit->Edit Position'
157                 to enable general editing of the board.
158                 You might also check out the
159                 'Options->Test legality' option, and
160                 remember to middle and right click to
161                 insert new material in the board.
162                 In order for this to work, you have to
163                 put the bundled lyxskak.sty in a place
164                 that TeX will find it, and you will need
165                 to install the skak package from CTAN.
166         HelpTextEnd
167         InputFormat fen
168         FileFilter "*.fen"
169         AutomaticProduction true
170         Format LaTeX
171                 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
172                 Requirement "chess"
173         FormatEnd
174         Format Ascii
175                 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
176                 UpdateFormat asciichess
177                 UpdateResult "$$AbsPath$$Basename.asc"
178         FormatEnd
179         Format DocBook
180                 Product "[Chess: $$AbsOrRelPathMaster$$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                 Today's 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