summaryrefslogtreecommitdiff
path: root/Documentation/conf.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-16 19:25:38 +0300
committerJonathan Corbet <corbet@lwn.net>2016-08-19 01:41:42 +0300
commit60459774659267569b4d944fcecb372ad0c48629 (patch)
treeb778b9dc5a07156a161bf13296adcb28f6cefbae /Documentation/conf.py
parentcaee5cdede9c9b3562abd6a93c71e791577802ad (diff)
downloadlinux-60459774659267569b4d944fcecb372ad0c48629.tar.xz
docs-rst: improve output for .. notes:: on LaTeX
The output for those notes are bad in pdf, as they're not in a box with a different color. Also, it causes the output to not build if the note is inside a table. Change its implementation to avoid the above troubles. The logic there came from: https://stackoverflow.com/questions/606746/how-to-customize-an-existing-latex-environment-without-interfering-with-other-en Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/conf.py')
-rw-r--r--Documentation/conf.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 38b240073336..429183a03b92 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -258,6 +258,29 @@ latex_elements = {
'preamble': '''
% Allow generate some pages in landscape
\\usepackage{lscape}
+
+ % Put notes in gray color and let them be inside a table
+
+ \\definecolor{MyGray}{rgb}{0.80,0.80,0.80}
+
+ \\makeatletter\\newenvironment{graybox}{%
+ \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\columnwidth}}{\\end{minipage}\\end{lrbox}%
+ \\colorbox{MyGray}{\\usebox{\\@tempboxa}}
+ }\\makeatother
+
+ \\makeatletter
+ \\renewenvironment{notice}[2]{
+ \\begin{graybox}
+ \\bf\\it
+ \\def\\py@noticetype{#1}
+ \\par\\strong{#2}
+ \\csname py@noticestart@#1\\endcsname
+ }
+ {
+ \\csname py@noticeend@\\py@noticetype\\endcsname
+ \\end{graybox}
+ }
+ \\makeatother
'''
}