Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: al.basili@gmail.com (alb) Newsgroups: comp.lang.python Subject: Re: rst and pypandoc Date: 3 Mar 2015 20:50:16 GMT Lines: 39 Message-ID: References: <54f458a5$0$13003$c3e8da3$5496439d@news.astraweb.com> X-Trace: individual.net Oeo2KGb3G1GgHfgsL5xSfQb5TaBtSm/fzRbWaYB7y/Tl2HYSqB X-Orig-Path: not-for-mail Cancel-Lock: sha1:W6/l+ubHrWKPodvVcenM/4re3f8= User-Agent: tin/2.1.1-20120623 ("Mulindry") (UNIX) (Linux/3.2.0-4-686-pae (i686)) Xref: csiph.com comp.lang.python:86866 Hi Gregory, Gregory Ewing wrote: [] > From a cursory reading of the pypandoc docs, it looks > like enabling the raw_tex extension in pypandoc will > give you what you want. > > Search for raw_tex on this page: > > http://johnmacfarlane.net/pandoc/README.html As far as I understood the docs, it seems this extension should be passed to pandoc through +EXTERNSION, but I don't seem to get it working: In [14]: print pypandoc.convert(s, 'latex', format="md+raw_tex") --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) in () ----> 1 print pypandoc.convert(s, 'latex', format="md+raw_tex") /usr/local/lib/python2.7/dist-packages/pypandoc.pyc in convert(source, to, format, extra_args, encoding) 25 ''' 26 return _convert(_read_file, _process_file, source, to, ---> 27 format, extra_args, encoding=encoding) 28 29 /usr/local/lib/python2.7/dist-packages/pypandoc.pyc in _convert(reader, processor, source, to, format, extra_args, encoding) 50 raise RuntimeError( 51 'Invalid input format! Expected one of these: ' + ---> 52 ', '.join(from_formats)) 53 54 if to not in to_formats: RuntimeError: Invalid input format! Expected one of these: native, json, markdown, markdown+lhs, rst, rst+lhs, docbook, textile, html, latex, latex+lhs