From b17f13a5e5b4f1708cee3b81dc8e8e7e559c3f20 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Tue, 16 Dec 2008 16:07:07 +0000 Subject: [PATCH] Allow Dia diagrams as external insets. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27899 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/configure.py | 10 ++++++++ lib/external_templates | 55 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/lib/configure.py b/lib/configure.py index 84bbdaf709..454f9aaa3e 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -255,6 +255,9 @@ def checkFormatEntries(dtl_tools): checkViewer('a FIG viewer and editor', ['xfig', 'jfig3-itext.jar', 'jfig3.jar'], rc_entry = [r'\Format fig fig FIG "" "%%" "%%" "vector"']) # + checkViewer('a Dia viewer and editor', ['dia'], + rc_entry = [r'\Format dia dia DIA "" "%%" "%%" "vector"']) + # checkViewer('a Grace viewer and editor', ['xmgrace'], rc_entry = [r'\Format agr agr Grace "" "%%" "%%" "vector"']) # @@ -284,6 +287,7 @@ def checkFormatEntries(dtl_tools): \Format docbook sgml DocBook B "" "%%" "document" \Format docbook-xml xml "Docbook (XML)" "" "" "%%" "document" \Format dot dot "Graphviz Dot" "" "" "%%" "vector" +\Format dia dia "Dia" "" "" "%%" "vector" \Format platex tex "LaTeX (pLaTeX)" "" "" "%%" "document" \Format literate nw NoWeb N "" "%%" "document" \Format lilypond ly "LilyPond music" "" "" "%%" "vector" @@ -503,6 +507,12 @@ def checkConverterEntries(): checkProg('a Dot -> PDF converter', ['dot -Tpdf $$i -o $$o'], rc_entry = [ r'\converter dot pdf "%%" ""']) # + checkProg('a Dia -> PNG converter', ['dia -e $$o -t png $$i'], + rc_entry = [ r'\converter dia png "%%" ""']) + # + checkProg('a Dia -> EPS converter', ['dia -e $$o -t eps $$i'], + rc_entry = [ r'\converter dia eps "%%" ""']) + # # path, lilypond = checkProg('a LilyPond -> EPS/PDF/PNG converter', ['lilypond']) if (lilypond != ''): diff --git a/lib/external_templates b/lib/external_templates index d064b2f4d3..86ac7ec151 100644 --- a/lib/external_templates +++ b/lib/external_templates @@ -328,3 +328,58 @@ Template Date UpdateResult "$$Tempname" FormatEnd TemplateEnd + +Template Dia + GuiName "Dia: $$AbsOrRelPathParent$$Basename" + HelpText + Dia diagram. + HelpTextEnd + InputFormat dia + FileFilter "*.dia" + AutomaticProduction true + # LyX has hard-coded support for these transformations + Transform Rotate + Transform Resize + Transform Clip + Transform Extra + Preview InstantPreview + Format LaTeX + TransformOption Rotate RotationLatexOption + TransformOption Resize ResizeLatexOption + TransformOption Clip ClipLatexOption + TransformOption Extra ExtraOption + Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]" + # This string is what is output to the LaTeX file. + Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}" + UpdateFormat eps + UpdateResult "$$AbsPath$$Basename.eps" + Requirement "graphicx" + ReferencedFile latex "$$AbsPath$$Basename.eps" + ReferencedFile dvi "$$AbsPath$$Basename.eps" + FormatEnd + Format PDFLaTeX + TransformOption Rotate RotationLatexOption + TransformOption Resize ResizeLatexOption + TransformOption Clip ClipLatexOption + TransformOption Extra ExtraOption + Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]" + Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}" + UpdateFormat pdf + UpdateResult "$$AbsPath$$Basename.pdf" + Requirement "graphicx" + ReferencedFile pdflatex "$$AbsPath$$Basename.pdf" + FormatEnd + Format Ascii + Product "$$Contents(\"$$AbsPath$$Basename.asc\")" + UpdateFormat asciiimage + UpdateResult "$$AbsPath$$Basename.asc" + FormatEnd + Format DocBook + Product "" + UpdateFormat eps + UpdateResult "$$AbsPath$$Basename.eps" + ReferencedFile docbook "$$AbsPath$$Basename.eps" + ReferencedFile docbook-xml "$$AbsPath$$Basename.eps" + FormatEnd +TemplateEnd +