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"
43 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
44 AutomaticProduction true
50 TransformOption Rotate RotationLatexOption
51 TransformOption Resize ResizeLatexOption
52 TransformOption Clip ClipLatexOption
53 TransformOption Extra ExtraOption
54 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
55 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
57 UpdateResult "$$AbsPath$$Basename.eps"
58 Requirement "graphicx"
61 TransformOption Rotate RotationLatexOption
62 TransformOption Resize ResizeLatexOption
63 TransformOption Clip ClipLatexOption
64 TransformOption Extra ExtraOption
65 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
66 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
68 UpdateResult "$$AbsPath$$Basename.png"
69 Requirement "graphicx"
72 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
73 UpdateFormat asciiimage
74 UpdateResult "$$AbsPath$$Basename.asc"
77 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
79 UpdateResult "$$AbsPath$$Basename.eps"
82 Product "[Bitmap: $$FName]"
88 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
94 AutomaticProduction true
98 TransformCommand Rotate RotationLatexCommand
99 TransformCommand Resize ResizeLatexCommand
100 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
102 UpdateResult "$$AbsPath$$Basename.pstex_t"
103 Requirement "graphicx"
104 Preamble WarnNotFound
108 TransformCommand Rotate RotationLatexCommand
109 TransformCommand Resize ResizeLatexCommand
110 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
112 UpdateResult "$$AbsPath$$Basename.pdftex_t"
113 Requirement "graphicx"
114 Preamble WarnNotFound
118 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
119 UpdateFormat asciixfig
120 UpdateResult "$$AbsPath$$Basename.asc"
123 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
125 UpdateResult "$$AbsPath$$Basename.eps"
128 Product "[XFig: $$FName]"
133 Template ChessDiagram
134 GuiName "Chess: $$AbsOrRelPathParent$$Basename"
136 A chess position diagram.
137 This template will use XBoard to edit the position.
138 Use the 'File->Save Position' in XBoard to save
139 the position that you want to display.
140 Make sure to give it a '.fen' extension
141 and remember to type in a relative path
142 to the LyX document location.
143 Within XBoard, use 'Edit->Edit Position'
144 to enable general editing of the board.
145 You might also check out the
146 'Options->Test legality' option, and
147 remember to middle and right click to
148 insert new material in the board.
149 In order for this to work, you have to
150 put the bundled lyxskak.sty in a place
151 that TeX will find it, and you will need
152 to install the skak package from CTAN.
156 AutomaticProduction true
158 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
162 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
163 UpdateFormat asciichess
164 UpdateResult "$$AbsPath$$Basename.asc"
167 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
170 Product "[Chess: $$FName]"
179 Read 'info date' for more information.
183 AutomaticProduction true
185 Product "$$Contents(\"$$Tempname\")"
187 UpdateResult "$$Tempname"
190 Product "$$Contents(\"$$Tempname\")"
192 UpdateResult "$$Tempname"
195 Product "$$Contents(\"$$Tempname\")"
197 UpdateResult "$$Tempname"
200 Product "$$Contents(\"$$Tempname\")"
202 UpdateResult "$$Tempname"