lyx_mirror/lib/xtemplates/inkscape.xtemplate

77 lines
2.3 KiB
Plaintext
Raw Normal View History

#
# Inkscape External Template
#
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
#
# author Asger Alstrup Nielsen
# author Angus Leeming
# author Johnathan Burchill
#
# Full author contact details are available in file CREDITS.
PreambleDef WarnNotFound
%% Print a warning encased in an fbox.
\def\lyxstripprefix#1>{}
\newcommand{\warnNotFound}[1]{%
\def\lyxtempfilename{#1}%
\fbox{Could not find
\ttfamily\expandafter\lyxstripprefix\meaning\lyxtempfilename!}%
\typeout{Could not find \lyxtempfilename!}%
}
PreambleDefEnd
PreambleDef InputOrWarn
%% Input the file if it exists, using \input, else print a warning
\newcommand{\inputOrWarn}[1]{%
\IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}}
PreambleDefEnd
Template Inkscape
GuiName "Inkscape figure"
HelpText
An Inkscape figure.
This template should work flawlessly with Inkscape 0.48.
For Inkscape 0.91, there is a (reported) bug in the
LaTeX + PDF output which makes a workaround necessary,
see Embedded Objects manual.
Note that using this template automatically uses the
document text in the image (like with the Xfig template).
HelpTextEnd
InputFormat svg
FileFilter "*.svg"
AutomaticProduction true
Transform Rotate
Preview InstantPreview
Format PDFLaTeX
TransformCommand Rotate RotationLatexCommand
# Resize is not desirable here, as fonts are sized to surrounding LaTeX font
Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.pdf_tex}$$RotateBack"
UpdateFormat pdftex
UpdateResult "$$AbsPath$$Basename.pdf_tex"
Requirement "color"
Requirement "graphicx"
# Preamble WarnNotFound
# Preamble InputOrWarn
ReferencedFile pdflatex "$$AbsOrRelPathMaster$$Basename.pdf_tex"
ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
FormatEnd
Format LaTeX
TransformCommand Rotate RotationLatexCommand
Product "$$RotateFront\\input{$$AbsOrRelPathMaster$$Basename.eps_tex}$$RotateBack"
UpdateFormat pstex
UpdateResult "$$AbsPath$$Basename.eps_tex"
Requirement "color"
Requirement "graphicx"
# Preamble WarnNotFound
# Preamble InputOrWarn
ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.eps_tex"
ReferencedFile latex "$$AbsPath$$Basename.eps"
ReferencedFile dvi "$$AbsPath$$Basename.eps"
FormatEnd
TemplateEnd