Convert an Equation Editor Object back to plain text

In summary: Word!) In summary, there are various tools and plugins available for converting LaTeX equations to plain text or other formats, such as PDF or PNG. These include OCR software, online converters, and specialized programs like Wolfram Alpha and Mathpix. Some programming projects, such as Compitex and the Word Equation to C# converter, also offer options for converting equations to code. However, there may be limitations or challenges in the conversion process, such as dealing with extended character sets or formatting issues. Further exploration and experimentation may be necessary to find the most effective solution for a particular situation.
  • #1
Muskyboi
10
0
Is there a tool that can convert something like this:
1595065591933.png


which when copied as plain text looks like this: \frac{4}{\pi}\sin\left(x\right)+\frac{4}{3\pi}\sin\left(3x\right)+\frac{4}{5\pi}\sin\left(5x\right)+\frac{4}{7\pi}\sin\left(7x\right)+\frac{4}{9\pi}\sin\left(9x\right)

To this: 4/pi*sin(x)+4/(3pi)*sin(3x)+4/(5pi)*sin(5x)+4/(7pi)*sin(7x)+4/(9pi)*sin(9x)
 
Physics news on Phys.org
  • #3
Muskyboi said:
Is there a tool that can convert something like this:
View attachment 266516

which when copied as plain text looks like this: \frac{4}{\pi}\sin\left(x\right)+\frac{4}{3\pi}\sin\left(3x\right)+\frac{4}{5\pi}\sin\left(5x\right)+\frac{4}{7\pi}\sin\left(7x\right)+\frac{4}{9\pi}\sin\left(9x\right)

To this: 4/pi*sin(x)+4/(3pi)*sin(3x)+4/(5pi)*sin(5x)+4/(7pi)*sin(7x)+4/(9pi)*sin(9x)

1595103593915.png


What format is the source? Is it just a JPEG or BMP picture, or a PDF snapshot? Or something copy/pasted from MSWord? The source format will make a big difference in how difficult the conversion will be, IMO.
jedishrfu said:
it would be an interesting parsing project in a Comp Sci course on Compilers.
Absolutely. It would be a fun project, if the input format was something reasonable (instead of having to do full character recognition from a BMP file as a first step). :smile:
 
  • #4
I thought the source was just the latex string to convert to a plain text target

A related fun project would be conversion to character graphics:

Code:
              //\\ pi/2
            //
           // sin(x) dx
          //
       \\// 0
come in useful source code

This would come in useful in source code comments or markdown where the viewer uses character graphics.
 
  • #5
Oh, oops, I think you're right. I misread the OP to be "convert from this math equation to LaTeX". Sorry, nothing to see here, everybody move along... o0)
 
  • #6
jedishrfu said:
I thought the source was just the latex string to convert to plain text
And yeah, that's a MUCH easier problem to assign in a compiler class. :wink:
 
  • #7
What about exporting it as a PDF or PNG file and using OCR software? I tried with FreeOCR on the PNG in the OP, but it did not do very well. Maybe better OCR software would do a better job.

FreeOCR converted it to
%si.1.1[x)+% sin(3x)+% sin(5x)+% sin(Tx) + sin[9.\'

Not a good result. But I have seen OCR software do some impressive things.
PS. I just tried a couple of online TEX to TXT converters and they did not work well.
 
Last edited:
  • #8
Input: \frac{4}{\pi}\sin\left(x\right)+\frac{4}{3\pi}\sin\left(3x\right)+\frac{4}{5\pi}\sin\left(5x\right)+\frac{4}{7\pi}\sin\left(7x\right)+\frac{4}{9\pi}\sin\left(9x\right)https://www.wolframalpha.com/input/?i=+\frac{4}{\pi}\sin\left(x\right)+\frac{4}{3\pi}\sin\left(3x\right)+\frac{4}{5\pi}\sin\left(5x\right)+\frac{4}{7\pi}\sin\left(7x\right)+\frac{4}{9\pi}\sin\left(9x\right)

1595221901334.png

produces

4/π sin(x) + 4/(3 π) sin(3 x) + 4/(5 π) sin(5 x) + 4/(7 π) sin(7 x) + 4/(9 π) sin(9 x)
also interesting:

https://mathpix.com/
http://www.i2ocr.com/free-online-math-equation-ocr
http://www.inftyproject.org/en/index.html
 
Last edited:
  • Like
Likes Muskyboi and FactChecker
  • #9
robphy said:
Input: \frac{4}{\pi}\sin\left(x\right)+\frac{4}{3\pi}\sin\left(3x\right)+\frac{4}{5\pi}\sin\left(5x\right)+\frac{4}{7\pi}\sin\left(7x\right)+\frac{4}{9\pi}\sin\left(9x\right)https://www.wolframalpha.com/input/?i=+\frac{4}{\pi}\sin\left(x\right)+\frac{4}{3\pi}\sin\left(3x\right)+\frac{4}{5\pi}\sin\left(5x\right)+\frac{4}{7\pi}\sin\left(7x\right)+\frac{4}{9\pi}\sin\left(9x\right)

View attachment 266604
produces

4/π sin(x) + 4/(3 π) sin(3 x) + 4/(5 π) sin(5 x) + 4/(7 π) sin(7 x) + 4/(9 π) sin(9 x)
also interesting:

https://mathpix.com/
http://www.i2ocr.com/free-online-math-equation-ocr
http://www.inftyproject.org/en/index.html
This is exactly what I was looking for. Thank you.
 
  • #10
robphy said:
produces

4/π sin(x) + 4/(3 π) sin(3 x) + 4/(5 π) sin(5 x) + 4/(7 π) sin(7 x) + 4/(9 π) sin(9 x)
For the record: When you hover the mouse over the picture of the equation, extra buttons appear and the one on the right brings up the plain text

1595505922395.png
 
  • #11
The only potential problem with Wolfram's plain text is that it uses the extended character set, so ##\pi## instead of Pi. That is acceptable in many places that you might paste it, but not everywhere.
 
  • #12
Turns out Excel (?:)) accepts ##\pi## as a name, but of course it wants all the asterisks :frown:

π 3.141592654 (formulas|create from selection)

=4/π* sin(x) + 4/(3 *π) *sin(3* x) + 4/(5 *π) *sin(5* x)+ 4/(7 *π)* sin(7 *x) + 4/(9* π) *sin(9* x)

does the work an comes up with a value
 
  • Like
Likes sysprog and FactChecker

FAQ: Convert an Equation Editor Object back to plain text

1. How do I convert an Equation Editor Object back to plain text?

To convert an Equation Editor Object back to plain text, you can use the "Unlink" feature in the Equation Editor tool. This will remove all formatting and return the equation to plain text.

2. Can I convert multiple Equation Editor Objects at once?

Yes, you can convert multiple Equation Editor Objects at once by selecting all the objects and then using the "Unlink" feature. This will remove the formatting from all selected objects.

3. Will converting an Equation Editor Object to plain text affect the equation's accuracy?

No, converting an Equation Editor Object to plain text will not affect the equation's accuracy. It will only remove the formatting and return the equation to its basic form.

4. How can I convert an Equation Editor Object back to plain text in Microsoft Word?

In Microsoft Word, you can convert an Equation Editor Object back to plain text by selecting the object and then clicking on the "Unlink" button in the Equation Tools tab. You can also right-click on the object and select "Unlink" from the menu.

5. Is there a way to convert an Equation Editor Object back to plain text without losing the formatting?

No, converting an Equation Editor Object back to plain text will remove all formatting. If you want to keep the formatting, you can copy and paste the object as an image or use a third-party equation editor software that allows you to convert equations to various formats.

Similar threads

Replies
11
Views
6K
Replies
2
Views
679
Replies
6
Views
4K
Replies
5
Views
977
Replies
3
Views
1K
Back
Top