Suppress braces surround bibitem

This commit is contained in:
Takeshi KOMIYA 2018-04-28 17:03:25 +09:00
parent 627ca87059
commit c1b87ff0d3
2 changed files with 4 additions and 6 deletions

View File

@ -2148,12 +2148,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
def visit_citation(self, node):
# type: (nodes.Node) -> None
label = node[0].astext()
self.body.append(u'\\bibitem[%s]{%s:%s}{' %
self.body.append(u'\\bibitem[%s]{%s:%s}' %
(self.encode(label), node['docname'], node['ids'][0]))
def depart_citation(self, node):
# type: (nodes.Node) -> None
self.body.append('}\n')
pass
def visit_citation_reference(self, node):
# type: (nodes.Node) -> None

View File

@ -591,8 +591,7 @@ def test_footnote(app, status, warning):
'\\end{footnote}') in result
assert '\\begin{footnote}[3]\\sphinxAtStartFootnote\nnamed\n%\n\\end{footnote}' in result
assert '\\cite{footnote:bar}' in result
assert ('\\bibitem[bar]{footnote:bar}'
'{\ncite\n}\n') in result
assert ('\\bibitem[bar]{footnote:bar}\ncite\n') in result
assert '\\sphinxcaption{Table caption \\sphinxfootnotemark[4]' in result
assert ('\\hline%\n\\begin{footnotetext}[4]\\sphinxAtStartFootnote\n'
'footnote in table caption\n%\n\\end{footnotetext}\\ignorespaces %\n'
@ -1242,8 +1241,7 @@ def test_latex_thebibliography(app, status, warning):
result = (app.outdir / 'Python.tex').text(encoding='utf8')
print(result)
assert ('\\begin{sphinxthebibliography}{AuthorYear}\n'
'\\bibitem[AuthorYear]{index:authoryear}{\n'
'\\bibitem[AuthorYear]{index:authoryear}\n'
'Author, Title, Year\n'
'}\n'
'\\end{sphinxthebibliography}\n' in result)
assert '\\cite{index:authoryear}' in result