]> git.lyx.org Git - lyx.git/blob - lib/external_templates
The remaining External Template clean-up patch ;-)
[lyx.git] / lib / external_templates
1 # Basic External Templates for LyX
2
3 PreambleDef XFigInput
4         %% This inputs the file if it exists, else prints a warning
5         %% encased in an fbox.
6         \def\stripprefix#1>{}
7         \newcommand*{\xfiginput}[1]{%
8                 \edef\tempfilename{#1}%
9                 \InputIfFileExists{#1}{}{%
10                         \fbox{Could not find
11                         \ttfamily\expandafter\stripprefix\meaning\tempfilename
12                 !}}}
13 PreambleDefEnd
14
15 Template XFig
16         GuiName "[XFig: $$Basename]"
17         HelpText
18                 An XFig figure.
19                 This template uses XFig for editing.
20         HelpTextEnd
21         InputFormat fig
22         FileFilter "*.fig"
23         EditCommand "xfig $$FName"
24         AutomaticProduction true
25         Format LaTeX
26                 Product "\\xfiginput{$$Basename.pstex_t}"
27                 UpdateFormat pstex
28                 UpdateResult "$$Basename.pstex_t"
29                 Requirement "graphicx"
30                 Preamble XFigInput
31         FormatEnd
32         Format PDFLaTeX
33                 Product "\\xfiginput{$$Basename.pdftex_t}"
34                 UpdateFormat pdftex
35                 UpdateResult "$$Basename.pdftex_t"
36                 Requirement "graphicx"  
37                 Preamble XFigInput
38         FormatEnd
39         Format Ascii
40                 Product "$$Contents(\"$$Basename.asc\")"
41                 UpdateFormat asciixfig
42                 UpdateResult "$$Basename.asc"
43         FormatEnd
44         Format DocBook
45                 Product "<graphic fileref=\"$$Basename.eps\"></graphic>"
46                 UpdateFormat eps
47                 UpdateResult "$$Basename.eps"
48         FormatEnd
49         Format LinuxDoc
50                 Product "[XFig: $$FName]"
51         FormatEnd
52 TemplateEnd
53
54 Template ChessDiagram
55         GuiName "[Chess: $$Basename]"
56         HelpText
57                 A chess position diagram.
58                 This template will use XBoard to edit the position.
59                 Use the 'File->Save Position' in XBoard to save 
60                 the position that you want to display.
61                 Make sure to give it a '.fen' extension
62                 and remember to type in a relative path
63                 to the LyX document location.
64                 Within XBoard, use 'Edit->Edit Position'
65                 to enable general editing of the board.
66                 You might also check out the
67                 'Options->Test legality' option, and
68                 remember to middle and right click to 
69                 insert new material in the board.
70                 In order for this to work, you have to
71                 put the bundled lyxskak.sty in a place
72                 that TeX will find it, and you will need
73                 to install the skak package from CTAN.
74         HelpTextEnd
75         InputFormat fen
76         FileFilter "*.fen"
77         EditCommand "xboard -lpf $$FName -mode EditPosition"
78         AutomaticProduction true
79         Format LaTeX
80                 Product "\\loadgame{$$FPath$$Basename}\\showboard"
81                 Requirement "chess"
82         FormatEnd
83         Format Ascii
84                 Product "$$Contents(\"$$Basename.asc\")"
85                 UpdateFormat asciichess
86                 UpdateResult "$$Basename.asc"
87         FormatEnd
88         Format DocBook
89                 Product "[Chess: $$Basename]"
90         FormatEnd
91         Format LinuxDoc
92                 Product "[Chess: $$FName]"
93         FormatEnd
94 TemplateEnd
95
96 Template Date
97         GuiName "[Date]"
98         HelpText
99                 Todays date.
100                 Read 'info date' for more information.
101         HelpTextEnd
102         InputFormat date
103         FileFilter "*"
104         AutomaticProduction true
105         Format LaTeX
106                 Product "$$Contents(\"$$Tempname\")"
107                 UpdateFormat dateout
108                 UpdateResult "$$Tempname"
109         FormatEnd
110         Format Ascii
111                 Product "$$Contents(\"$$Tempname\")"
112                 UpdateFormat dateout
113                 UpdateResult "$$Tempname"
114         FormatEnd
115         Format DocBook
116                 Product "$$Contents(\"$$Tempname\")"
117                 UpdateFormat dateout
118                 UpdateResult "$$Tempname"
119         FormatEnd
120         Format LinuxDoc
121                 Product "$$Contents(\"$$Tempname\")"
122                 UpdateFormat dateout
123                 UpdateResult "$$Tempname"
124         FormatEnd
125 TemplateEnd
126