]> git.lyx.org Git - lyx.git/blob - lib/external_templates
Small clean-up.
[lyx.git] / lib / external_templates
1 #
2 # file external_templates
3 # This file is part of LyX, the document processor.
4 # Licence details can be found in the file COPYING.
5 #
6 # author Asger Alstrup Nielsen
7 # author Angus Leeming
8 # author Johnathan Burchill
9 #
10 # Full author contact details are available in file CREDITS.
11
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
16
17
18 PreambleDef WarnNotFound
19         %% Print a warning encased in an fbox.
20         \def\lyxstripprefix#1>{}
21         \newcommand{\warnNotFound}[1]{%
22                 \def\lyxtempfilename{#1}%
23                 \fbox{Could not find
24                         \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
25                 \typeout{Could not find \lyxtempfilename!}%
26         }
27 PreambleDefEnd
28
29
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}}}
34 PreambleDefEnd
35
36 Template XFig
37         GuiName "XFig: $$Basename"
38         HelpText
39                 An XFig figure.
40                 This template uses XFig for editing.
41         HelpTextEnd
42         InputFormat fig
43         FileFilter "*.fig"
44         EditCommand "xfig $$FName"
45         AutomaticProduction true
46         Format LaTeX
47                 Product "\\inputOrWarn{$$Basename.pstex_t}"
48                 UpdateFormat pstex
49                 UpdateResult "$$Basename.pstex_t"
50                 Requirement "graphicx"
51                 Preamble WarnNotFound
52                 Preamble InputOrWarn
53         FormatEnd
54         Format PDFLaTeX
55                 Product "\\inputOrWarn{$$Basename.pdftex_t}"
56                 UpdateFormat pdftex
57                 UpdateResult "$$Basename.pdftex_t"
58                 Requirement "graphicx"  
59                 Preamble WarnNotFound
60                 Preamble InputOrWarn
61         FormatEnd
62         Format Ascii
63                 Product "$$Contents(\"$$Basename.asc\")"
64                 UpdateFormat asciixfig
65                 UpdateResult "$$Basename.asc"
66         FormatEnd
67         Format DocBook
68                 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
69                 UpdateFormat eps
70                 UpdateResult "$$Basename.eps"
71         FormatEnd
72         Format LinuxDoc
73                 Product "[XFig: $$FName]"
74         FormatEnd
75 TemplateEnd
76
77 Template ChessDiagram
78         GuiName "Chess: $$Basename"
79         HelpText
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.
97         HelpTextEnd
98         InputFormat fen
99         FileFilter "*.fen"
100         EditCommand "xboard -lpf $$FName -mode EditPosition"
101         AutomaticProduction true
102         Format LaTeX
103                 Product "\\loadgame{$$FPath$$Basename}\\showboard"
104                 Requirement "chess"
105         FormatEnd
106         Format Ascii
107                 Product "$$Contents(\"$$Basename.asc\")"
108                 UpdateFormat asciichess
109                 UpdateResult "$$Basename.asc"
110         FormatEnd
111         Format DocBook
112                 Product "[Chess: $$Basename]"
113         FormatEnd
114         Format LinuxDoc
115                 Product "[Chess: $$FName]"
116         FormatEnd
117 TemplateEnd
118
119 Template Date
120         GuiName "Date"
121         HelpText
122                 Todays date.
123                 Read 'info date' for more information.
124         HelpTextEnd
125         InputFormat date
126         FileFilter "*"
127         AutomaticProduction true
128         Format LaTeX
129                 Product "$$Contents(\"$$Tempname\")"
130                 UpdateFormat dateout
131                 UpdateResult "$$Tempname"
132         FormatEnd
133         Format Ascii
134                 Product "$$Contents(\"$$Tempname\")"
135                 UpdateFormat dateout
136                 UpdateResult "$$Tempname"
137         FormatEnd
138         Format DocBook
139                 Product "$$Contents(\"$$Tempname\")"
140                 UpdateFormat dateout
141                 UpdateResult "$$Tempname"
142         FormatEnd
143         Format LinuxDoc
144                 Product "$$Contents(\"$$Tempname\")"
145                 UpdateFormat dateout
146                 UpdateResult "$$Tempname"
147         FormatEnd
148 TemplateEnd
149