This is outstanding for Note admonitions. Is the same thing possible for the seealso directive? https://www.sphinx-doc.org/en/1.5/markup/para.html#directive-seealso
On Friday, October 18, 2019 at 2:59:22 PM UTC-5, Jeff Larson wrote: > > Is it possible to set the background color of different admonitions in the > PDF generated by Sphinx 3? > > Using the StackOverlow answer here as a template: > > https://stackoverflow.com/questions/13530489/adding-background-color-of-notes-to-sphinx-generated-pdf-files/34766700 > and motivates me to change the "notice" to "sphinxadmonition" changes the > original: > > [image: Selection_037.png] > > > to look like: > > [image: Selection_038.png] > > (Observe that "Note:" has disappeared and the "See Also: is unaffected.) > > Explicitly, my conf.py currently contains: > > latex_elements = { > 'preamble': > r''' > \definecolor{Admonition}{RGB}{221,233,239} > > \makeatletter > \newenvironment{admonitionbox}{ > \begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth} > }{ > \end{minipage}\end{lrbox} > \colorbox{Admonition}{\usebox{\@tempboxa}} > } > > \renewenvironment{sphinxadmonition}[2]{ > \begin{admonitionbox} > }{ > \end{admonitionbox} > } > \makeatother > > > > Ideally, I could have different colors for different admonitions, but I > understand that that may not be possible. > > Thank you > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/c32aee27-e285-4fd1-b058-31340102fbd9%40googlegroups.com.
