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}}}
37 GuiName "XFig: $$Basename"
40 This template uses XFig for editing.
44 EditCommand "xfig $$FName"
45 AutomaticProduction true
47 Product "\\inputOrWarn{$$Basename.pstex_t}"
49 UpdateResult "$$Basename.pstex_t"
50 Requirement "graphicx"
55 Product "\\inputOrWarn{$$Basename.pdftex_t}"
57 UpdateResult "$$Basename.pdftex_t"
58 Requirement "graphicx"
63 Product "$$Contents(\"$$Basename.asc\")"
64 UpdateFormat asciixfig
65 UpdateResult "$$Basename.asc"
68 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
70 UpdateResult "$$Basename.eps"
73 Product "[XFig: $$FName]"
78 GuiName "Chess: $$Basename"
80 A chess position diagram.
81 This template will use XBoard to edit the position.
82 Use the 'File->Save Position' in XBoard to save
83 the position that you want to display.
84 Make sure to give it a '.fen' extension
85 and remember to type in a relative path
86 to the LyX document location.
87 Within XBoard, use 'Edit->Edit Position'
88 to enable general editing of the board.
89 You might also check out the
90 'Options->Test legality' option, and
91 remember to middle and right click to
92 insert new material in the board.
93 In order for this to work, you have to
94 put the bundled lyxskak.sty in a place
95 that TeX will find it, and you will need
96 to install the skak package from CTAN.
100 EditCommand "xboard -lpf $$FName -mode EditPosition"
101 AutomaticProduction true
103 Product "\\loadgame{$$FPath$$Basename}\\showboard"
107 Product "$$Contents(\"$$Basename.asc\")"
108 UpdateFormat asciichess
109 UpdateResult "$$Basename.asc"
112 Product "[Chess: $$Basename]"
115 Product "[Chess: $$FName]"
123 Read 'info date' for more information.
127 AutomaticProduction true
129 Product "$$Contents(\"$$Tempname\")"
131 UpdateResult "$$Tempname"
134 Product "$$Contents(\"$$Tempname\")"
136 UpdateResult "$$Tempname"
139 Product "$$Contents(\"$$Tempname\")"
141 UpdateResult "$$Tempname"
144 Product "$$Contents(\"$$Tempname\")"
146 UpdateResult "$$Tempname"