# Copy math from Wikipedia

What is the best way to copy and paste text containing formulas from Wikipedia, e.g. Henstock–Kurzweil integral - Wikipedia ?

The naïve approach gives raw mediawiki text.

{\displaystyle f(x)={\frac {1}{x}}\sin \left({\frac {1}{x^{3}}}\right).}f(x)={\frac  {1}{x}}\sin \left({\frac  {1}{x^{3}}}\right).
This function has a singularity at 0, and is not Lebesgue integrable. However, it seems natural to calculate its integral except over the interval [−ε, δ] and then let ε, δ → 0.


Isn’t that good enough? I don’t really know what your issue is.

This is not what you’re looking for?

edit: I didn’t realize this was such an old post… sry

How did you get this to work?

Still not working 100% for me.
When I copy from “This integral” to “…δ → 0” it doesn’t display the $$\frac{1}{x} sin(\frac{1}{x^3})$$ equation properly:

This integral was first defined by Arnaud Denjoy (1912). Denjoy was interested in a definition that would allow one to integrate functions like

{\displaystyle f(x)={\frac {1}{x}}\sin \left({\frac {1}{x^{3}}}\right).}

This function has a singularity at 0, and is not Lebesgue integrable. However, it seems natural to calculate its integral except over the interval [−ε, δ] and then let ε, δ → 0.

When I start copying with the equation, the equation displays properly, but it is an image link, not Markdown:

This function has a singularity at 0, and is not Lebesgue integrable. However, it seems natural to calculate its integral except over the interval [−ε, δ] and then let ε, δ → 0.

and when I copy just the equation, I get an image, as expected.

The inline equations also don’t work for me:

we define the Riemann sum for a function {\displaystyle f\colon [a,b]\to \mathbb {R} } to be

I just put the latex in , and the text below in one block.

this is the block:

$${\displaystyle f(x)={\frac {1}{x}}\sin \left({\frac {1}{x^{3}}}\right)}$$
This function has a singularity at 0, **and** **is** **not** Lebesgue integrable. However, it seems natural to calculate its integral except over the interval [−ε, δ] **and** then **let** ε, δ → 0.

1 Like

ok, I see. So one still has to edit every formula by hand. I was hoping to find something automatic, especially for text with lots of in-line formulas.

I just wrote a feature request for smart pasting to allow user-defined regexps and callbacks to be run during paste for capturing google maps links, but now I realize that this would also make it easy to recognize Wikipedia math and turn it into proper Markdown.

There is a tool that converts equations to markdown very well, you can find it here: https://mathpix.com/.

1 Like