Skip to content
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

tex special characters in axis label not properly escaped #50

Closed
wellsbk1 opened this issue Feb 4, 2015 · 3 comments
Closed

tex special characters in axis label not properly escaped #50

wellsbk1 opened this issue Feb 4, 2015 · 3 comments

Comments

@wellsbk1
Copy link

wellsbk1 commented Feb 4, 2015

When including a tex special character in a plot label, such as in "Reflectance(%)", the % is included verbatim into the generated .tikz file which causes tex to interpret the text after the "%" as a comment.
mathplotlib2TikZ should trap special characters and convert % to %

@NilsWildt
Copy link

Encountered the same problem. I had to Escape the "%" manually.

@nschloe
Copy link
Owner

nschloe commented Oct 17, 2015

There are some ways in which you can make the matplotlib2tikz output fail to compile. The easiest is of course to insert illegal LaTeX text into the labels, e.g.,

Isn't this { a nice bracket?

or

Sweet_underscore.

In the same category falls

Label with %-sign

I believe we shouldn't try to fix all LaTeX errors. Eventually, only the user can do that.

Closing, but feel free to reopen of course.

@andreassch
Copy link

The pylatexenc library can be used to LaTeX-escape special characters. What about an option to apply pylatexenc.latexencode's unicode_to_latex() function to all label strings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants