Hi MRAB,

MRAB <pyt...@mrabarnett.plus.com> wrote:
[]
> Have you tried escaping the escape character by doubling the backslash?
> 
> inp = '\\\\ref{fig:abc}'

In [54]: inp = '\\\\ref{fig:abc}'

In [55]: print pypandoc.convert(inp, 'latex', format='rst')
\textbackslash{}ref\{fig:abc\}

the backslash is considered as literal text for latex and is escaped 
with the appropriate command.

> or:
> 
> inp = r'\\ref{fig:abc}'
> 

In [56]: inp = r'\\ref{fig:abc}'

In [57]: print pypandoc.convert(inp, 'latex', format='rst')
\textbackslash{}ref\{fig:abc\}

same as above. The result I aim to would be:

In [BINGO]: print pypandoc.convert(inp, 'latex', format='rst')
\ref{fig:abc}

Al

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to