Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-dev] how to write plugin to render latex in (Java) code comments?



On Fri, May 20, 2022 at 9:21 AM Stephen Crowley <stephencrowley214@xxxxxxxxx> wrote:

Hi Mickael, thanks for the answer however that isn't quite what I had in mind. I want the mathematically typeset formulas

to appear inline along with the java code, rather than having to hover over it to see it.

In that case you're probably looking for "code-minings" (http://help.eclipse.org/2022-03/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_workbench_texteditor_codeMiningProviders.html?resultof=%22%63%6f%64%65%22%20%22%6d%69%6e%69%6e%67%22%20%22%6d%69%6e%65%22%20). They allow inject both textual and visual representation in the document . See the attached screenshot of CSS editor color rendered in addition to the text, it's done using this technology and might serve your purpose (keep the latex formula in raw format for editing and display the formula as an image).
 

This would most likely mean that the lines which

do have  formulas to render with latex would probably have to be a bit taller to make them visible which might break the existing display code which I presume requires a fixed vertical spacing of lines?

An alternative would be to develop a convention, so that latex formulas would be represented as being within a Javadoc and within a special tag

called <math>

whichCouldSpanSeveralLines(x)=

like{\sup}.this()\int\someLatexStuff

</math>

Is this possible without some kludges?

Regards,


--Stephen


On 5/17/22 2:47 AM, Mickael Istria wrote:
Hello,

Questions about Java Development Tools are better being asked on the jdt-dev@xxxxxxxxxxx mailing-list. Anyway, now it's too late ot undo it, here is a piece of answer: you can use this extension point to achieve what you want https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_jdt_ui_javaEditorTextHovers.html

HTH

On Tue, May 17, 2022 at 12:41 AM Stephen Crowley <stephencrowley214@xxxxxxxxx> wrote:

How can one go about adding a latex _expression_ renderer to the Java editor ?

It should interpret anything bracketed in $$ inside Java comments (and elsewhere?)  with jlatexmath?

I think I'd rather have this before a swig mode


Thanks in advance


--Stephen


_______________________________________________
eclipse-dev mailing list
eclipse-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/eclipse-dev


--
Mickael Istria
Eclipse IDE developer, for Red Hat Developers

_______________________________________________
eclipse-dev mailing list
eclipse-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/eclipse-dev
_______________________________________________
eclipse-dev mailing list
eclipse-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/eclipse-dev


--
Aleksandar Kurtakov
Red Hat Eclipse Team

Attachment: Screenshot from 2022-05-20 10-42-18.png
Description: PNG image


Back to the top