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 # By default, InsetExternal is displayed as a grey button
39 # containing this text.
40 GuiName "Bitmap: $$AbsOrRelPathParent$$Basename"
41 # This text is used in the External dialog.
42 # Provide enough information to explain to the user just
43 # what the template can provide him with.
47 # ANY file type can be displayed as a RasterImage.
48 # Specifically, LyX will attempt to interrogate the file itself
49 # in order to deduce its format.
51 # Globbing pattern used when browsing for a Raster image file.
52 FileFilter "*.{gif,png,jpg,bmp,pbm,ppm,tga,tif,xpm,xbm}"
53 # Set to "true" if the file represented by the template
54 # must be generated by LyX.
55 AutomaticProduction true
56 # LyX has hard-coded support for these transformations
62 TransformOption Rotate RotationLatexOption
63 TransformOption Resize ResizeLatexOption
64 TransformOption Clip ClipLatexOption
65 TransformOption Extra ExtraOption
66 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
67 # This string is what is output to the LaTeX file.
68 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
70 UpdateResult "$$AbsPath$$Basename.eps"
71 Requirement "graphicx"
72 ReferencedFile latex "$$AbsPath$$Basename.eps"
73 ReferencedFile dvi "$$AbsPath$$Basename.eps"
76 TransformOption Rotate RotationLatexOption
77 TransformOption Resize ResizeLatexOption
78 TransformOption Clip ClipLatexOption
79 TransformOption Extra ExtraOption
80 Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
81 Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
83 UpdateResult "$$AbsPath$$Basename.png"
84 Requirement "graphicx"
85 ReferencedFile pdflatex "$$AbsPath$$Basename.png"
88 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
89 UpdateFormat asciiimage
90 UpdateResult "$$AbsPath$$Basename.asc"
93 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
95 UpdateResult "$$AbsPath$$Basename.eps"
96 ReferencedFile docbook "$$AbsPath$$Basename.eps"
97 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
100 Product "[Bitmap: $$FName]"
106 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
112 AutomaticProduction true
116 TransformCommand Rotate RotationLatexCommand
117 TransformCommand Resize ResizeLatexCommand
118 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pstex_t}$$ResizeBack$$RotateBack"
120 UpdateResult "$$AbsPath$$Basename.pstex_t"
121 Requirement "graphicx"
122 # Preamble WarnNotFound
123 # Preamble InputOrWarn
124 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
125 ReferencedFile latex "$$AbsPath$$Basename.eps"
126 ReferencedFile dvi "$$AbsPath$$Basename.eps"
129 TransformCommand Rotate RotationLatexCommand
130 TransformCommand Resize ResizeLatexCommand
131 Product "$$RotateFront$$ResizeFront\\input{$$AbsOrRelPathMaster$$Basename.pdftex_t}$$ResizeBack$$RotateBack"
133 UpdateResult "$$AbsPath$$Basename.pdftex_t"
134 Requirement "graphicx"
135 # Preamble WarnNotFound
136 # Preamble InputOrWarn
137 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
138 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
141 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
142 UpdateFormat asciixfig
143 UpdateResult "$$AbsPath$$Basename.asc"
146 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
148 UpdateResult "$$AbsPath$$Basename.eps"
149 ReferencedFile docbook "$$AbsPath$$Basename.eps"
150 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
153 Product "[XFig: $$FName]"
158 Template ChessDiagram
159 GuiName "Chess: $$AbsOrRelPathParent$$Basename"
161 A chess position diagram.
162 This template will use XBoard to edit the position.
163 Use the 'File->Save Position' in XBoard to save
164 the position that you want to display.
165 Make sure to give it a '.fen' extension
166 and remember to type in a relative path
167 to the LyX document location.
168 Within XBoard, use 'Edit->Edit Position'
169 to enable general editing of the board.
170 You might also check out the
171 'Options->Test legality' option, and
172 remember to middle and right click to
173 insert new material in the board.
174 In order for this to work, you have to
175 put the bundled lyxskak.sty in a place
176 that TeX will find it, and you will need
177 to install the skak package from CTAN.
181 AutomaticProduction true
183 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
185 ReferencedFile latex "$$AbsPath$$Basename$$Extension"
188 Product "\\loadgame{$$AbsOrRelPathMaster$$Basename}\\showboard"
190 ReferencedFile pdflatex "$$AbsPath$$Basename$$Extension"
193 Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
194 UpdateFormat asciichess
195 UpdateResult "$$AbsPath$$Basename.asc"
198 Product "[Chess: $$AbsOrRelPathMaster$$Basename]"
201 Product "[Chess: $$FName]"
210 Read 'info date' for more information.
214 AutomaticProduction true
216 Product "$$Contents(\"$$Tempname\")"
218 UpdateResult "$$Tempname"
221 Product "$$Contents(\"$$Tempname\")"
223 UpdateResult "$$Tempname"
226 Product "$$Contents(\"$$Tempname\")"
228 UpdateResult "$$Tempname"
231 Product "$$Contents(\"$$Tempname\")"
233 UpdateResult "$$Tempname"
236 Product "$$Contents(\"$$Tempname\")"
238 UpdateResult "$$Tempname"