-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Enable short_caption in to_latex #35668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
13d07ae
8912c81
3f71b46
22d2ca4
01152c1
6adb05c
4725d73
a7b64c0
a2216a1
6c93de4
45de6eb
e70aafa
a0e3f53
6725ca8
8466421
0cc0664
c60a705
27891a3
e43b52f
fbea9eb
29b37e2
ed0132c
ed4b705
3453d43
16884bc
6fd52ca
5acfc44
ae1babe
ddec116
15227b3
336bfb5
b30d2d7
f1781f6
f4b18ff
a18c85d
e957c37
09d9c85
559ca2a
0fd73e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3013,6 +3013,9 @@ def to_latex( | |||||
.. versionchanged:: 1.0.0 | ||||||
Added caption and label arguments. | ||||||
|
||||||
.. versionchanged:: 1.2.0 | ||||||
Added position argument, changed meaning of caption argument. | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
buf : str, Path or StringIO-like, optional, default None | ||||||
|
@@ -3074,11 +3077,16 @@ def to_latex( | |||||
centered labels (instead of top-aligned) across the contained | ||||||
rows, separating groups via clines. The default will be read | ||||||
from the pandas config module. | ||||||
caption : str, optional | ||||||
The LaTeX caption to be placed inside ``\caption{{}}`` in the output. | ||||||
caption : str or tuple, optional | ||||||
Tuple (full_caption, short_caption), | ||||||
which results in ``\caption[short_caption]{{full_caption}}``; | ||||||
if a single string is passed, no short caption will be set. | ||||||
|
||||||
.. versionadded:: 1.0.0 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But I think I should keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure. can have both. and add a one-liner describing the changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added these tags for caption, position (PR #35284) and |
||||||
|
||||||
.. versionchanged:: 1.2.0 | ||||||
Optionally allow caption to be a tuple ``(full_caption, short_caption)``. | ||||||
|
||||||
label : str, optional | ||||||
The LaTeX label to be placed inside ``\label{{}}`` in the output. | ||||||
This is used with ``\ref{{}}`` in the main ``.tex`` file. | ||||||
|
@@ -3087,6 +3095,8 @@ def to_latex( | |||||
position : str, optional | ||||||
The LaTeX positional argument for tables, to be placed after | ||||||
``\begin{{}}`` in the output. | ||||||
|
||||||
.. versionadded:: 1.2.0 | ||||||
{returns} | ||||||
See Also | ||||||
-------- | ||||||
|
@@ -3097,8 +3107,8 @@ def to_latex( | |||||
Examples | ||||||
-------- | ||||||
>>> df = pd.DataFrame(dict(name=['Raphael', 'Donatello'], | ||||||
... mask=['red', 'purple'], | ||||||
... weapon=['sai', 'bo staff'])) | ||||||
... mask=['red', 'purple'], | ||||||
... weapon=['sai', 'bo staff'])) | ||||||
>>> print(df.to_latex(index=False)) # doctest: +NORMALIZE_WHITESPACE | ||||||
\begin{{tabular}}{{lll}} | ||||||
\toprule | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could add a link to to_latest here: https://pandas.pydata.org/docs/user_guide/io.html (followon as prob need a short section as well).