I'm trying to write a document in reStructuredText, but am currently facing a problem.
I want the document to have a title, this is going to be centered, then immediately after that I want a subsection.
I tried doing the following
##############
Title
##############
+++++++++
Subtitle
+++++++++
content
But when I convert this to PDF, it makes both the title and subtitle centered.
From the reStructuredText quick start guide titles and sub-titles are specified as follows (emphasis mine):
To indicate the document title in reStructuredText, use a unique adornment style at the beginning of the document. To indicate the document subtitle, use another unique adornment style immediately after the document title.
So in the reST example in the question, Subtitle
is being formatted as a sub title and not a section heading since the adornment style used around Subtitle
is not used anywhere else in the document. In the following, this adornment is used around two section headings, so is not unique and not treated as a subtitle:
##############
Document Title
##############
+++++++++++++++
Section 1 Title
+++++++++++++++
Section 1 content...
+++++++++++++++
Section 2 Title
+++++++++++++++
Section 2 content...
Have a play with http://www.tele3.cz/jbar/rest/rest.html This allows you to quickly try out some simple reStructuredText and test things like sub-titles vs. section titles.
Edit: Alternatively you could put some text between your title and section heading (like an abstract, for example).
P.s. I tend you use adornments above and below a heading to indicate a document title and sub-title and a single adornment below a heading to indicate a (sub-)section title. This makes it easy to see what I intended to be my title/sub-title. For example:
==============
Document title
==============
-----------------
Document subtitle
-----------------
Section
=======
Sub-section
-----------
etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With