Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: al.basili@gmail.com (alb) Newsgroups: comp.lang.python Subject: rst and pypandoc Date: 2 Mar 2015 07:59:03 GMT Lines: 31 Message-ID: X-Trace: individual.net HuqOtpOj/t5S90aPbWVzbAOZheo5d3byiuol1Rf9ymdETXBo3j X-Orig-Path: not-for-mail Cancel-Lock: sha1:vUMvQFVHhFlx6UR0zTvokx9b0nY= User-Agent: tin/2.1.1-20120623 ("Mulindry") (UNIX) (Linux/3.2.0-4-686-pae (i686)) Xref: csiph.com comp.lang.python:86700 Hi everyone, I'm writing a document in restructured text and I'd like to convert it to latex for printing. To accomplish this I've used semi-successfully pandoc and the wrapper pypandoc. My biggest issue is with figures and references to them. We've our macro to allocate figures so I'm forced to bypass the rst directive /.. figure/, moreover I haven't happened to find how you can reference to a figure in the rst docs. For all the above reasons I'm writing snippets of pure latex in my rst doc, but I'm having issues with the escape characters: i = '\ref{fig:abc}' print pypandoc.convert(i, 'latex', format='rst') ef\{fig:abc\} because of the \r that is interpreted by python as special character. If I try to escape with '\' I don't seem to find a way out... Any idea/pointer/suggestion? Al -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?