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

Make use of the recent support of bibtex's syntax highlighting by Ace #12

Open
dbitouze opened this issue Oct 18, 2022 · 6 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@dbitouze
Copy link

dbitouze commented Oct 18, 2022

It would be nice for latexcgi to rely on the last release of Ace which, starting from 1.12.0, supports syntax highlighting for bibtex (see ajaxorg/ace#4837) : compare the first example on https://www.learnlatex.org/en/lesson-12 and the same content on https://ace.c9.io/build/kitchen-sink.html with “Bibtex” as selected Mode on the left panel.

@davidcarlisle
Copy link
Owner

davidcarlisle commented Oct 18, 2022

hmm I should probably update ace (assuming I can imply drop that in) although I had been planning to switch or at least offer a option of switching to codemirror see issue #2 although perhaps? an updated ace is better at handling scripts that make use of combining characters.

@davidcarlisle davidcarlisle reopened this Oct 18, 2022
@davidcarlisle davidcarlisle self-assigned this Oct 18, 2022
@davidcarlisle davidcarlisle added the enhancement New feature or request label Oct 18, 2022
@davidcarlisle
Copy link
Owner

actually I think there is nothing to do in the runlatex script itself, the calling html is resposible for loding ce so typically

<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.min.js"></script>

I could (after some tests) update that URL in the examples here and separately in the template at learnlatex, but it's an issue for each calling page not an update I can make centrally.

https://cdnjs.cloudflare.com/ajax/libs/ace/1.12.3/ace.min.js

seems to be the latest

@dbitouze
Copy link
Author

hmm I should probably update ace (assuming I can imply drop that in) although I had been planning to switch or at least offer a option of switching to codemirror see issue #2 although perhaps? an updated ace is better at handling scripts that make use of combining characters.

Does CodeMirror support bibtex language? BTW, I don't see anything related to LaTeX for CodeMirror 6.

@davidcarlisle
Copy link
Owner

@davidcarlisle I don't know, at the time of issue 2 I got codemirror 5 integrated but cm 6 was in beta, I failed to integrate that so left it until it was released with more complete doc, I will look again.

Note though, lack of bibtex support means sub-optimal colouring whereas lack of support for combining characters makes the system unusable, so given choice of one or the other...

I can't read the examples in issue 2, but can still test editing in ace, which is unusably painful. If you put the cursor at the end of a character string and hit delete, some other random character half a line away is deleted, as (I think) the visual display is via the browser's unicode aware layout but the internal editor cursor position handling is maintained by the editor and does not take account of the combinations that occur when laying out Unicode text.

so my aim here is to make sure the core runlatex script will work with either editor and leave it to the calling page which to use. An updated ace should work with no change, using cm5 required some small changes, using cm6 not done yet

@dbitouze
Copy link
Author

I'm a bit lost with this issue. AFAICS, still no BibTeX syntax highlighting for the first example at https://www.learnlatex.org/en/lesson-12.

@davidcarlisle
Copy link
Owner

@dbitouze I guess I'll try updating ace on a fork of learnlatex and see what breaks, might be the weekend. Note latexcgi as such doesn't really depend on the editor at all, it's more an issue for learnlatex

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

No branches or pull requests

2 participants