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