@@ -468,7 +468,7 @@ def to_latex(
468468 column_format : str | None = None ,
469469 position : str | None = None ,
470470 position_float : str | None = None ,
471- hrules : bool = False ,
471+ hrules : bool | None = None ,
472472 label : str | None = None ,
473473 caption : str | tuple | None = None ,
474474 sparse_index : bool | None = None ,
@@ -488,7 +488,7 @@ def to_latex(
488488 Parameters
489489 ----------
490490 buf : str, Path, or StringIO-like, optional, default None
491- Buffer to write to. If `` None` `, the output is returned as a string.
491+ Buffer to write to. If `None`, the output is returned as a string.
492492 column_format : str, optional
493493 The LaTeX column specification placed in location:
494494
@@ -509,9 +509,12 @@ def to_latex(
509509 \\<position_float>
510510
511511 Cannot be used if ``environment`` is "longtable".
512- hrules : bool, default False
512+ hrules : bool
513513 Set to `True` to add \\toprule, \\midrule and \\bottomrule from the
514514 {booktabs} LaTeX package.
515+ Defaults to ``pandas.options.styler.latex.hrules``, which is `False`.
516+
517+ .. versionchanged:: 1.4.0
515518 label : str, optional
516519 The LaTeX label included as: \\label{<label>}.
517520 This is used with \\ref{<label>} in the main .tex file.
@@ -522,16 +525,17 @@ def to_latex(
522525 sparse_index : bool, optional
523526 Whether to sparsify the display of a hierarchical index. Setting to False
524527 will display each explicit level element in a hierarchical key for each row.
525- Defaults to ``pandas.options.styler.sparse.index`` value .
528+ Defaults to ``pandas.options.styler.sparse.index``, which is `True` .
526529 sparse_columns : bool, optional
527530 Whether to sparsify the display of a hierarchical index. Setting to False
528531 will display each explicit level element in a hierarchical key for each
529- column. Defaults to ``pandas.options.styler.sparse.columns`` value.
532+ column. Defaults to ``pandas.options.styler.sparse.columns``, which
533+ is `True`.
530534 multirow_align : {"c", "t", "b", "naive"}, optional
531535 If sparsifying hierarchical MultiIndexes whether to align text centrally,
532536 at the top or bottom using the multirow package. If not given defaults to
533- ``pandas.options.styler.latex.multirow_align``. If "naive" is given renders
534- without multirow.
537+ ``pandas.options.styler.latex.multirow_align``, which is `"c"`.
538+ If "naive" is given renders without multirow.
535539
536540 .. versionchanged:: 1.4.0
537541 multicol_align : {"r", "c", "l", "naive-l", "naive-r"}, optional
@@ -550,12 +554,12 @@ def to_latex(
550554 If given, the environment that will replace 'table' in ``\\begin{table}``.
551555 If 'longtable' is specified then a more suitable template is
552556 rendered. If not given defaults to
553- ``pandas.options.styler.latex.environment``.
557+ ``pandas.options.styler.latex.environment``, which is `None` .
554558
555559 .. versionadded:: 1.4.0
556560 encoding : str, optional
557561 Character encoding setting. Defaults
558- to ``pandas.options.styler.render.encoding`` value of "utf-8".
562+ to ``pandas.options.styler.render.encoding``, which is "utf-8".
559563 convert_css : bool, default False
560564 Convert simple cell-styles from CSS to LaTeX format. Any CSS not found in
561565 conversion table is dropped. A style can be forced by adding option
@@ -844,6 +848,7 @@ def to_latex(
844848 overwrite = False ,
845849 )
846850
851+ hrules = get_option ("styler.latex.hrules" ) if hrules is None else hrules
847852 if hrules :
848853 obj .set_table_styles (
849854 [
0 commit comments