-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
ENH: Add option to disable MathJax (#19824). #19856
Changes from 4 commits
3df97e3
f48f587
9d97bfd
89659cd
95f7d14
5c71bf1
9b287aa
400f211
15961e1
771e9a6
42224c9
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 |
---|---|---|
|
@@ -296,6 +296,7 @@ Other Enhancements | |
- :class:`IntervalIndex` and its associated constructor methods (``from_arrays``, ``from_breaks``, ``from_tuples``) have gained a ``dtype`` parameter (:issue:`19262`) | ||
- Added :func:`SeriesGroupBy.is_monotonic_increasing` and :func:`SeriesGroupBy.is_monotonic_decreasing` (:issue:`17015`) | ||
- :func:`DataFrame.from_dict` now accepts a ``columns`` argument that can be used to specify the column names when ``orient='index'`` is used (:issue:`18529`) | ||
- Added option ``display.html.use_mathjax`` so that MathJax can be disabled when rendering DataFrames in Jupyter notebooks (:issue:`19856`, :issue:`#19824`) | ||
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. no 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. double backticks on 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. maybe a link for MathJax? |
||
|
||
.. _whatsnew_0230.api_breaking: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,6 +207,12 @@ def use_numexpr_cb(key): | |
(currently both are identical) | ||
""" | ||
|
||
pc_html_use_mathjax_doc = """\ | ||
: boolean | ||
When True, IPython notebook will process table contents using MathJax, | ||
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. IPython -> Jupyter |
||
rendering mathematical expressions enclosed by the dollar symbol. | ||
(default: True) | ||
""" | ||
|
||
pc_width_doc = """ | ||
: int | ||
|
@@ -358,6 +364,8 @@ def table_schema_cb(key): | |
validator=is_bool, cb=table_schema_cb) | ||
cf.register_option('html.border', 1, pc_html_border_doc, | ||
validator=is_int) | ||
cf.register_option('html.use_mathjax', True, pc_html_use_mathjax_doc, | ||
validator=is_bool) | ||
|
||
with cf.config_prefix('html'): | ||
cf.register_option('border', 1, pc_html_border_doc, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -674,8 +674,14 @@ def _repr_html_(self): | |
max_rows = get_option("display.max_rows") | ||
max_cols = get_option("display.max_columns") | ||
show_dimensions = get_option("display.show_dimensions") | ||
use_mathjax = get_option("display.html.use_mathjax") | ||
|
||
classes = [] | ||
if not use_mathjax: | ||
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. this only should be here an not in 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. what about Series._repr_html ? 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. I think the reason it is not in I agree that this should apply to |
||
classes.append('tex2jax_ignore') | ||
|
||
return self.to_html(max_rows=max_rows, max_cols=max_cols, | ||
classes=classes, | ||
show_dimensions=show_dimensions, notebook=True) | ||
else: | ||
return None | ||
|
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.
IPython -> Jupyter
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'll change this, but just want to let you know that I used IPython instead of Jupyter for consistency with the documentation for other options. Perhaps these also need updating?
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.
Sure, that'd be good to correct them all.
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.
There are 148 matches across 41 files for
IPython
(case sensitive). Not all of these need changing – it's quite nuanced. This is probably better left for a separate PR.With regards to this PR, shall I use Jupyter or IPython when documenting this new option?