- ''' Check all converters (\converter entries) '''
- checkProg('the pdflatex program', ['pdflatex $$i'],
- rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex"' ])
-
- ''' If we're running LyX in-place then tex2lyx will be found in
- ../src/tex2lyx. Add this directory to the PATH temporarily and
- search for tex2lyx.
- Use PATH to avoid any problems with paths-with-spaces.
- '''
- path_orig = os.environ["PATH"]
- os.environ["PATH"] = os.path.join('..', 'src', 'tex2lyx') + \
- os.pathsep + path_orig
-
- checkProg('a LaTeX -> LyX converter', ['tex2lyx -f $$i $$o', \
- 'tex2lyx' + version_suffix + ' -f $$i $$o' ],
- rc_entry = [ r'\converter latex lyx "%%" ""' ])
-
- os.environ["PATH"] = path_orig
-
- #
- checkProg('a Noweb -> LyX converter', ['noweb2lyx' + version_suffix + ' $$i $$o'], path = ['./reLyX'],
- rc_entry = [ r'\converter literate lyx "%%" ""' ])
- #
- checkProg('a Noweb -> LaTeX converter', ['noweave -delay -index $$i > $$o'],
- rc_entry = [ r'\converter literate latex "%%" ""' ])
- #
- checkProg('a HTML -> LaTeX converter', ['html2latex $$i'],
- rc_entry = [ r'\converter html latex "%%" ""' ])
- #
- checkProg('a MSWord -> LaTeX converter', ['wvCleanLatex $$i $$o'],
- rc_entry = [ r'\converter word latex "%%" ""' ])
- #
- checkProg('a LaTeX -> MS Word converter', ["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'"],
- rc_entry = [ r'\converter latex wordhtml "%%" ""' ])
- #
- checkProg('an OpenOffice.org -> LaTeX converter', ['w2l -clean $$i'],
- rc_entry = [ r'\converter sxw latex "%%" ""' ])
- #
- checkProg('an LaTeX -> OpenOffice.org LaTeX converter', ['oolatex $$i', 'oolatex.sh $$i'],
- rc_entry = [ r'\converter latex sxw "%%" "latex"' ])
- #
- checkProg('a PS to PDF converter', ['ps2pdf13 $$i $$o'],
- rc_entry = [ r'\converter ps pdf "%%" ""' ])
- #
- checkProg('a DVI to PS converter', ['dvips -o $$o $$i'],
- rc_entry = [ r'\converter dvi ps "%%" ""' ])
- #
- checkProg('a DVI to PDF converter', ['dvipdfmx -o $$o $$i', 'dvipdfm -o $$o $$i'],
- rc_entry = [ r'\converter dvi pdf3 "%%" ""' ])
- #
- path, dvipng = checkProg('dvipng', ['dvipng'])
- if dvipng == "dvipng":
- addToRC(r'\converter lyxpreview png "python $$s/scripts/lyxpreview2bitmap.py" ""')
- else:
- addToRC(r'\converter lyxpreview png "" ""')
- #
- checkProg('a fax program', ['kdeprintfax $$i', 'ksendfax $$i'],
- rc_entry = [ r'\converter ps fax "%%" ""'])
- #
- checkProg('a FIG -> EPS/PPM converter', ['fig2dev'],
- rc_entry = [
- r'''\converter fig eps "fig2dev -L eps $$i $$o" ""
+ ''' Check all converters (\converter entries) '''
+ checkProg('the pdflatex program', ['pdflatex $$i'],
+ rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex"' ])
+
+ checkProg('XeTeX', ['xelatex $$i'],
+ rc_entry = [ r'\converter xetex pdf4 "%%" "latex"' ])
+
+ ''' If we're running LyX in-place then tex2lyx will be found in
+ ../src/tex2lyx. Add this directory to the PATH temporarily and
+ search for tex2lyx.
+ Use PATH to avoid any problems with paths-with-spaces.
+ '''
+ path_orig = os.environ["PATH"]
+ os.environ["PATH"] = os.path.join('..', 'src', 'tex2lyx') + \
+ os.pathsep + path_orig
+
+ checkProg('a LaTeX/Noweb -> LyX converter', ['tex2lyx', 'tex2lyx' + version_suffix],
+ rc_entry = [r'''\converter latex lyx "%% -f $$i $$o" ""
+\converter literate lyx "%% -n -f $$i $$o" ""'''])
+
+ os.environ["PATH"] = path_orig
+
+ #
+ checkProg('a Noweb -> LaTeX converter', ['noweave -delay -index $$i > $$o'],
+ rc_entry = [r'''\converter literate latex "%%" ""
+\converter literate pdflatex "%%" ""'''])
+ #
+ checkProg('a Sweave -> LaTeX converter', ['Rscript --vanilla $$s/scripts/lyxsweave.R $$i $$e'],
+ rc_entry = [r'''\converter sweave latex "%%" ""
+\converter sweave pdflatex "%%" ""'''])
+ #
+ checkProg('an HTML -> LaTeX converter', ['html2latex $$i', 'gnuhtml2latex $$i', \
+ 'htmltolatex -input $$i -output $$o', 'java -jar htmltolatex.jar -input $$i -output $$o'],
+ rc_entry = [ r'\converter html latex "%%" ""' ])
+ #
+ checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'],
+ rc_entry = [ r'\converter word latex "%%" ""' ])
+
+ # eLyXer: search as a Python module and then as an executable (elyxer.py, elyxer)
+ elyxerfound = checkModule('elyxer')
+ if elyxerfound:
+ addToRC(r'''\converter lyx html "python -m elyxer --directory $$r $$i $$o" ""''')
+ else:
+ path, elyxer = checkProg('a LyX -> HTML converter',
+ ['elyxer.py --directory $$r $$i $$o', 'elyxer --directory $$r $$i $$o'],
+ rc_entry = [ r'\converter lyx html "%%" ""' ])
+ if elyxer.find('elyxer') >= 0:
+ elyxerfound = True
+
+ if elyxerfound:
+ addToRC(r'''\copier html "python -tt $$s/scripts/ext_copy.py -e html,png,jpg,jpeg,css $$i $$o"''')
+ else:
+ # search for other converters than eLyXer
+ # On SuSE the scripts have a .sh suffix, and on debian they are in /usr/share/tex4ht/
+ path, htmlconv = checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 'htlatex.sh $$i', \
+ '/usr/share/tex4ht/htlatex $$i', 'tth -t -e2 -L$$b < $$i > $$o', \
+ 'latex2html -no_subdir -split 0 -show_section_numbers $$i', 'hevea -s $$i'],
+ rc_entry = [ r'\converter latex html "%%" "needaux"' ])
+ if htmlconv.find('htlatex') >= 0 or htmlconv == 'latex2html':
+ addToRC(r'''\copier html "python -tt $$s/scripts/ext_copy.py -e html,png,css $$i $$o"''')
+ else:
+ addToRC(r'''\copier html "python -tt $$s/scripts/ext_copy.py $$i $$o"''')
+
+ # Check if LyxBlogger is installed.
+ path, lyxblogger = checkProg('A LyX to WordPress Blog Publishing Tool',
+ ['lyxblogger $$i'], rc_entry = [])
+ if lyxblogger.find('lyxblogger') >= 0:
+ addToRC(r'\Format blog blog "LyxBlogger" "" "" "" "document"')
+ addToRC(r'\converter xhtml blog "lyxblogger $$i" ""')
+
+ if elyxerfound:
+ addToRC(r'''\converter lyx wordhtml "python -m elyxer --html --directory $$r $$i $$o" ""''')
+ else:
+ path, elyxer = checkProg('a LyX -> MS Word converter',
+ ['elyxer.py --directory $$r $$i $$o', 'elyxer --html --directory $$r $$i $$o'],
+ rc_entry = [ r'\converter lyx wordhtml "%%" ""' ])
+ if elyxer.find('elyxer') >= 0:
+ elyxerfound = True
+
+ if elyxerfound:
+ addToRC(r'''\copier wordhtml "python -tt $$s/scripts/ext_copy.py -e html,png,jpg,jpeg,css $$i $$o"''')
+ else:
+ # search for other converters than eLyXer
+ # On SuSE the scripts have a .sh suffix, and on debian they are in /usr/share/tex4ht/
+ path, htmlconv = checkProg('a LaTeX -> MS Word converter', ["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'", \
+ "htlatex.sh $$i 'html,word' 'symbol/!' '-cvalidate'", \
+ "/usr/share/tex4ht/htlatex $$i 'html,word' 'symbol/!' '-cvalidate'"],
+ rc_entry = [ r'\converter latex wordhtml "%%" "needaux"' ])
+ if htmlconv.find('htlatex') >= 0:
+ addToRC(r'''\copier wordhtml "python -tt $$s/scripts/ext_copy.py -e html,png,css $$i $$o"''')
+ else:
+ addToRC(r'''\copier wordhtml "python -tt $$s/scripts/ext_copy.py $$i $$o"''')
+
+ #
+ checkProg('an OpenOffice.org -> LaTeX converter', ['w2l -clean $$i'],
+ rc_entry = [ r'\converter sxw latex "%%" ""' ])
+ #
+ checkProg('an OpenDocument -> LaTeX converter', ['w2l -clean $$i'],
+ rc_entry = [ r'\converter odt latex "%%" ""' ])
+ # According to http://www.tug.org/applications/tex4ht/mn-commands.html
+ # the command mk4ht oolatex $$i has to be used as default,
+ # but as this would require to have Perl installed, in MiKTeX oolatex is
+ # directly available as application.
+ # On SuSE the scripts have a .sh suffix, and on debian they are in /usr/share/tex4ht/
+ # Both SuSE and debian have oolatex
+ checkProg('a LaTeX -> Open Document converter', [
+ 'oolatex $$i', 'mk4ht oolatex $$i', 'oolatex.sh $$i', '/usr/share/tex4ht/oolatex $$i',
+ 'htlatex $$i \'xhtml,ooffice\' \'ooffice/! -cmozhtf\' \'-coo\' \'-cvalidate\''],
+ rc_entry = [ r'\converter latex odt "%%" "needaux"' ])
+ # On windows it is called latex2rt.exe
+ 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 RTF -> HTML converter', ['unrtf --html $$i > $$o'],
+ rc_entry = [ r'\converter rtf html "%%" ""' ])
+ #
+ checkProg('a PS to PDF converter', ['ps2pdf13 $$i $$o'],
+ rc_entry = [ r'\converter ps pdf "%%" ""' ])
+ #
+ checkProg('a PS to TXT converter', ['pstotext $$i > $$o'],
+ rc_entry = [ r'\converter ps text2 "%%" ""' ])
+ #
+ checkProg('a PS to TXT converter', ['ps2ascii $$i $$o'],
+ rc_entry = [ r'\converter ps text3 "%%" ""' ])
+ #
+ checkProg('a PS to EPS converter', ['ps2eps $$i'],
+ rc_entry = [ r'\converter ps eps "%%" ""' ])
+ #
+ checkProg('a PDF to PS converter', ['pdf2ps $$i $$o', 'pdftops $$i $$o'],
+ rc_entry = [ r'\converter pdf ps "%%" ""' ])
+ #
+ checkProg('a PDF to EPS converter', ['pdftops -eps -f 1 -l 1 $$i $$o'],
+ rc_entry = [ r'\converter pdf eps "%%" ""' ])
+ #
+ checkProg('a DVI to TXT converter', ['catdvi $$i > $$o'],
+ rc_entry = [ r'\converter dvi text4 "%%" ""' ])
+ #
+ checkProg('a DVI to PS converter', ['dvips -o $$o $$i'],
+ rc_entry = [ r'\converter dvi ps "%%" ""' ])
+ #
+ checkProg('a DVI to PDF converter', ['dvipdfmx -o $$o $$i', 'dvipdfm -o $$o $$i'],
+ rc_entry = [ r'\converter dvi pdf3 "%%" ""' ])
+ #
+ path, dvipng = checkProg('dvipng', ['dvipng'])
+ if dvipng == "dvipng":
+ addToRC(r'\converter lyxpreview png "python -tt $$s/scripts/lyxpreview2bitmap.py" ""')
+ else:
+ addToRC(r'\converter lyxpreview png "" ""')
+ #
+ checkProg('a fax program', ['kdeprintfax $$i', 'ksendfax $$i', 'hylapex $$i'],
+ rc_entry = [ r'\converter ps fax "%%" ""'])
+ #
+ checkProg('a FIG -> EPS/PPM converter', ['fig2dev'],
+ rc_entry = [
+ r'''\converter fig eps "fig2dev -L eps $$i $$o" ""