Automatically scale LaTeX rendering to a readable font size
See original GitHub issueIs your suggestion related to a problem? Please describe.

Describe the solution you’d like.
Perhaps a content-sensitive upscale could be applied, especially regarding the very commond \frac, but perhaps some others can be preset. Alternatively have a min size for “regular” elements as well as sub/superscript elements. Calculate the text size of the smallest element, and scale up the whole result based on a reference smallest allowed size.
Describe alternatives you’ve considered.
There are probably more, including user controlled, like a button on messages that contain latex to pop it out in a larger viewer or user definable scaling factor. The default size may be larger in latex-only messages similar to emoji-only.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Automatically scale text up as large as possible to fit within ...
This Python script accomplishes it: #!/usr/bin/python3 # Automatically scale text up as large as possible to fit within certain page count ...
Read more >How to control font sizes in pgf/tikz graphics in latex?
Are there anyways to specify font size in the setup I'm using? Is this perhaps the issue? The graph.tex file is generated automatically...
Read more >LaTeX typesetting in Mathematica - Szabolcs Horvát
FontSize . Use it to set the font size. Note that LaTeX uses different glyph shapes for different font sizes to improve readability....
Read more >7 Essential Tips for Writing With Jupyter Notebook
Font & font size. Method one. The following image shows the position of fonts. Jupyter Notebook font names ...
Read more >Code Highlighting with minted - Overleaf, Online LaTeX Editor
fontsize =\footnotesize : font size set to footnotesize . Any other font size can be set. linenos : enables line numbers. Other options...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Cleaning up Help Wanted stuff and we now consider it to be mutually exclusive with x-needs-design, and I agree this needs confirmation from design that this is the right choice.
That would be this issue here then, applying displaystyle would be a possible solution. The idea with inline math is to scale it such that it appears inline. This works ok for small formula or bigger font size, but with element’s defaults it results in a fraction being displayed very small. Displaystyle as an alternative to this inline style is (usually) for standalone blocks of formulas, allowing them to not be constrained to line height and thus formatting a lot nicer. See for an example: https://www.overleaf.com/learn/latex/Display_style_in_math_mode
My suggestion would be to simply default to this rendering mode in element by (presumably simply) telling the latex engine to use displaystyle instead of inline style.
One place where displaystyle should certainly be applied is when sending a message that is purely LaTeX, e.g.
"formatted_body": "<span data-mx-maths=\"\\frac{a}{\\phi^2}\"><code>\\frac{a}{\\phi^2}</code></span>", where it currently renders as inline