Welcome to Codidact Meta!
Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
Let SVG give a try for MathJax
In this feature-request, Mark Giraffe said that MathJax isn't highlighted.
if you change the renderer to SVG, it renders characters with paths not text elements. ~ @ArtOfCode said
But, I noticed in Wikipedia that they are using MathJax as SVG. Whenever I copy text of that SVG I can copy "MathJax" (Maybe, Latex. The formatting little bit looks like Latex).
Look what I got after copying.
:
{\displaystyle \log _{b}(x)=y\ }{\displaystyle \log _{b}(x)=y\ } exactly if {\displaystyle \ b^{y}=x\ }{\displaystyle \ b^{y}=x\ } and {\displaystyle \ x>0}{\displaystyle \ x>0} and {\displaystyle \ b>0}{\displaystyle \ b>0} and {\displaystyle \ b\neq 1}{\displaystyle \ b\neq 1}.
(I added br tag while pasting it here). They had put Latex code in alt text. So, could you try code for SVG once? (If you are free)
Here's the list what Wikipedia uses : https://en.wikipedia.org/wiki/Wikipedia:Rendering_math
You can use MathJax, Latex, MathML (whatever you like to use) in Wikipedia. Everything converts to SVG. And, you can select that SVG. Even, you can copy alt text of that SVG. Like, you can do for my above images. They suggest to use <sup>
and <sub>
for simple equations.
1 answer
But, I noticed in Wikipedia that they are using MathJax as SVG.
Are you sure? As far as I can tell, Wikipedia doesn't use MathJax at all. They appear to have some backend renderer.
Whenever I copy text of that SVG I can copy "MathJax" (Maybe, Latex. The formatting little bit looks like Latex).
...
They had put Latex code in alt text.
Inspecting with debugger tools, what I see is:
<span class="mwe-math-element">
<span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;">
<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle SNIP TEX MARKUP,}">
...
</math>
</span>
<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/IDENTIFIER" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -5.338ex; width:79.624ex; height:9.176ex;" alt="{\displaystyle SNIP TEX MARKUP,}">
</span>
So it's using MathML and server-side rendering with a fallback mechanism which includes the original TeX markup as two separate alt texts, explaining why when you select and copy it duplicates it.
So, could you try code for SVG once? (If you are free)
You can switch the renderer yourself: right-click a MathJax rendered span, and in the menu select Math Settings > Math Renderer > SVG
.
You can also copy the original markup with the same menu, with Copy to Clipboard > TeX Commands
.
1 comment thread