2 # Inkscape External Template
4 # This file is part of LyX, the document processor.
5 # Licence details can be found in the file COPYING.
8 # author Martin Vermeer
10 # based on external templates by:
12 # author Asger Alstrup Nielsen
13 # author Angus Leeming
14 # author Johnathan Burchill
16 # Full author contact details are available in file CREDITS.
19 PreambleDef WarnNotFound
20 %% Print a warning encased in an fbox.
21 \def\lyxstripprefix#1>{}
22 \newcommand{\warnNotFound}[1]{%
23 \def\lyxtempfilename{#1}%
25 \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
26 \typeout{Could not find \lyxtempfilename!}%
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}}}
39 GuiName "Inkscape figure"
42 Note that using this template automatically uses the
43 document text in the image (like with the Xfig template).
47 AutomaticProduction true
49 Preview InstantPreview
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"
55 UpdateResult "$$AbsPath$$Basename.pdf_tex"
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"
65 TransformCommand Rotate RotationLatexCommand
66 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.eps_tex}$$RotateBack"
68 UpdateResult "$$AbsPath$$Basename.eps_tex"
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"
79 Product "[InkscapeGraphics: $$FName]"
82 Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
84 UpdateResult "$$AbsPath$$Basename.eps"
85 ReferencedFile docbook "$$AbsPath$$Basename.eps"
86 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
89 Product "<img src=\"$$AbsOrRelPathMaster$$Basename.svg\" />"
91 UpdateResult "$$AbsPath$$Basename.svg"
92 ReferencedFile xhtml "$$AbsPath$$Basename.svg"