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

Automatically escape special LaTeX characters in symbol names #86

Open
glazjoon opened this issue Nov 11, 2020 · 4 comments
Open

Automatically escape special LaTeX characters in symbol names #86

glazjoon opened this issue Nov 11, 2020 · 4 comments

Comments

@glazjoon
Copy link

I have situations where my symbol names contain characters that require escaping when using LaTeX, such as underscore. Considering the names are considered valid by MathNet, I sort of expected them to behave correctly in LaTeX generated by it.

Is there any chance you could add automatic escaping of special characters when they are part of a symbol name?

@FoggyFinder
Copy link
Contributor

@glazjoon Can you give some examples?

"a_1+a_2" input produces \mathrm{a_{1}} + \mathrm{a_{2}} output. What result would be desirable?

@glazjoon
Copy link
Author

Desired output would be \mathrm{a\_{1}} + \mathrm{a\_{2}}

@FoggyFinder
Copy link
Contributor

Since I'm not confident with LaTeX I decided to clarify this moment.

samcarter: Both are valid, just with different output. a_{2} will result in a subscript, a_{2} will give a_2. The question is what the user wants to have

quote is taken from TopTeX chat

Current output looks better to me but probably the best option (for this specific case) would be adding a some property to make it more customizable?

@cdrnet

@cdrnet
Copy link
Member

cdrnet commented Jan 10, 2021

The rendering of x_10 style symbols as subscript in LaTeX is actually a feature that was requested some time ago (and which I quite like). This is also why it adds braces.

We do have a concept of styles (i.e. configurations) to control aspects like this, maybe we could make it possible to control this that way, so you could disable it.

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

3 participants