Community Wishlist Survey 2022/Multimedia and Commons/Improve LaTeX rendering
Jump to navigation
Jump to search
Improve LaTeX rendering
- Problem: The current system for displaying mathematical formulas is very unsatisfactory. The formulas are converted into images in which the text appears in black on a transparent background, and then inserted into the text. For this reason, mathematical formulas in some extent clash with the surrounding text:
- Most important : sometimes punctuation signs are rejected on the next line when the formula is at the end of the line (cf. this page, in the second paragraph, or the next one, first line).
- formulas are always black, whatever the color of the surrounding text (see this page, the note);
- the alignment of the mathematical text on the line is not perfect;
- less important, the font differs from the ambient font and does not have exactly the same size.
- I would therefore like to see the formulas rendered in a more coherent manner with the surrounding text, and above all in such a way as not to violate the most basic rules of typography.
- Proposed solution: MathJax for example?
- Who would benefit: All readers of scientific articles on Wikipedia/scientific texts on Wikisource or Wikibooks.
- More comments: Please note that the request does not concern the input of mathematics by contributors, but only their display.
- Phabricator tickets:
- Proposer: ElioPrrl (talk) 10:57, 11 January 2022 (UTC)
Discussion
- We already use mathjax, just rendered to images (Because mathjax is hugely expensive JS to load). —TheDJ (talk • contribs) 10:52, 13 January 2022 (UTC)
- So my suggested solution may be discarded, but this does not make the problem (and especially the problem of punctuation) go away. — ElioPrrl (talk) 11:38, 14 January 2022 (UTC)
- For the most part, I'm fine with the current SVG rendering, but having at least the option to use others may still be a good implementation. For example, the blog Algorithm Archive uses mathjax as well, and allows changing the rendering very easily (right click the formulas). 83.42.134.97 01:23, 31 January 2022 (UTC)
- It is not true that "formulas are always black": There is a {color} feature. Maybe the description of LaTeX is unsatisfactory.
- The alignment of the mathematical text can be forced to be perfect. Maybe the description of LaTeX is too complicated and unsatisfactory. -Nomen4Omen (talk) 16:06, 4 February 2022 (UTC)
- I'm not sure if the mismatch between text and formulas is bothersome for many readers: it gives contrast, it may help to skim through. But I think your point was implicitly that gross or slight imperfections jump out even more starkly – to the point of tiring the eye – because of this somewhat strong contrast. Concerning those imperfections:
- The fact that a punctation sign immediately following a formula can go dangling around as the first character on the next line after break is a must fix! The only usable workaround today is to force the punctation in the formula, and since the punctation does not belong to the formula but to the surrounding sentence, it creates a typographic aberration (not to mention the semantic aspect). Maybe the formula processor could simply "eat" punctation signs and put them in a wrapper element with some CSS to prevent line-breaks?
- the same way there is an option
<math display=inline>
, there could be an option<math color=inherit>
, and every wiki could choose its prefered default value? - the baseline alignment? I guess there is/could be tweaking of configuration of the math renderer at every wiki. I'm certain there is an interaction with the CSS. For example if you paste the same text and formulas between fr.ws and en.ws, you'll see a snappier baseline at en.
- concerning the sizing, if it's not tweakable in the configuration of each wiki, it means every wiki must retrofit its (text) css to match with the math renderer! Trlit (talk) 03:31, 9 February 2022 (UTC)
- Support (didn't know voting ends at 18 UTC): We should start using KaTeX or MathJax already. w:user:Esquivalience/mathjax.js is a good start. ~~~~
User:1234qwer1234qwer4 (talk) 18:38, 11 February 2022 (UTC)
Voting
- Support --Raymonde Lanthier (talk) 14:13, 29 January 2022 (UTC)
- Support --F0x1 (talk) 14:35, 29 January 2022 (UTC)
- Support TheInternetGnome (talk) 08:14, 30 January 2022 (UTC)
- Support Alan ^{Talk} 13:36, 30 January 2022 (UTC)
- Support Thingofme (talk) 09:51, 1 February 2022 (UTC)
- Support KingAntenor (talk) 06:49, 2 February 2022 (UTC)
- Support Uanfala (talk) 21:31, 2 February 2022 (UTC)
- Support kocio ✉ 01:06, 6 February 2022 (UTC)
- Support Ayumu Ozaki (talk) 08:42, 6 February 2022 (UTC)
- Support —— Eric Liu_{（Talk）} 09:32, 6 February 2022 (UTC)
- Support --Ciao • Bestoernesto • ✉ 17:09, 6 February 2022 (UTC)
- Support No to dangling punctuations after line breaks! Trlit (talk) 03:38, 9 February 2022 (UTC)
- Support —— TheodoreIndiana (talk) 06:29, 11 February 2022 (UTC)