mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3733 from tk0miya/3725_change_label_of_todo_in_latex
Fix #3725: Todo looks different from note in LaTeX output
This commit is contained in:
commit
74b593cc93
1
CHANGES
1
CHANGES
@ -25,6 +25,7 @@ Bugs fixed
|
||||
in PDF output
|
||||
* Fix: in PDF captions of tables are rendered differently whether table is of
|
||||
longtable class or not (refs #3686)
|
||||
* #3725: Todo looks different from note in LaTeX output
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -20,6 +20,7 @@ from sphinx.locale import _
|
||||
from sphinx.environment import NoUri
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.nodes import set_source_info
|
||||
from sphinx.util.texescape import tex_escape_map
|
||||
from docutils.parsers.rst import Directive
|
||||
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
|
||||
|
||||
@ -209,6 +210,17 @@ def depart_todo_node(self, node):
|
||||
self.depart_admonition(node)
|
||||
|
||||
|
||||
def latex_visit_todo_node(self, node):
|
||||
# type: (nodes.NodeVisitor, todo_node) -> None
|
||||
title = node.pop(0).astext().translate(tex_escape_map)
|
||||
self.body.append(u'\n\\begin{sphinxadmonition}{note}{%s:}' % title)
|
||||
|
||||
|
||||
def latex_depart_todo_node(self, node):
|
||||
# type: (nodes.NodeVisitor, todo_node) -> None
|
||||
self.body.append('\\end{sphinxadmonition}\n')
|
||||
|
||||
|
||||
def setup(app):
|
||||
# type: (Sphinx) -> Dict[unicode, Any]
|
||||
app.add_event('todo-defined')
|
||||
@ -219,7 +231,7 @@ def setup(app):
|
||||
app.add_node(todolist)
|
||||
app.add_node(todo_node,
|
||||
html=(visit_todo_node, depart_todo_node),
|
||||
latex=(visit_todo_node, depart_todo_node),
|
||||
latex=(latex_visit_todo_node, latex_depart_todo_node),
|
||||
text=(visit_todo_node, depart_todo_node),
|
||||
man=(visit_todo_node, depart_todo_node),
|
||||
texinfo=(visit_todo_node, depart_todo_node))
|
||||
|
Loading…
Reference in New Issue
Block a user