MDANSE icon indicating copy to clipboard operation
MDANSE copied to clipboard

render math in job tab info

Open RobBuchananCompPhys opened this issue 5 months ago • 5 comments

Description of work Currently, the Job tab info does not render the embedded LaTex expression strings, which can look less informative and cluttered. This PR proposes an enhancement in which images (rendered in a simple matplotlib figure) of the expression are inserted into the html of the Job tab, allowing mathematical expressions to be displayed in the text.

Fixes Before: Screenshot 2025-09-26 094524

After: Screenshot 2025-09-26 094921

To test Please describe the tests that were run to verify the changes.

RobBuchananCompPhys avatar Sep 25 '25 17:09 RobBuchananCompPhys

Looks like it's almost there. A few possible points that could still be worked on:

  1. If an equation is not inline, it is not picked up:
Screenshot 2025-09-26 at 10 58 32
  1. The ignored expressions still affect the line breaks:
Screenshot 2025-09-26 at 10 58 13
  1. In principle, it may be worthwhile to try to inline the images. With some tweaking, I got to the stage where it looked like this: Screenshot 2025-09-26 at 11 18 37 But if the vertical alignment cannot be corrected easily and the whole thing looks to awkward, then it should be fine to stick to the current version with a line break per maths symbol.

MBartkowiakSTFC avatar Sep 26 '25 10:09 MBartkowiakSTFC

Just a few things. Image

White background with dark mode theme, and the inline equations' font size is very large. For the white background, I guess we could make the text white and the background transparent. The font size issue might be trickier. I wonder if we should latex the whole thing?

Good question - we may be able to get away with transparency and white font when in dark mode.

RobBuchananCompPhys avatar Sep 29 '25 13:09 RobBuchananCompPhys

I don't think this needs to be fix here but something I discover in #1038 which also will happen for the equation images.

auto-dark-light-new

ChiCheng45 avatar Oct 22 '25 09:10 ChiCheng45

I don't think this needs to be fix here but something I discover in #1038 which also will happen for the equation images.

I've been able to fix some dark light mode system change GUI issues. See #1062 might be worth trying to add a similar fix here I think.

ChiCheng45 avatar Nov 12 '25 15:11 ChiCheng45

A few more things. Some text has been dropped. The "for a set of atoms" is missing. Also the equations are on their own line, I think it would be nice if you could inline them.

image image

here is the text on protos.

image

@RobBuchananCompPhys Can you resolve the merge conflict, I can have a look to see if dark/light mode change can be fixed for the equation images.

ChiCheng45 avatar Nov 25 '25 11:11 ChiCheng45