Hi DocUtilisers,
An error arose when mapping a document with literal text::
**Some topic**
Topic explained.
More on the topic.
**Other topic**
More on other things.
The snapshot's rst2newlatex mapper generates this code::
\DNliteralblock{%
\DECattr{}{xml:space}{preserve}{literalblock}{%
**Some~topic**\mbox{}\\~~Topic~explained.\mbox{}\\\mbox{}\\~~More~on~the~topic.\mbox{}\\\mbox{}\\**Other~topic**\mbox{}\\~~More~on~other~things.%
}}%
Note the \\* which is treated badly in LaTeX. It is therefore better to
generate \\{} instead of \\ alone.
This can be accomplished in docutils/writers/newlatex2e/__init__.py.
Simple replace
if self.literal_block:
# Replace newlines with real newlines.
text = text.replace('\n', '\mbox{}\\\\')
replace_fn = self.encode_replace_for_literal_block_spaces
with
if self.literal_block:
# Replace newlines with real newlines.
text = text.replace('\n', '\mbox{}\\\\{}')
replace_fn = self.encode_replace_for_literal_block_spaces
This compiles the above example properly.
Please change!
Thanks,
Rick van Rein.
P.S. I am not a list member.
|