]> git.lyx.org Git - lyx.git/blob - lib/xtemplates/inkscape.xtemplate
Reset InsetArgument language after passthru status change
[lyx.git] / lib / xtemplates / inkscape.xtemplate
1 #
2 # Inkscape External Template
3 #
4 # This file is part of LyX, the document processor.
5 # Licence details can be found in the file COPYING.
6 #
7 # author Daniel Gloger
8 # author Martin Vermeer
9 #
10 # based on external templates by:
11 #
12 # author Asger Alstrup Nielsen
13 # author Angus Leeming
14 # author Johnathan Burchill
15 #
16 # Full author contact details are available in file CREDITS.
17
18
19 PreambleDef WarnNotFound
20         %% Print a warning encased in an fbox.
21         \def\lyxstripprefix#1>{}
22         \newcommand{\warnNotFound}[1]{%
23                 \def\lyxtempfilename{#1}%
24                 \fbox{Could not find
25                         \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
26                 \typeout{Could not find \lyxtempfilename!}%
27         }
28 PreambleDefEnd
29
30
31 PreambleDef InputOrWarn
32         %% Input the file if it exists, using \input, else print a warning
33         \newcommand{\inputOrWarn}[1]{%
34                 \IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
35 PreambleDefEnd
36
37
38 Template Inkscape
39         GuiName "Inkscape figure"
40         HelpText
41                 An Inkscape figure.
42                 Note that using this template automatically uses the 
43                 document text in the image (like with the Xfig template).
44         HelpTextEnd
45         InputFormat svg
46         FileFilter "*.{svg}"
47         AutomaticProduction true
48         Transform Rotate
49         Preview InstantPreview
50         Format PDFLaTeX
51                 TransformCommand Rotate RotationLatexCommand
52                 # Resize is not desirable here, as fonts are sized to surrounding LaTeX font
53                 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.pdf_tex}$$RotateBack"
54                 UpdateFormat pdftex
55                 UpdateResult "$$AbsPath$$Basename.pdf_tex"
56                 Requirement "xcolor"
57                 Requirement "graphicx"
58                 Requirement "mathtools"
59                 # Preamble WarnNotFound
60                 # Preamble InputOrWarn
61                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdf_tex"
62                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
63         FormatEnd
64         Format LaTeX
65                 TransformCommand Rotate RotationLatexCommand
66                 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.eps_tex}$$RotateBack"
67                 UpdateFormat pstex
68                 UpdateResult "$$AbsPath$$Basename.eps_tex"
69                 Requirement "xcolor"
70                 Requirement "graphicx"
71                 Requirement "mathtools"
72                 # Preamble WarnNotFound
73                 # Preamble InputOrWarn
74                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.eps_tex"
75                 ReferencedFile latex "$$AbsPath$$Basename.eps"
76                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
77         FormatEnd
78         Format Ascii
79                 Product "[InkscapeGraphics: $$FName]"
80         FormatEnd
81         Format DocBook
82                 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
83                 UpdateFormat eps
84                 UpdateResult "$$AbsPath$$Basename.eps"
85                 ReferencedFile docbook     "$$AbsPath$$Basename.eps"
86                 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
87         FormatEnd
88         Format XHTML
89                 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
90                 UpdateFormat svg
91                 UpdateResult "$$AbsPath$$Basename.svg"
92                 ReferencedFile xhtml "$$AbsPath$$Basename.svg"
93         FormatEnd
94 TemplateEnd
95