]> git.lyx.org Git - features.git/blob - lib/xtemplates/inkscape.xtemplate
inkscape.xtemplate: fixes issues 3, 6 and 7 of bug #10679
[features.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 Asger Alstrup Nielsen
8 # author Johnathan Burchill
9 #
10 # Full author contact details are available in file CREDITS.
11
12
13 PreambleDef WarnNotFound
14         %% Print a warning encased in an fbox.
15         \def\lyxstripprefix#1>{}
16         \newcommand{\warnNotFound}[1]{%
17                 \def\lyxtempfilename{#1}%
18                 \fbox{Could not find
19                         \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
20                 \typeout{Could not find \lyxtempfilename!}%
21         }
22 PreambleDefEnd
23
24
25 PreambleDef InputOrWarn
26         %% Input the file if it exists, using \input, else print a warning
27         \newcommand{\inputOrWarn}[1]{%
28                 \IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
29 PreambleDefEnd
30
31
32 Template Inkscape
33         GuiName "Inkscape figure"
34         HelpText
35                 An Inkscape figure.
36                 Note that using this template automatically uses the 
37                 document text in the image (like with the Xfig template).
38         HelpTextEnd
39         InputFormat svg
40         FileFilter "*.{svg}"
41         AutomaticProduction true
42         Transform Rotate
43         Preview InstantPreview
44         Format PDFLaTeX
45                 TransformCommand Rotate RotationLatexCommand
46                 # Resize is not desirable here, as fonts are sized to surrounding LaTeX font
47                 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.pdf_tex}$$RotateBack"
48                 UpdateFormat pdftex
49                 UpdateResult "$$AbsPath$$Basename.pdf_tex"
50                 Requirement "xcolor"
51                 Requirement "graphicx"
52                 Requirement "mathtools"
53                 # Preamble WarnNotFound
54                 # Preamble InputOrWarn
55                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdf_tex"
56                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
57         FormatEnd
58         Format LaTeX
59                 TransformCommand Rotate RotationLatexCommand
60                 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.eps_tex}$$RotateBack"
61                 UpdateFormat pstex
62                 UpdateResult "$$AbsPath$$Basename.eps_tex"
63                 Requirement "xcolor"
64                 Requirement "graphicx"
65                 Requirement "mathtools"
66                 # Preamble WarnNotFound
67                 # Preamble InputOrWarn
68                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.eps_tex"
69                 ReferencedFile latex "$$AbsPath$$Basename.eps"
70                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
71         FormatEnd
72 TemplateEnd
73