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