You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main title of the document is generally included in the cover page, so you don't want it again at the start of the actual contents.
This also causes everything in the document structure to jump one level down, with the document title as a new top node including everything.
Description of problem
A simple document like this:
Main title
==========
Intro
-----
Lots of text
In the PDF I then get a cover page with "Main title", then on the first page we get "Main title" again.
What is the expected output? What do you see instead?
The body of the document should start with "Intro".
🖥 Versions python -V: 3.6.12
pip freeze | grep rst2pdf: 0.98
pip freeze | grep reportlab: 3.6.1
pip freeze | grep Sphinx: 4.2.0
Which operating system are you using?
Linux
Additional information
If I compare things with Sphinx' LaTeX based PDF generator it omits this top level structure node. I've written a Sphinx extension that does the same for rst2pdf:
## Extension that removes the top level section wrapper#fromsphinx.transforms.post_transformsimportSphinxPostTransformclassPDFNoTitleTransform(SphinxPostTransform):
default_priority=600defis_supported(self):
returnself.app.builder.name=="pdf"defrun(self):
self.document.replace(self.document[0], self.document[0][1:])
defsetup(app):
app.add_post_transform(PDFNoTitleTransform)
return { "parallel_read_safe": True,
"parallel_write_safe": True }
The text was updated successfully, but these errors were encountered:
Ah, I can totally see how that could be unnecessary but since the document and the cover page are independent, I'm not sure what change we can make to rst2pdf itself that would make sense for this use case as well as any/all other use cases. In our case, I'm not sure it's a bug, but more like that the documents should be fed to rst2pdf already designed to be used together; in which case your sphinx extension is a pretty nice solution. Thanks for sharing!
Do you think there's more we can do on this issue that would work for all users?
I think so, yes. I suspect many will do what we did, and that is to replace Sphinx' LaTeX based PDF builder, with rst2pdf. As such, we (and likely others) expected a similar behaviour from rst2pdf. Since the Sphinx source needs to work for multiple builders, it can't really be adapted for just rst2pdf.
I agree that this should probably not be in the general rst2pdf. But I think it should be in the pdfbuilder Sphinx module. That's what suppose to handle the bridging of Sphinx and rst2pdf.
The main title of the document is generally included in the cover page, so you don't want it again at the start of the actual contents.
This also causes everything in the document structure to jump one level down, with the document title as a new top node including everything.
Description of problem
A simple document like this:
In the PDF I then get a cover page with "Main title", then on the first page we get "Main title" again.
What is the expected output? What do you see instead?
The body of the document should start with "Intro".
🖥 Versions
python -V
: 3.6.12pip freeze | grep rst2pdf
: 0.98pip freeze | grep reportlab
: 3.6.1pip freeze | grep Sphinx
: 4.2.0Which operating system are you using?
Linux
Additional information
If I compare things with Sphinx' LaTeX based PDF generator it omits this top level structure node. I've written a Sphinx extension that does the same for rst2pdf:
The text was updated successfully, but these errors were encountered: