Lindydancer / highlight-doxygen

Highlight Doxygen comments in Emacs, including code blocks
17 stars 4 forks source link

add support for maths formulas #9

Open ggegoge opened 3 years ago

ggegoge commented 3 years ago

Hi,

the Doxygen documentation has the ability to include LaTeX-y maths formulas with either something like @f$ \sin x @f$ or @f[ \sin x @f] for the so called display mode. Unfortunately there seems to be no highlighting for neither the @f$ tags nor the formula inside with the package. Highlighting the tags with the highlight-doxygen-command face and perhaps the interiors of the LaTeX formula with some different face would be very helpful

Lindydancer commented 3 years ago

Hi!

This sounds like a good idea. The question is if it is sufficient to highlight the content using, say, a single face or if we need to highlight the content using latex highlighting. I guess the latter can be done the same way that source code is highlighted.

I can't promise anything, though. I haven't had time or energy for my Emacs projects lately.

-- Anders

On Mon, Apr 19, 2021 at 7:52 PM grzegorz @.***> wrote:

Hi,

the Doxygen documentation has the ability to include LaTeX-y maths formulas with either something like @f$ \sin x @f$ or @f[ \sin x @f] for the so called display mode. Unfortunately there seems to be no highlighting for neither the @f$ tags nor the formula inside with the package. Highlighting the tags with the highlight-doxygen-command face and perhaps the interiors of the LaTeX formula with some different face would be very helpful

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Lindydancer/highlight-doxygen/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYGGQBOQI2GYCMKK7HV5GTTJRUUHANCNFSM43GKMRBA .

ggegoge commented 3 years ago

Hi

Obviously it would be amazing to have complete latex highlighting inside formulas (complete ie with subscripts and superscripts being resized etc) but I suppose it is not trivial to do at all.

Eg in the famous org-mode when you have math tex fragments it doesn't get rendered using the usual latex rendering but with a single face (until you use the org pretty entities something but for me that is too much).

To be honest it would be enough to simply have the @f$ delimiters highlighted like all others since my problems with those maths fragments in Doxygen were usually me getting lost with the formula being hard to distinguish from standard docstrings which led me to some dumb mistakes as writing @$f by accident.

And I think that having the two things

  1. the markers @f$ highlighted the same way all other Doxygen commands are highlighted
  2. the formula itself being highlighted with some different face (perhaps inheriting from the LaTeX face font-latex-math-face)

would be more than enough to make editing maths in Doxygen easy and simple.

Of course I understand that you may not have the energy. Maintaining open source projects is a hobby and some users behave as if the maintainers were some kind of workers made to fullfill their needs which is quite far from reality. And it is understandable it may get tiring. So no pressure from me.

If I were more fluent in emacs lisp I would try to make the necessary changes myself and then just send you a merge request. Unfortunately I'm no elispian.