0

I am using RST styling to generate a PDF using rst2pdf. Sometimes I have content that needs to span multiple lines. I can't seem to figure out how to do this with line blocks because the spacing is way off. Does anyone know how to fix the line spacing or another way to do this?

RST file:

* I am a good a paragraph with normal spacing. I am a good a paragraph with normal spacing. I am a good a paragraph with normal spacing. I am a good a paragraph with normal spacing. 
|    Why is the spacing
|    so far apart
|    for these other lines?
|    Help!

Result: line spacing issue

Sarah
  • 669
  • 2
  • 8
  • 21
  • In HTML it looks fine. I suspect that `rst2pdf` does not apply a correct style, and you will have to dig into its innards to apply a correct style for line blocks. As a side note, reST interprets `*` as a list item, not a paragraph. Perhaps remove the `*` and add a new line to make it unambiguously a paragraph? Finally I didn't see any open [issues for "line blocks"](https://github.com/rst2pdf/rst2pdf/issues?utf8=%E2%9C%93&q=line+blocks). – Steve Piercy Nov 06 '19 at 18:14

1 Answers1

0

I was able to fix this by applying a style to my line block.

style

  spacing:
    parent: bodytext
    spaceAfter: 0
    spaceBefore: 0

code

* I am a good a paragraph with normal spacing. I am a good a paragraph with normal spacing. I am a good a paragraph with normal spacing. I am a good a paragraph with normal spacing. 
.. class:: spacing

    |    Why is the spacing
    |    so far apart
    |    for these other lines?
    |    Help!

result enter image description here

Sarah
  • 669
  • 2
  • 8
  • 21