Hacker News new | past | comments | ask | show | jobs | submit login
Mathify – Simple Text Equation to LaTeX (mathifyit.com)
109 points by wenqin123 on March 26, 2017 | hide | past | favorite | 52 comments



I don't get it, why not just use LaTeX? The syntax is already almost the same anyway..


"$$x+\frac{32}{2}$$" is not "almost the same" as "x+32/2".


Using / instead of \frac is by far the biggest difference, so it is "almost the same".


Just wanted to point out that this is not friendly for beginners. A beginner will be lost between a lot of "\frac"s and "{}"s (I don't know the name in English, sorry). Been there


The problem is that this is a really tiny subset of what you can write with LaTeX, even for high school students it won't be enough. I'd much rather use something like https://www.codecogs.com/latex/eqneditor.php as a beginner.


Yep - even 'min' is missing. `min_` becomes `m \in _`, seemingly no way to force it to work, `{min}` or `\min` don't.


{} are "brackets"/"curly brackets" :)


No, [ ] are brackets; { } are braces.

(Disambiguating with an adjective does make it ok to use either -- "Curly brackets" are still { }, and "square braces" are still [ ] )


No, they aren't. () are brackets, [] are square brackets, {} are curly brackets. 'Brackets' always refers to () unless specifically you say 'square'.

Stop imposing your stupid American stuff on people.


I agree with your content, but not your tone. I'd like to add that one often hears "round brackets" as an unambiguous terms for the first category. And where's love for angle brackets <chevrons>?


There are substantially more Americans than people in any other English-speaking country, and, to top it off, we're on an American forum.

It's not "stupid" to assume the dialect we're using is American English. Why the aggressiveness?


Because the cultural ignorance you are showing is annoying. There are vastly more people speaking english in the world than there are US Americans. On top of that: Most of the Americans are speaking spanish and portuguese. America != US America for one.


Thanks! :)


No, they won't.


"x+32/2" and "x+\frac{32}{2}" do different things in LaTeX, but both are correct.


To be fair, this solution replaces the "$$" with several 10s of kilobytes of javascript.


That's what I was confused about. This is almost exactly LaTeX. The major difference is no "\". And it adds unneeded \left, \right, and just braces everywhere.

The biggest differences is in this example, I looked at all of them:

f'(x) = lim_{h -> 0} {f(x+h) - f(x)}/h

vs

f'(x) = \lim_{h\to 0}\frac{f(x+h) - f(x)}{h}

While the code it produces is way more than needed. See [1] for the crap it produces.

The key differences here are "\", "->" instead of "\to" (which \to makes more sense to me), and "/" instead of "\frac{}{}" (which I'll give to Mathify). But because LaTeX supports a lot more there is no question which one is actually easier.

[1] {f'{ \left( x \right) } = \lim _{{h \to 0}} \frac{{f{ \left( x+h \right) } - f{ \left( x \right) }}}{h}}


I mainly made it for stuff like division where you have to type in \frac{}{} every time. So instead of typing \frac{x}{3} you can just type x/3 and get the same result.


I was surprised to learn just the other week that `\frac x3` will give what you want, in Latex.


This works for a lot of stuff. If you are only giving one input it'll work. So things like "\sin x", "x^2" \frac12" work. Interestingly you need a space in the sin example but not in the others. But "x^12" is the same as "x^{1} 2". So be careful with the shortcut.


It's not surprising if you know how TeX lexes things, which you should never ever learn.


I remember being surprised when I first saw \frac12, and I was like "that works?". The response I got was "of course". In retrospect, I admit that's the right answer: once you get TeX well enough, it's obvious.


Often I do want to output x/3; is there a way to do that here?


Sorry I haven't thought of a good solution for that yet, but if you really want to write a / you can do: "x text{/} 3"


Maybe some simple quoting scheme for "literals"?


"why not just use LaTeX?"

Augment. Why not let the silicon do the grunt work of remembering latex and let the user get on with the job?


Related: http://asciimath.org/

Also, MathJax accepts asciimath as input, not sure if you can get LaTeX out of it though.


For Mac users, you can also use the built-in 'Grapher' application which comes with a decent GUI for writing equations/formulas.

1) Open up the 'Grapher' application from the 'Applications/Utilities' folder.

2) Click on 'Choose' (it doesn't matter what other options you pick from the initial loading screen).

3) From here on, just type your equation into the main input field. You can also use the equation palette from the dropdown menu on the right side of the main input field to access the templates for things like integrals and summations. From the dropdown, you should be able to click on 'Show Equation Palette' to get a window of all of the math symbols Grapher supports.

4) Once done writing your equation, select it all, right click, and then click on 'Copy LaTeX Expression'.


Feedback for the author: this site is currently best viewed at 80% zoom and a browser width of 320 pixels. Originally (at 15.6", full hd screen) I have to keep jumping from center to left with nothing in between, which feels kinda weird on my eyes.


Hey do you mind sending me a picture? You can reach me at wenqin908@gmail.com


No problem. Email sent with those two screenshots: https://snag.gy/cmDhG6.jpg and https://snag.gy/U4unJ2.jpg


Is there any ocr to latex? Are they any good?

For desktop-based equation writing, something like Microsoft's equation editor is perfect. For tablet/touch screen, a pen based OCR might work really well?


You want something more than deTeXify?


Bookmarked as my new fastest way to generate a small LaTeX graphic when I need one — though actually having the ability to input LaTeX might be useful as well for edge cases.



Check out Guppy if you want a live WYSIWYG tool

https://daniel3735928559.github.io/guppy/


Yes sounds interesting, I will look into it :)


By the way if you find any bugs or something doesn't work the way you expect it please let me know!


The biggest lack compared to my normal Latex usage is a `\mathrm` command or similar. For example I believe the chemical elements should be set in upright, not italic.


I just added mathrm{...your text...} and text{...your text...} to write upright text :)


It was puzzling that it showed "LaTeX: [empty small box]". I was waiting for something to load in that box before I realized that it would be replaced by the transormed output from whatever I typed above.

I don't know much about web design but for stuff like this I usually see the text box filled with an example input and the resulting output is displayed along with it.


I changed it so that it only shows the LaTeX box when you type something in.


delta produces \Delta instead of \delta, so there is no way to get \delta.

Is there a way to produce <= and >=? lt and gt become < and >, which is not so necessary seeing that < and > work fine, but lte and gte do not become \lte or \gte.

In the product prod example, there is nlogn in the source and logi in the rendering.


Ok I added <=, >= to produce \lte and \gte.

Also delta produces \delta instead of \Delta.


\ne is also missing.


Some equations are invalid LaTeX, such as `x_{1+x}_2`, but show up with translations regardless.


Not seeing it.


I could see this as being useful if it was available as a library


Combine this with Detexify?


That's actually a pretty good idea, never thought of that. It would be good for handwritten math notes.


Edit: apparently I didn't read the site closely enough!


That's literally the second thing the website mentions: To use curly brackets for invisible brackets:

    sqrt{1+2x^2/3}
    x^2/{3x}




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: