ContactEngineering / ce-ui

User interface of contact.engineering
https://contact.engineering
MIT License
0 stars 0 forks source link

Formatting axes labels #7

Open pastewka opened 1 year ago

pastewka commented 1 year ago

Bokeh now supports MathJAX formatting (I think). We should use this to properly style axes labels.

pastewka commented 1 year ago

It does support this, but with the caveat that we can use either pure MathJAX or pure text, not a mixture. I.e. we can't use Wavevector q (um^-) and have just q math formatted.

pastewka commented 1 year ago

We may want to patch Bokeh to support mixtures, i.e. text + MathJAX.

This issue is related to ContactEngineering/topobank#225

SickSmile1 commented 1 year ago

i managed to get latex output with following changes: added TeX to imports from @bokeh\bokehjs in line 324: plot.xAxisLabel = new TeX({text: "\pi\cdot x^2_{\pi\cdot x}\text{ was the function used for } \pi\cdot\nu"}); yielding the screenshot pasted. Would this resolve the issue?

tex
pastewka commented 1 year ago

Well, but this is fugly - the font for the text should not be computer modern

SickSmile1 commented 1 year ago

i'll play around a bit more with that and search more in the issues of Bokeh, but to understand the task completely: The font needs to match the Website-Font and mixtures of LaTeX and Text should be possible?