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