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
56 Product "\\includegraphics{$$Basename}"
58 UpdateResult "$$Basename.eps"
59 Requirement "graphicx"
62 Product "\\includegraphics{$$Basename}"
64 UpdateResult "$$Basename.png"
65 Requirement "graphicx"
68 Product "$$Contents(\"$$Basename.asc\")"
69 UpdateFormat asciiimage
70 UpdateResult "$$Basename.asc"
73 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
75 UpdateResult "$$Basename.eps"
78 Product "[Bitmap: $$FName]"
84 GuiName "XFig: $$Basename"
87 This template uses XFig for editing.
91 EditCommand "xfig $$FName"
92 AutomaticProduction true
94 Product "\\inputOrWarn{$$Basename.pstex_t}"
96 UpdateResult "$$Basename.pstex_t"
97 Requirement "graphicx"
102 Product "\\inputOrWarn{$$Basename.pdftex_t}"
104 UpdateResult "$$Basename.pdftex_t"
105 Requirement "graphicx"
106 Preamble WarnNotFound
110 Product "$$Contents(\"$$Basename.asc\")"
111 UpdateFormat asciixfig
112 UpdateResult "$$Basename.asc"
115 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
117 UpdateResult "$$Basename.eps"
120 Product "[XFig: $$FName]"
125 Template ChessDiagram
126 GuiName "Chess: $$Basename"
128 A chess position diagram.
129 This template will use XBoard to edit the position.
130 Use the 'File->Save Position' in XBoard to save
131 the position that you want to display.
132 Make sure to give it a '.fen' extension
133 and remember to type in a relative path
134 to the LyX document location.
135 Within XBoard, use 'Edit->Edit Position'
136 to enable general editing of the board.
137 You might also check out the
138 'Options->Test legality' option, and
139 remember to middle and right click to
140 insert new material in the board.
141 In order for this to work, you have to
142 put the bundled lyxskak.sty in a place
143 that TeX will find it, and you will need
144 to install the skak package from CTAN.
148 EditCommand "xboard -lpf $$FName -mode EditPosition"
149 AutomaticProduction true
151 Product "\\loadgame{$$FPath$$Basename}\\showboard"
155 Product "$$Contents(\"$$Basename.asc\")"
156 UpdateFormat asciichess
157 UpdateResult "$$Basename.asc"
160 Product "[Chess: $$Basename]"
163 Product "[Chess: $$FName]"
172 Read 'info date' for more information.
176 AutomaticProduction true
178 Product "$$Contents(\"$$Tempname\")"
180 UpdateResult "$$Tempname"
183 Product "$$Contents(\"$$Tempname\")"
185 UpdateResult "$$Tempname"
188 Product "$$Contents(\"$$Tempname\")"
190 UpdateResult "$$Tempname"
193 Product "$$Contents(\"$$Tempname\")"
195 UpdateResult "$$Tempname"