Skip to content

Revert "Deprecate text.latex.unicode." #11345

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

Merged
merged 1 commit into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/api/next_api_changes/2018-02-15-AL-deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ The following classes, methods, functions, and attributes are deprecated:

The following rcParams are deprecated:
- ``pgf.debug`` (the pgf backend relies on logging),
- ``text.latex.unicode``,
8 changes: 0 additions & 8 deletions doc/api/next_api_changes/2018-05-15-AL.rst

This file was deleted.

1 change: 1 addition & 0 deletions examples/text_labels_and_annotations/tex_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import numpy as np
import matplotlib
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.unicode'] = True
import matplotlib.pyplot as plt


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from matplotlib import rcParams
rcParams['text.usetex'] = True
rcParams['text.latex.unicode'] = True


class Axes(maxes.Axes):
Expand Down
3 changes: 1 addition & 2 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,7 @@ def gen_candidates():
# do NOT include in _all_deprecated
_deprecated_set = {'axes.hold',
'backend.qt4',
'backend.qt5',
'text.latex.unicode'}
'backend.qt5'}

_all_deprecated = set(itertools.chain(
_deprecated_ignore_map, _deprecated_map, _obsolete_set))
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ text.usetex : False # use latex for all text handling. The following fo
# If another font is desired which can loaded using the
# LaTeX \usepackage command, please inquire at the
# matplotlib mailing list
text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling
# unicode strings.
text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/mpl-data/stylelib/classic.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ text.usetex : False # use latex for all text handling. The following fo
# If another font is desired which can loaded using the
# LaTeX \usepackage command, please inquire at the
# matplotlib mailing list
text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling
# unicode strings.
text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ def _validate_linestyle(ls):
# text props
'text.color': ['black', validate_color],
'text.usetex': [False, validate_bool],
'text.latex.unicode': [True, validate_bool],
'text.latex.unicode': [False, validate_bool],
'text.latex.preamble': [[''], validate_stringlist],
'text.latex.preview': [False, validate_bool],
'text.dvipnghack': [None, validate_bool_maybe_none],
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
needs_ghostscript(
('ps', False, {'ps.usedistiller': 'ghostscript'})),
needs_usetex(needs_ghostscript(
('ps', False, {'text.usetex': True}))),
('ps', False, {'text.latex.unicode': True, 'text.usetex': True}))),
('eps', False, {}),
('eps', True, {'ps.useafm': True}),
needs_usetex(needs_ghostscript(
('eps', False, {'text.usetex': True}))),
('eps', False, {'text.latex.unicode': True, 'text.usetex': True}))),
], ids=[
'ps',
'ps with distiller',
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_rcparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def test_if_rctemplate_is_up_to_date():
continue
if k in deprecated:
continue
if k.startswith(("text.latex.unicode", "verbose.")):
if "verbose" in k:
continue
found = False
for line in rclines:
Expand Down
6 changes: 4 additions & 2 deletions lib/matplotlib/texmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ def make_tex(self, tex, fontsize):

if rcParams['text.latex.unicode']:
unicode_preamble = r"""
\usepackage[utf8]{inputenc}"""
\usepackage{ucs}
\usepackage[utf8x]{inputenc}"""
else:
unicode_preamble = ''

Expand Down Expand Up @@ -254,7 +255,8 @@ def make_tex_preview(self, tex, fontsize):

if rcParams['text.latex.unicode']:
unicode_preamble = r"""
\usepackage[utf8]{inputenc}"""
\usepackage{ucs}
\usepackage[utf8x]{inputenc}"""
else:
unicode_preamble = ''

Expand Down
2 changes: 2 additions & 0 deletions matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ backend : $TEMPLATE_BACKEND
## If another font is desired which can loaded using the
## LaTeX \usepackage command, please inquire at the
## matplotlib mailing list
#text.latex.unicode : False ## use "ucs" and "inputenc" LaTeX packages for handling
## unicode strings.
#text.latex.preamble : ## IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
## AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
## IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
Expand Down