latexcgi icon indicating copy to clipboard operation
latexcgi copied to clipboard

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

Open dbitouze opened this issue 2 years ago • 6 comments

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 https://github.com/ajaxorg/ace/issues/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.

dbitouze avatar Oct 18 '22 17:10 dbitouze

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 avatar Oct 18 '22 22:10 davidcarlisle

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

davidcarlisle avatar Oct 18 '22 23:10 davidcarlisle

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.

dbitouze avatar Oct 19 '22 12:10 dbitouze

@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

davidcarlisle avatar Oct 19 '22 13:10 davidcarlisle

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.

dbitouze avatar Aug 24 '23 15:08 dbitouze

@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

davidcarlisle avatar Aug 24 '23 19:08 davidcarlisle