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 This template uses Gimp for editing.
44 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
45 EditCommand "gimp $$FName"
46 AutomaticProduction true
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}"
59 UpdateResult "$$Basename.eps"
60 Requirement "graphicx"
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}"
70 UpdateResult "$$Basename.png"
71 Requirement "graphicx"
74 Product "$$Contents(\"$$Basename.asc\")"
75 UpdateFormat asciiimage
76 UpdateResult "$$Basename.asc"
79 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
81 UpdateResult "$$Basename.eps"
84 Product "[Bitmap: $$FName]"
90 GuiName "XFig: $$Basename"
93 This template uses XFig for editing.
97 EditCommand "xfig $$FName"
98 AutomaticProduction true
102 TransformCommand Rotate RotationLatexCommand
103 TransformCommand Resize ResizeLatexCommand
104 Product "$$RotateFront$$ResizeFront\\input{$$Basename.pstex_t}$$ResizeBack$$RotateBack"
106 UpdateResult "$$Basename.pstex_t"
107 Requirement "graphicx"
108 Preamble WarnNotFound
112 TransformCommand Rotate RotationLatexCommand
113 TransformCommand Resize ResizeLatexCommand
114 Product "$$RotateFront$$ResizeFront\\input{$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
116 UpdateResult "$$Basename.pdftex_t"
117 Requirement "graphicx"
118 Preamble WarnNotFound
122 Product "$$Contents(\"$$Basename.asc\")"
123 UpdateFormat asciixfig
124 UpdateResult "$$Basename.asc"
127 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
129 UpdateResult "$$Basename.eps"
132 Product "[XFig: $$FName]"
137 Template ChessDiagram
138 GuiName "Chess: $$Basename"
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.
160 EditCommand "xboard -lpf $$FName -mode EditPosition"
161 AutomaticProduction true
163 Product "\\loadgame{$$FPath$$Basename}\\showboard"
167 Product "$$Contents(\"$$Basename.asc\")"
168 UpdateFormat asciichess
169 UpdateResult "$$Basename.asc"
172 Product "[Chess: $$Basename]"
175 Product "[Chess: $$FName]"
184 Read 'info date' for more information.
188 AutomaticProduction true
190 Product "$$Contents(\"$$Tempname\")"
192 UpdateResult "$$Tempname"
195 Product "$$Contents(\"$$Tempname\")"
197 UpdateResult "$$Tempname"
200 Product "$$Contents(\"$$Tempname\")"
202 UpdateResult "$$Tempname"
205 Product "$$Contents(\"$$Tempname\")"
207 UpdateResult "$$Tempname"