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