2 # file external_templates
3 # This file is part of LyX, the document processor.
4 # Licence details can be found in the file COPYING.
6 # author Asger Alstrup Nielsen
8 # author Johnathan Burchill
10 # Full author contact details are available in file CREDITS.
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
18 PreambleDef WarnNotFound
19 %% Print a warning encased in an fbox.
20 \def\lyxstripprefix#1>{}
21 \newcommand{\warnNotFound}[1]{%
22 \def\lyxtempfilename{#1}%
24 \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
25 \typeout{Could not find \lyxtempfilename!}%
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}}}
38 GuiName "Bitmap: $$Basename"
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
49 This template uses Gimp for editing.
52 FileFilter "*.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm)"
53 EditCommand "gimp $$FName"
54 AutomaticProduction true
60 TransformOption Rotate RotationLatexOption
61 TransformOption Resize ResizeLatexOption
62 TransformOption Clip ClipLatexOption
63 TransformOption Extra ExtraOption
64 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
65 Product "\\includegraphics$$Arg{$$Basename}"
67 UpdateResult "$$Basename.eps"
68 Requirement "graphicx"
71 TransformOption Rotate RotationLatexOption
72 TransformOption Resize ResizeLatexOption
73 TransformOption Clip ClipLatexOption
74 TransformOption Extra ExtraOption
75 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
76 Product "\\includegraphics$$Arg{$$Basename}"
78 UpdateResult "$$Basename.png"
79 Requirement "graphicx"
82 Product "$$Contents(\"$$Basename.asc\")"
83 UpdateFormat asciiimage
84 UpdateResult "$$Basename.asc"
87 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
89 UpdateResult "$$Basename.eps"
92 Product "[Bitmap: $$FName]"
98 GuiName "XFig: $$Basename"
101 This template uses XFig for editing.
105 EditCommand "xfig $$FName"
106 AutomaticProduction true
110 TransformCommand Rotate RotationLatexCommand
111 TransformCommand Resize ResizeLatexCommand
112 Product "$$RotateFront$$ResizeFront\\input{$$Basename.pstex_t}$$ResizeBack$$RotateBack"
114 UpdateResult "$$Basename.pstex_t"
115 Requirement "graphicx"
116 Preamble WarnNotFound
120 TransformCommand Rotate RotationLatexCommand
121 TransformCommand Resize ResizeLatexCommand
122 Product "$$RotateFront$$ResizeFront\\input{$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
124 UpdateResult "$$Basename.pdftex_t"
125 Requirement "graphicx"
126 Preamble WarnNotFound
130 Product "$$Contents(\"$$Basename.asc\")"
131 UpdateFormat asciixfig
132 UpdateResult "$$Basename.asc"
135 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
137 UpdateResult "$$Basename.eps"
140 Product "[XFig: $$FName]"
145 Template ChessDiagram
146 GuiName "Chess: $$Basename"
148 A chess position diagram.
149 This template will use XBoard to edit the position.
150 Use the 'File->Save Position' in XBoard to save
151 the position that you want to display.
152 Make sure to give it a '.fen' extension
153 and remember to type in a relative path
154 to the LyX document location.
155 Within XBoard, use 'Edit->Edit Position'
156 to enable general editing of the board.
157 You might also check out the
158 'Options->Test legality' option, and
159 remember to middle and right click to
160 insert new material in the board.
161 In order for this to work, you have to
162 put the bundled lyxskak.sty in a place
163 that TeX will find it, and you will need
164 to install the skak package from CTAN.
168 EditCommand "xboard -lpf $$FName -mode EditPosition"
169 AutomaticProduction true
171 Product "\\loadgame{$$FPath$$Basename}\\showboard"
175 Product "$$Contents(\"$$Basename.asc\")"
176 UpdateFormat asciichess
177 UpdateResult "$$Basename.asc"
180 Product "[Chess: $$Basename]"
183 Product "[Chess: $$FName]"
192 Read 'info date' for more information.
196 AutomaticProduction true
198 Product "$$Contents(\"$$Tempname\")"
200 UpdateResult "$$Tempname"
203 Product "$$Contents(\"$$Tempname\")"
205 UpdateResult "$$Tempname"
208 Product "$$Contents(\"$$Tempname\")"
210 UpdateResult "$$Tempname"
213 Product "$$Contents(\"$$Tempname\")"
215 UpdateResult "$$Tempname"