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