alb wrote:

> Could you explain why I then see the following difference:
> 
> In [56]: inp = r'\\ref{fig:abc}'
> 
> In [57]: print pypandoc.convert(inp, 'latex', format='rst')
> \textbackslash{}ref\{fig:abc\}
> 
> 
> In [58]: inp = r'\ref{fig:abc}'
> 
> In [59]: print pypandoc.convert(inp, 'latex', format='rst')
> ref\{fig:abc\}
> 
> The two results are clearly *not* the same, even though the two inp
> /claim/ to be the same...
 
The two inp are not the same.

I'm sorry if I confused you with my earlier typo, but 

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

starts with TWO backslashes, while:

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


starts with ONE backslash. Not the same.

I suspect you've been hitting your head against this problem for so long
you're starting to shy at shadows. Take a step back, a deep breath, and
remember your basic debugging skills:


a = r'\\ref{fig:abc}'
b = r'\ref{fig:abc}'
print a == b
print a, b
print repr(a), repr(b)
print len(a), len(b)


I'm sure that you know how to do such simple things to investigate whether
two inputs are in fact the same or not, and the fact that you failed to do
so is just a sign of your frustration and stress.


-- 
Steven

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

Reply via email to