From 643f9ad4da72a94cee9edc64555ef1a4e7b4b495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Sun, 14 Jun 2015 17:27:21 +0200 Subject: [PATCH] configure.py: add support for pandoc and docx - make LyX aware of the docx format - add converters to odt and docx using the program Pandoc --- lib/configure.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/configure.py b/lib/configure.py index ba5d2a4120..9c6070ad81 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -680,11 +680,13 @@ def checkFormatEntries(dtl_tools): checkViewerEditor('an OpenDocument viewer', ['libreoffice', 'lwriter', 'lowriter', 'oowriter', 'swriter', 'abiword'], rc_entry = [r'''\Format odt odt "OpenDocument (tex4ht)" "" "%%" "%%" "document,vector,menu=export" "application/vnd.oasis.opendocument.text" \Format odt2 odt "OpenDocument (eLyXer)" "" "%%" "%%" "document,vector,menu=export" "application/vnd.oasis.opendocument.text" +\Format odt3 odt "OpenDocument (Pandoc)" "" "%%" "%%" "document,vector,menu=export" "application/vnd.oasis.opendocument.text" \Format sxw sxw "OpenOffice.Org (sxw)" "" "" "" "document,vector" "application/vnd.sun.xml.writer"''']) # checkViewerEditor('a Rich Text and Word viewer', ['libreoffice', 'lwriter', 'lowriter', 'oowriter', 'swriter', 'abiword'], rc_entry = [r'''\Format rtf rtf "Rich Text Format" "" "%%" "%%" "document,vector,menu=export" "application/rtf" -\Format word doc "MS Word" W "%%" "%%" "document,vector,menu=export" "application/msword"''']) +\Format word doc "MS Word" W "%%" "%%" "document,vector,menu=export" "application/msword" +\Format word2 docx "MS Word Office Open XML" W "%%" "%%" "document,vector,menu=export" "application/vnd.openxmlformats-officedocument.wordprocessingml.document"''']) # # entries that do not need checkProg addToRC(r'''\Format date "" "date command" "" "" "" "" "" @@ -827,6 +829,9 @@ def checkConverterEntries(): # checkProg('an OpenDocument -> LaTeX converter', ['w2l -clean $$i'], rc_entry = [ r'\converter odt latex "%%" ""' ]) + # + checkProg('a MS Word Office Open XML converter -> LaTeX', ['pandoc -s -f docx -o $$o -t latex $$i'], + rc_entry = [ r'\converter word2 latex "%%" ""' ]) # Only define a converter to pdf6, otherwise the odt format could be # used as an intermediate step for export to pdf, which is not wanted. checkProg('an OpenDocument -> PDF converter', ['unoconv -f pdf --stdout $$i > $$o'], @@ -845,6 +850,12 @@ def checkConverterEntries(): checkProg('a LaTeX -> RTF converter', ['latex2rtf -p -S -o $$o $$i', 'latex2rt -p -S -o $$o $$i'], rc_entry = [ r'\converter latex rtf "%%" "needaux"' ]) # + checkProg('a LaTeX -> Open Document (Pandoc) converter', ['pandoc -s -f latex -o $$o -t odt $$i'], + rc_entry = [ r'\converter latex odt3 "%%" ""' ]) + # + checkProg('a LaTeX -> MS Word Office Open XML converter', ['pandoc -s -f latex -o $$o -t docx $$i'], + rc_entry = [ r'\converter latex word2 "%%" ""' ]) + # checkProg('a RTF -> HTML converter', ['unrtf --html $$i > $$o'], rc_entry = [ r'\converter rtf html "%%" ""' ]) # Do not define a converter to pdf6, ps is a pure export format