You will need to add some Latex commands to your preamble.  For example, 
the following will make notes centered:
\renewcommand{\py@noticestart@note}{\py@lightbox\begin{center}}
\renewcommand{\py@noticeend@note}{\end{center}\py@endlightbox}

This will make the admonition title be upper case:
\renewenvironment{notice}[2]{
  \def\py@noticetype{#1}
  \csname py@noticestart@#1\endcsname
  % Make the admonition type be upper case and on its own line
  \strong{\MakeUppercase{#2}} \\
}{\csname py@noticeend@\py@noticetype\endcsname}

Modifying the PDF output of Sphinx isn't easy because you have to do a few 
things:

   - Learn enough Latex to understand the Sphinx style files
   - Learn enough Latex to do what you want
   - Figure out how to modify it using a preamble that doesn't break the 
   output
   
So far there isn't any general guide on how to do it.


On Monday, October 10, 2016 at 5:10:16 PM UTC-7, Minkai Li wrote:
>
> I am able to generate notes using the Sphinx directive .. notes:: and .. 
> attention::. However, the notes and the attention in html file have a 
> background color while those from the generated PDF don’t. How can I add 
> color to Sphinx-generated PDF files? Is it in conf.py?
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to