How to convert math equations or chemical reactions to LaTeX the easy way!

Yashar Mansouri
3 min readSep 26, 2019

--

Are you stuck in writing your math or chemical equations? Are you tired of checking the markdown every time? Stop torturing the shift/ctrl +enter keys right now!

Whenever I try to write an equation in a markdown format whether in Jupyter or R-Studio I get confused. What are all these symbols?! How should I memorize them. There should be an easier way to put simple (or complex) formulas in markdown format, right?

I present you the red / blue pill theory:

To pill or not to pill!

If you want to take a life of harsh knowledge, desperate freedom, and the brutal truths of reality, take the red pill: There’s a great Wiki page, or this cheat sheet from Authorea that can teach you how to Kung Fu!

Greek and Hebrew Letters — Retrieved from https://www.authorea.com/users/77723/articles/110898-how-to-write-mathematical-equations-expressions-and-symbols-with-latex-a-cheatsheet
Congrats. Now you know how to Kung Fu in LaTeX!

I mean just look at Einstein’s mass energy formula. He didn’t have trouble writing down the famous E = mC², right? No Greek letters, no symbols, no complexity. He just had to write the following in LaTeX:

Who would’ve known I have 8,088,796 tera joules of energy! That’s 96,295 nuclear bombs, considering 84 tera joules per each! Can you guess my weight?
Voila! More time for the relativity theory!

But what if you wanted to write down more complicated formulas such as the lasso? What if you know how to LaTeX and still it takes you 5 minutes and a couple tries to write this down? If you’re a data scientist you might deal with this shrinkage method a lot!

Lasso or the grip of death!

Are you ready to write this?

Lasso the LaTeX way!

Sometimes it’s just better to take the blue pill. Are you sure you don’t want a life of tranquil happiness with blissful ignorance of the harsh realities of LaTeX?!

There’s a solution. It is Mathpix Snipping Tool!

If you don’t believe me, just look at the comments from Albert Einstein or Isaac Newton.

Albert loves Mathpix! Retrieved from https://mathpix.com/
Mathpix saved Isaac’s life but apples did not. Retrieved from https://mathpix.com/

Yes you need to install it and yes you need to create an account. It is free for 50 snips a month!

Here’s how it works:

  1. Have the formula on your screen whether from a handwritten note picture.
  2. Press the magic keyboard shortcut:

Ctrl + ⌘ + M on Mac

Ctrl + Alt + M on Windows & Linux

3. Find your LaTeX on the screen ready for copying and inserting:

The top row is your screenshot, the second row is the output. and below the output is the LaTeX ready for copy / paste. It even shows you the confidence rate!

This even works on your handwritten notes or chemical reactions:

My handwritten cruelty-free photosynthesis reaction!
Here’s the results and it is a perfect capture! Low self-esteem issues… .

Mathpix won’t be always right and sometimes it might give you misinterpreted output. If you face something like this, It’d be better to just write your formulas in a better handwriting and then capture them.

Finally data science got to the point of helping data scientists! Now we can all binge watch some shows.

I am Albert😎 and I approve this message.

If you liked this post feel free to clap and leave me a comment with your favorite shows or a link to a funny gif!

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Yashar Mansouri
Yashar Mansouri

Written by Yashar Mansouri

✔ Data Scientist / Engineer. Coffee➡Code➡Data➡ML➡Life

Responses (2)

Write a response