# [sphinx-users] Re: how do I add subtitle?

Can you clarify what you mean by "subtitle"?

The reST you posted (assuming it is all in one file) says make a Heading 1
('Title'), followed by a Heading 2 ('subtitle') followed by a Heading 1
('subsubtitle').  This is because you used the same character ('*') for
heading 1, then used it again for, for what looks like it should be, a
heading 3.  In reST, any 4 consecutive characters that begin a line can be
used as a heading indicator.  Overlines are optional, underlines are
manditory and need to be at least as long as the text they are trying to
over/underline.  If you use overlines, then they need to be the same length
as the underline.  If you follow the python guidelines, then use # for
heading 1, * for heading 2, and = for heading 3 (IIRC).

It looks like you are trying to build a PDF from your question.  If someone
asked about a subtitle for PDF output, then I assume that they mean some
some text that is slightly smaller than the title, on the title page.  If
this is what you want, you will need to modify your preamble to redefine
\maketitle.

\renewcommand{\maketitle}{%
\begin{titlepage}%

\end{titlepage}%
\cleardoublepage%
\setcounter{footnote}{0}%
\let\thanks\relax\let\maketitle\relax
%\@ifundefined{fancyhf}{}{\pagestyle{normal}}%
}

You can find the default definition in one of the .sty files that is
included with Sphinx.

On Wednesday, October 12, 2016 at 4:27:53 PM UTC-7, Fiona Hanington wrote:
>
> Hi
>
> (Excuse the newby question -- I am new to rst and sphinx and the person
> who set things up here has left, so I am trying to work things out.)
>
> I need to add a subtitle to an existing doc.
>
> Sphinx docs on the internet tell me that to add a title/subtitle, I simply
> need to add this to my "file":
>
> *****
> Title
> *****
>
> subtitle
> ########
>
> subsubtitle
> ***********
> and so on
>
>
>
> However, I don't know where to add this.  If I look at my conf.py file,
> which currently has a project name that controls the doc title, it looks
> like this (title is not formatted as suggested above). Title is defined by
> what is in *project = *:
>
> from shared.conf import restrictions
> from shared.conf import *
> part = "09-1076A-D"
>
> # General information about the project.
> project = u'Getting Started'
>
> # The version info for the project you're documenting, acts as replacement
> for
> # |version| and |release|, also used in various other places throughout the
> # built documents.
> #
> # The short X.Y version.
> version = '2.6'
> # The full version, including alpha/beta/rc tags.
> release = version
>
> latex_preamble += r"""
> \def\part{%s}
> \newcommand{\argmin}{\operatornamewithlimits{argmin}}
> \newcommand{\argmax}{\operatornamewithlimits{argmax}}
> \newcommand{\vc}[1]{{\pmb{#1}}}
> \newcommand{\ip}[2]{\langle{#1},{#2}\rangle}
> \newcommand{\sign}{\operatorname{sign}}
> """ % dwave_part
>
> #latex_preamble += restrictions
>
> latex_documents = [
>     ('index', '%s_GettingStarted.tex' % (part), project,
>      name, 'manual'),
> ]
>
> pngmath_latex_preamble = latex_preamble
>
>
> Thank you!!
>
> Fiona
>
>

--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to sphinx-users@googlegroups.com.