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

Syntax highlight for quotation marks #593

Closed
stone-zeng opened this issue May 3, 2018 · 3 comments · Fixed by #604
Closed

Syntax highlight for quotation marks #593

stone-zeng opened this issue May 3, 2018 · 3 comments · Fixed by #604

Comments

@stone-zeng
Copy link
Contributor

Description

In TeX, a quotation mark can be used to represent a hex number, so it should not be highlighted as an emphasis environment.

For example, in this figure, "24B6, "24D0 and "2460 should not be highlighted.

image

Additional Information

This behavior exists in LaTeX, LaTeX expl3 and DocTeX mode.

@jlelong
Copy link
Collaborator

jlelong commented May 3, 2018

I will investigate this. So anything matching "[0-9a-fA-F]+ followed by a space, }, ) or \ should be considered as a number.

One possible solution to avoid fiddling with complicated TeX constructions would be to decide that strings are only matched against ``...''. This is the choice made by Emacs + Auctex .

@stone-zeng
Copy link
Contributor Author

Actually, I think that it's unnecessary to highlight quotation marks, since this kind of emphasis is understood by human beings, not by computer.

It should not be consider as a string like C or python, because the idea of "string" in TeX is totally different from something surrounded by "...".

From interface3,

A TeX string (and thus an expl3 string) is a series of characters which have category code 12 ("other") with the exception of space characters which have category code 10 ("space").

Anyway, an option for whether to highlight the quotation marks may be helpful.

@jlelong
Copy link
Collaborator

jlelong commented May 3, 2018

Anyway, an option for whether to highlight the quotation marks may be helpful.

I think it is impossible with the textmatex syntax mechanism used by vscode.
I will try to remove string highlighting '...' or "... " and see what happens.

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

Successfully merging a pull request may close this issue.

3 participants