-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
CLN: remove redundant latex options #50871
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
ffbc621
567f71d
42aa203
2b26320
a91bc0d
c11bac9
d1f20ac
8c88ff7
162ae16
02d660f
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 |
---|---|---|
|
@@ -3228,30 +3228,54 @@ def to_latex( | |
columns. By default, 'l' will be used for all columns except | ||
columns of numbers, which default to 'r'. | ||
longtable : bool, optional | ||
By default, the value will be read from the pandas config | ||
module. Use a longtable environment instead of tabular. Requires | ||
Use a longtable environment instead of tabular. Requires | ||
adding a \usepackage{{longtable}} to your LaTeX preamble. | ||
By default, the value will be read from the pandas config | ||
module, and set to `True` if the option ``styler.latex.environment`` is | ||
`"longtable"`. | ||
|
||
.. versionchanged:: 2.0.0 | ||
The pandas option affecting this argument has changed. | ||
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. For these notes could we state what the new option is i.e. 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. The main part of the parameter doc string contains the names of the pandas option that are used. Not sure we need to explicitly state it again in the versionchanged only a couple lines below? Did add the default values though. |
||
escape : bool, optional | ||
By default, the value will be read from the pandas config | ||
module. When set to False prevents from escaping latex special | ||
module and set to `True` if the option ``styler.format.escape`` is | ||
`"latex"`. When set to False prevents from escaping latex special | ||
characters in column names. | ||
|
||
.. versionchanged:: 2.0.0 | ||
The pandas option affecting this argument has changed, as has the | ||
default value to `False`. | ||
encoding : str, optional | ||
A string representing the encoding to use in the output file, | ||
defaults to 'utf-8'. | ||
decimal : str, default '.' | ||
Character recognized as decimal separator, e.g. ',' in Europe. | ||
multicolumn : bool, default True | ||
Use \multicolumn to enhance MultiIndex columns. | ||
The default will be read from the config module. | ||
multicolumn_format : str, default 'l' | ||
The default will be read from the config module, and is set | ||
as the option ``styler.sparse.columns``. | ||
|
||
.. versionchanged:: 2.0.0 | ||
The pandas option affecting this argument has changed. | ||
multicolumn_format : str, default 'r' | ||
The alignment for multicolumns, similar to `column_format` | ||
The default will be read from the config module. | ||
multirow : bool, default False | ||
The default will be read from the config module, and is set as the option | ||
``styler.latex.multicol_align``. | ||
|
||
.. versionchanged:: 2.0.0 | ||
The pandas option affecting this argument has changed, as has the | ||
default value to "r". | ||
multirow : bool, default True | ||
Use \multirow to enhance MultiIndex rows. Requires adding a | ||
\usepackage{{multirow}} to your LaTeX preamble. Will print | ||
centered labels (instead of top-aligned) across the contained | ||
rows, separating groups via clines. The default will be read | ||
from the pandas config module. | ||
from the pandas config module, and is set as the option | ||
``styler.sparse.index``. | ||
|
||
.. versionchanged:: 2.0.0 | ||
The pandas option affecting this argument has changed, as has the | ||
default value to `True`. | ||
caption : str or tuple, optional | ||
Tuple (full_caption, short_caption), | ||
which results in ``\caption[short_caption]{{full_caption}}``; | ||
|
@@ -3319,15 +3343,15 @@ def to_latex( | |
if self.ndim == 1: | ||
self = self.to_frame() | ||
if longtable is None: | ||
longtable = config.get_option("display.latex.longtable") | ||
longtable = config.get_option("styler.latex.environment") == "longtable" | ||
if escape is None: | ||
escape = config.get_option("display.latex.escape") | ||
escape = config.get_option("styler.format.escape") == "latex" | ||
if multicolumn is None: | ||
multicolumn = config.get_option("display.latex.multicolumn") | ||
multicolumn = config.get_option("styler.sparse.columns") | ||
if multicolumn_format is None: | ||
multicolumn_format = config.get_option("display.latex.multicolumn_format") | ||
multicolumn_format = config.get_option("styler.latex.multicol_align") | ||
if multirow is None: | ||
multirow = config.get_option("display.latex.multirow") | ||
multirow = config.get_option("styler.sparse.index") | ||
|
||
if column_format is not None and not isinstance(column_format, str): | ||
raise ValueError("`column_format` must be str or unicode") | ||
|
@@ -3413,7 +3437,9 @@ def _wrap(x, alt_format_): | |
"label": label, | ||
"position": position, | ||
"column_format": column_format, | ||
"clines": "skip-last;data" if multirow else None, | ||
"clines": "skip-last;data" | ||
if (multirow and isinstance(self.index, MultiIndex)) | ||
else None, | ||
"bold_rows": bold_rows, | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.