Skip to content

Commit 4969d3b

Browse files
committed
changed location of LatexFormatter._write_tabular_end() in source code (pandas-dev#25436)
1 parent a7df686 commit 4969d3b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

pandas/io/formats/latex.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,25 @@ def _write_tabular_begin(self, buf, column_format):
276276

277277
buf.write('\\begin{{tabular}}{{{fmt}}}\n'.format(fmt=column_format))
278278

279+
def _write_tabular_end(self, buf):
280+
"""
281+
Write the end of a tabular environment or nested table/tabular
282+
environment.
283+
284+
Parameters
285+
----------
286+
buf : string or file handle
287+
File path or object. If not specified, the result is returned as
288+
a string.
289+
290+
"""
291+
buf.write('\\bottomrule\n')
292+
buf.write('\\end{tabular}\n')
293+
if self.caption is None and self.label is None:
294+
pass
295+
else:
296+
buf.write('\\end{table}\n')
297+
279298
def _write_longtable_begin(self, buf, column_format):
280299
"""
281300
Write the beginning of a longtable environment including caption and
@@ -312,25 +331,6 @@ def _write_longtable_begin(self, buf, column_format):
312331
# https://tex.stackexchange.com/questions/219138
313332
buf.write('\\\\\n')
314333

315-
def _write_tabular_end(self, buf):
316-
"""
317-
Write the end of a tabular environment or nested table/tabular
318-
environment.
319-
320-
Parameters
321-
----------
322-
buf : string or file handle
323-
File path or object. If not specified, the result is returned as
324-
a string.
325-
326-
"""
327-
buf.write('\\bottomrule\n')
328-
buf.write('\\end{tabular}\n')
329-
if self.caption is None and self.label is None:
330-
pass
331-
else:
332-
buf.write('\\end{table}\n')
333-
334334
@staticmethod
335335
def _write_longtable_end(buf):
336336
"""

0 commit comments

Comments
 (0)