diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-08-16 12:25:38 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-08-18 18:41:42 -0400 |
commit | 60459774659267569b4d944fcecb372ad0c48629 (patch) | |
tree | b778b9dc5a07156a161bf13296adcb28f6cefbae /Documentation/conf.py | |
parent | caee5cdede9c9b3562abd6a93c71e791577802ad (diff) |
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.py | 23 |
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 = { | |||
258 | 'preamble': ''' | 258 | 'preamble': ''' |
259 | % Allow generate some pages in landscape | 259 | % Allow generate some pages in landscape |
260 | \\usepackage{lscape} | 260 | \\usepackage{lscape} |
261 | |||
262 | % Put notes in gray color and let them be inside a table | ||
263 | |||
264 | \\definecolor{MyGray}{rgb}{0.80,0.80,0.80} | ||
265 | |||
266 | \\makeatletter\\newenvironment{graybox}{% | ||
267 | \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\columnwidth}}{\\end{minipage}\\end{lrbox}% | ||
268 | \\colorbox{MyGray}{\\usebox{\\@tempboxa}} | ||
269 | }\\makeatother | ||
270 | |||
271 | \\makeatletter | ||
272 | \\renewenvironment{notice}[2]{ | ||
273 | \\begin{graybox} | ||
274 | \\bf\\it | ||
275 | \\def\\py@noticetype{#1} | ||
276 | \\par\\strong{#2} | ||
277 | \\csname py@noticestart@#1\\endcsname | ||
278 | } | ||
279 | { | ||
280 | \\csname py@noticeend@\\py@noticetype\\endcsname | ||
281 | \\end{graybox} | ||
282 | } | ||
283 | \\makeatother | ||
261 | ''' | 284 | ''' |
262 | } | 285 | } |
263 | 286 | ||