Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Latin-Modern font on the math typesetting #451

Closed
mhgharieb opened this issue Jun 9, 2019 · 21 comments
Closed

[Feature Request] Latin-Modern font on the math typesetting #451

mhgharieb opened this issue Jun 9, 2019 · 21 comments

Comments

@mhgharieb
Copy link

mhgharieb commented Jun 9, 2019

I know that draw.io uses Mathjax to render latex math. Therefore, draw.io follows the default configuration of Mathjax which uses "MathJax TeX" font by default. Mathjax also supports "Latin-Modern" font which is the actual font used in Latex.
Actually, I am able to reconfigure a local version of draw.io to use "Latin-Modern" in the GUI but the export files "SVG" or "PDF" still use "MathJax TeX" (STIXGeneral-Italic) font by default.

It will be better to use "Latin-Modern" font, so it is consistent with the latex

@mhgharieb mhgharieb changed the title [Feature Request] Latin-Modern font on the math typesettind [Feature Request] Latin-Modern font on the math typesetting Jun 9, 2019
@alderg
Copy link
Contributor

alderg commented Jun 18, 2019

What configuration are you using to change the font?

@wookayin
Copy link

wookayin commented Sep 24, 2019

+1. STIX sucks (nobody wants this font).

Please add the following in the MathJax.Hub.Config:

"HTML-CSS": { availableFonts: ["TeX"] }

@alderg
Copy link
Contributor

alderg commented Sep 24, 2019

We tested it and there are clipping issues for matrices (see https://www.draw.io/#Uhttps%3A%2F%2Fjgraph.github.io%2Fdrawio-diagrams%2Fdiagrams%2Fmath.xml)

@mhgharieb
Copy link
Author

mhgharieb commented Sep 24, 2019

We tested it and there are clipping issues for matrices (see https://www.draw.io/#Uhttps%3A%2F%2Fjgraph.github.io%2Fdrawio-diagrams%2Fdiagrams%2Fmath.xml)

This is my configuration (https://mhgharieb.github.io/drawio/src/main/webapp/index.html#Uhttps%3A%2F%2Fjgraph.github.io%2Fdrawio-diagrams%2Fdiagrams%2Fmath.xml)
still not working in export pdf

@wookayin
Copy link

@alderg Seems that we can just adjust the bounding box to make the clipped region visible again.

@davidjgraph
Copy link
Collaborator

@wookayin Please submit your fix as a PR and we'll review it.

@holyseven

This comment has been minimized.

@fredguth
Copy link

"HTML-CSS": { availableFonts: ["TeX"] }

Where do I change the config?

@alderg
Copy link
Contributor

alderg commented Apr 20, 2020

This will be added in the next release as the clipping problem mentioned above was fixed in 12.5.0. However, the font metrics are different so shapes my have to be resized or text overflow may have to be changed to visible.
text-overflow

@alderg alderg closed this as completed Apr 20, 2020
@zivy90
Copy link

zivy90 commented Apr 21, 2020

"HTML-CSS": { availableFonts: ["TeX"] }

Where do I change the config?

Hi, @fredguth and @wookayin, I also wonder where should I modify the configure file. Thank you!

@zivy90
Copy link

zivy90 commented Apr 22, 2020

@alderg Thanks for the reply. I saw the changes are focused on SVG, is there any solutions for PDF?

@alderg
Copy link
Contributor

alderg commented Apr 22, 2020

PDF export uses the same configuration.

@alderg
Copy link
Contributor

alderg commented Apr 22, 2020

The TeX font looks like this. I think this PDF viewer makes it look worse than it is on this zoom level, if you zoom in it should match what you see on the screen.

@zivy90
Copy link

zivy90 commented Apr 22, 2020

Yes, you are right. Thanks again.

@idansc
Copy link

idansc commented May 31, 2020

The TeX font looks like this. I think this PDF viewer makes it look worse than it is on this zoom level, if you zoom in it should match what you see on the screen.

Is there anything new that causing the bold-looking?
When I zoom it looks ok, but I and probably others don't read documents with zoomed in

@EloiZ
Copy link

EloiZ commented Jun 2, 2020

Hi,
in addition to being bold, the rendered math symbols cannot be selected anymore in the pdf. Do you know how to revert this behavior please?

@alderg
Copy link
Contributor

alderg commented Jun 2, 2020

We've added a new URL parameter math-output=html in 13.1.13 so that PDFs can be created via File, Print and Print to PDF in the browser with the previous math rendering. See https://desk.draw.io/support/solutions/articles/16000032875 for details.

@alderg
Copy link
Contributor

alderg commented Jun 3, 2020

Fixed bold math in PDF export. For text selection, use https://app.diagrams.net/?math-output=html with client-side PDF export via File, Print and Print to PDF.

@EloiZ
Copy link

EloiZ commented Jun 3, 2020

Thanks, it is no longer bold with the trick.
However, the produced math symbols still cannot be highlighted (selected with a mouse) in a pdf reader

@bernardo-silva
Copy link

Fixed bold math in PDF export. For text selection, use https://app.diagrams.net/?math-output=html with client-side PDF export via File, Print and Print to PDF.

Is there an easy way to crop the pdf to the diagram size with this method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants