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

LaTeX support #47

Open
Dixilea opened this issue Nov 16, 2020 · 1 comment
Open

LaTeX support #47

Dixilea opened this issue Nov 16, 2020 · 1 comment

Comments

@Dixilea
Copy link

Dixilea commented Nov 16, 2020

Dear @Pustelto,

I've tried this extension with a LaTeX file (.tex) but unfortunately this does not appear to be supported (yet). I've tried adding a new definition to the language-definitions.json file, but this does not appear to work. Admittedly, I have never modified extensions so it's probably me being inexperienced; on the other hand, it may be the parser.

The brackets { } in this simple formula can be changed:
$a^{b}$
The inner round brackets ( ) in the following formula can not be changed. Bracketeer will only change the outer brackets { }:
$a^{(b)}$
The round brackets ( ) of the next formula will also not be changed by Bracketeer:
$e = (u,v)$
Anything more complex and Bracketeer will give unexpected behavior (from the user's viewpoint).

If I have Bracketeer select the content of $a^{(b)}$ via Ctrl+Alt+Shift+H, then it selects (b) in its entirety while one may want b or (b) depending on whether they're looking to change ( ) or { }, respectively. Hence there may be an underlying issue with the parser. Bracket nesting is very common in LaTeX code. Asking Bracketeer to select the contents of $e = (u,v)$, results in nothing selected whereas I would have expected u,v to be selected.

There is perhaps another challenge with matching brackets in LaTeX. Many of the brackets used are asymmetrical.
For example, these matching brackets: ( ), { }, [ ], < >, | |
Can all be enhanced with the commands: \bigl \bigr, \Bigl \Bigr, \left \right
For example, one may want to change: \bigl{ \bigr} into \Bigl[ \Bigr]

The ability to quickly change matching brackets in mathematical documents would be amazing from a productivity standpoint! The hundreds of formulae in some documents contain quite literally thousands of matching brackets. I'm happy to help where I can.

In any case, thanks for the extension :)!

Dixilea

@Pustelto
Copy link
Owner

Hi, seems like prism.js supports LaTeX (package I use to parse the code) so it should be possible. Will have to look into this, but not sure how easy it will be to include the prefixes like \Bigl etc.

Also I have very limited time at the moment. So don't expect this to be ready soon.

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

2 participants