From a978795215ca2df56391852bee84088b1a5f19ad Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Thu, 9 Dec 2010 01:19:13 +0000 Subject: [PATCH] After more attempts add gnumeric support. Patch from Helge Hafting. http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg164180.html git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36786 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/configure.py | 12 ++++++++++++ lib/external_templates | 39 +++++++++++++++++++++++++++++++++++++++ src/LaTeXFeatures.cpp | 1 + 3 files changed, 52 insertions(+) diff --git a/lib/configure.py b/lib/configure.py index 038c766276..7c0d97e418 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -515,6 +515,11 @@ def checkFormatEntries(dtl_tools): \Format text3 txt "Plain text (ps2ascii)" "" "" "%%" "document" \Format text4 txt "Plain text (catdvi)" "" "" "%%" "document" \Format textparagraph txt "Plain Text, Join Lines" "" "" "%%" "document"''' ]) + #Spreadsheets using ssconvert from gnumeric + checkViewer('gnumeric spreadsheet software', ['gnumeric'], + rc_entry = [r'''\Format gnumeric gnumeric "Gnumeric spreadsheet" "" "" "%%" "document" +\Format excel xls "Excel spreadsheet" "" "" "%%" "document" +\Format oocalc ods "OpenOffice spreadsheet" "" "" "%%" "document"''']) # path, xhtmlview = checkViewer('an HTML previewer', ['firefox', 'mozilla file://$$p$$i', 'netscape'], rc_entry = [r'\Format xhtml xhtml "LyXHTML" y "%%" "" "document"']) @@ -805,6 +810,13 @@ def checkConverterEntries(): rc_entry = [ r'\converter svg png "%%" ""']) # + # gnumeric/xls/ods to tex + checkProg('a spreadsheet -> latex converter', ['ssconvert'], + rc_entry = [ r'''\converter gnumeric latex "ssconvert --export-type=Gnumeric_html:latex $$i $$o" "" +\converter ods latex "ssconvert --export-type=Gnumeric_html:latex $$i $$o" "" +\converter xls latex "ssconvert --export-type=Gnumeric_html:latex $$i $$o" ""''', +'']) + path, lilypond = checkProg('a LilyPond -> EPS/PDF/PNG converter', ['lilypond']) if (lilypond != ''): version_string = cmdOutput("lilypond --version") diff --git a/lib/external_templates b/lib/external_templates index 4f4af8c92f..61dbddf2fc 100644 --- a/lib/external_templates +++ b/lib/external_templates @@ -33,6 +33,45 @@ PreambleDef InputOrWarn \IfFileExists{#1}{\input{#1}}{\warnNotFound{#1}}} PreambleDefEnd +Template GnumericSpreadsheet + GuiName "Spreadsheet" + HelpText + A spreadsheet made with gnumeric, openoffice or excel. + It imports as a long table, so any length + is ok. Excessive width could be a problem. + The gnumeric software is necessary for conversion, + both for gnumeric and excel files. + HelpTextEnd + InputFormat "gnumeric" + FileFilter "*.{gnumeric,ods,xls}" + AutomaticProduction true + Format LaTeX + Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}" + UpdateFormat latex + UpdateResult "$$AbsPath$$Basename.tex" + Requirement "color" + Requirement "array" + Requirement "longtable" + Requirement "calc" + Requirement "multirow" + Requirement "hhline" + Requirement "ifthen" + ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.tex" + FormatEnd + Format PDFLaTeX + Product "\\def\\inputGnumericTable{}\\input{$$AbsOrRelPathMaster$$Basename.tex}" + UpdateFormat latex + UpdateResult "$$AbsPath$$Basename.tex" + Requirement "color" + Requirement "array" + Requirement "longtable" + Requirement "calc" + Requirement "multirow" + Requirement "hhline" + Requirement "ifthen" + ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.tex" + FormatEnd +TemplateEnd Template RasterImage # By default, InsetExternal is displayed as a grey button diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index b47cab129c..46afe7cc4a 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -588,6 +588,7 @@ char const * simplefeatures[] = { "csquotes", "enumitem", "endnotes", + "hhline", "ifthen", // listings is handled in BufferParams.cpp "bm",