ajaxorg / ace

Ace (Ajax.org Cloud9 Editor)

Home Page:https://ace.c9.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

latex: (bright) GitHub theme only black and with only a few commands highlighted

dbitouze opened this issue · comments

Describe the bug

On https://ace.c9.io/build/kitchen-sink.html, with a LaTeX document, the (bright) GitHub theme displays LaTeX code only in black with only a few commands highlighted (in bold face).

Expected Behavior

Same kind of behavior as the github.com site or, for instance, the Ace GitHub Dark theme which displays LaTeX code in colors, with all of the command names highlighted.

Current Behavior

In the following default LaTeX code provided by the Kitchen Sink, only \usepackage is highlighted by the Ace (bright) GitHub theme:

\usepackage{amsmath}
\title{\LaTeX}
\date{}
\begin{document}
  \maketitle
  \LaTeX{} is a document preparation system for the \TeX{}
  typesetting program. It offers programmable desktop publishing
  features and extensive facilities for automating most aspects of
  typesetting and desktop publishing, including numbering and
  cross-referencing, tables and figures, page layout, bibliographies,
  and much more. \LaTeX{} was originally written in 1984 by Leslie
  Lamport and has become the dominant method for using \TeX; few
  people write in plain \TeX{} anymore. The current version  is
  \LaTeXe.
 
  % This is a comment; it will not be shown in the final output.
  % The following shows a little of the typesetting power of LaTeX:
  \begin{align}
    E &= mc^2                              \\
    m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
  \end{align}
\end{document}

As you can see above if you're using the default bright theme of this github.com site, the LaTeX code is colorful.

Reproduction Steps

  1. Go to https://ace.c9.io/build/kitchen-sink.html.
  2. Choose a LaTeX document.
  3. Choose the Bright GitHub theme.

Possible Solution

No response

Additional Information/Context

No response

Ace Version / Browser / OS / Keyboard layout

  • Ace version: the latest one, I guess.
  • Browser: Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0.
  • OS: Linux x86_64.
  • Keyboard: azerty-fr.

It seems like this is an issue with other document types as well, I did check couple of others (Kotlin, Go, Javascript), and there is also lack of highlighting for some syntax types.

Fixed by #5597 which will be included in the next Ace release.

Thanks for the quick fix!

Nevertheless, I wonder why if one:

  1. goes to https://ace.c9.io/build/kitchen-sink.html,
  2. chooses a LaTeX document,
  3. chooses the GitHub Light Default theme,

the LaTeX code will look as follows:

image

and not as usually in GitHub:

\usepackage{amsmath}
\title{\LaTeX}
\date{}
\begin{document}
  \maketitle
  \LaTeX{} is a document preparation system for the \TeX{}
  typesetting program. It offers programmable desktop publishing
  features and extensive facilities for automating most aspects of
  typesetting and desktop publishing, including numbering and
  cross-referencing, tables and figures, page layout, bibliographies,
  and much more. \LaTeX{} was originally written in 1984 by Leslie
  Lamport and has become the dominant method for using \TeX; few
  people write in plain \TeX{} anymore. The current version  is
  \LaTeXe.
 
  % This is a comment; it will not be shown in the final output.
  % The following shows a little of the typesetting power of LaTeX:
  \begin{align}
    E &= mc^2                              \\
    m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
  \end{align}
\end{document}

Especially, the LaTeX command \usepackage and its argument amsmath are highlighted:

  • using the same color with the former,
  • using different colors with the latter.