]> git.lyx.org Git - features.git/blob - lib/xtemplates/inkscape.xtemplate
Split external_templates to individual *.xtemplate files
[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 Angus Leeming
9 # author Johnathan Burchill
10 #
11 # Full author contact details are available in file CREDITS.
12
13
14 PreambleDef WarnNotFound
15         %% Print a warning encased in an fbox.
16         \def\lyxstripprefix#1>{}
17         \newcommand{\warnNotFound}[1]{%
18                 \def\lyxtempfilename{#1}%
19                 \fbox{Could not find
20                         \ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
21                 \typeout{Could not find \lyxtempfilename!}%
22         }
23 PreambleDefEnd
24
25
26 PreambleDef InputOrWarn
27         %% Input the file if it exists, using \input, else print a warning
28         \newcommand{\inputOrWarn}[1]{%
29                 \IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
30 PreambleDefEnd
31
32
33 Template Inkscape
34         GuiName "Inkscape figure"
35         HelpText
36                 An Inkscape figure.
37                 This template should work flawlessly with Inkscape 0.48. 
38                 For Inkscape 0.91, there is a (reported) bug in the 
39                 LaTeX + PDF output which makes a workaround necessary, 
40                 see Embedded Objects manual.
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 "color"
56                 Requirement "graphicx"
57                 # Preamble WarnNotFound
58                 # Preamble InputOrWarn
59                 ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdf_tex"
60                 ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
61         FormatEnd
62         Format LaTeX
63                 TransformCommand Rotate RotationLatexCommand
64                 Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.eps_tex}$$RotateBack"
65                 UpdateFormat pstex
66                 UpdateResult "$$AbsPath$$Basename.eps_tex"
67                 Requirement "color"
68                 Requirement "graphicx"
69                 # Preamble WarnNotFound
70                 # Preamble InputOrWarn
71                 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.eps_tex"
72                 ReferencedFile latex "$$AbsPath$$Basename.eps"
73                 ReferencedFile dvi   "$$AbsPath$$Basename.eps"
74         FormatEnd
75 TemplateEnd
76