News for hackers. Stuff that matters.
Re:Mathify – Simple Text Equation to LaTeX by ephimetheus on Sunday March 26, 2017 @12:53PM (#13961677)
I don't get it, why not just use LaTeX? The syntax is already almost the same anyway..
Re:Mathify – Simple Text Equation to LaTeX by umanwizard on Sunday March 26, 2017 @12:57PM (#13961695)
"$$x+\frac{32}{2}$$" is not "almost the same" as "x+32/2".
Re:Mathify – Simple Text Equation to LaTeX by IshKebab on Sunday March 26, 2017 @01:41PM (#13961942)
Using / instead of \frac is by far the biggest difference, so it is "almost the same".
Re:Mathify – Simple Text Equation to LaTeX by aaossa on Sunday March 26, 2017 @01:58PM (#13962068)
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
Re:Mathify – Simple Text Equation to LaTeX by clishem on Sunday March 26, 2017 @02:29PM (#13962260)
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.
Re:Mathify – Simple Text Equation to LaTeX by OJFord on Tuesday March 28, 2017 @03:58PM (#13980109)
Yep - even 'min' is missing. `min_` becomes `m \in _`, seemingly no way to force it to work, `{min}` or `\min` don't.
Re:Mathify – Simple Text Equation to LaTeX by 18nleung on Sunday March 26, 2017 @02:00PM (#13962085)
{} are "brackets"/"curly brackets" :)
Re:Mathify – Simple Text Equation to LaTeX by umanwizard on Sunday March 26, 2017 @02:23PM (#13962217)
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 [ ] )

Re:Mathify – Simple Text Equation to LaTeX by milesrout on Sunday March 26, 2017 @10:02PM (#13964588)
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.

Re:Mathify – Simple Text Equation to LaTeX by Y_Y on Sunday March 26, 2017 @11:00PM (#13964808)
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>?
Re:Mathify – Simple Text Equation to LaTeX by umanwizard on Sunday March 26, 2017 @11:48PM (#13965045)
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?

Re:Mathify – Simple Text Equation to LaTeX by jsilence on Monday March 27, 2017 @01:54AM (#13965467)
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.
Re:Mathify – Simple Text Equation to LaTeX by aaossa on Sunday March 26, 2017 @02:05PM (#13962121)
Thanks! :)
Re:Mathify – Simple Text Equation to LaTeX by milesrout on Sunday March 26, 2017 @10:02PM (#13964586)
No, they won't.
Re:Mathify – Simple Text Equation to LaTeX by lottin on Sunday March 26, 2017 @03:35PM (#13962690)
"x+32/2" and "x+\frac{32}{2}" do different things in LaTeX, but both are correct.
Re:Mathify – Simple Text Equation to LaTeX by contravariant on Sunday March 26, 2017 @07:56PM (#13964116)
To be fair, this solution replaces the "$$" with several 10s of kilobytes of javascript.
Re:Mathify – Simple Text Equation to LaTeX by godelski on Monday March 27, 2017 @01:20AM (#13965358)
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}}

Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @12:58PM (#13961698)
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.
Re:Mathify – Simple Text Equation to LaTeX by jmmcd on Sunday March 26, 2017 @01:48PM (#13961989)
I was surprised to learn just the other week that `\frac x3` will give what you want, in Latex.
Re:Mathify – Simple Text Equation to LaTeX by godelski on Monday March 27, 2017 @01:24AM (#13965373)
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.
Re:Mathify – Simple Text Equation to LaTeX by gunnihinn on Monday March 27, 2017 @03:11AM (#13965727)
It's not surprising if you know how TeX lexes things, which you should never ever learn.
Re:Mathify – Simple Text Equation to LaTeX by marvy on Sunday March 26, 2017 @03:33PM (#13962682)
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.
Re:Mathify – Simple Text Equation to LaTeX by stablemap on Sunday March 26, 2017 @01:20PM (#13961824)
Often I do want to output x/3; is there a way to do that here?
Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @02:37PM (#13962305)
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"
Re:Mathify – Simple Text Equation to LaTeX by wjn0 on Sunday March 26, 2017 @02:43PM (#13962340)
Maybe some simple quoting scheme for "literals"?
Re:Mathify – Simple Text Equation to LaTeX by bootload on Sunday March 26, 2017 @04:51PM (#13963214)
"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?

Re:Mathify – Simple Text Equation to LaTeX by simon_acca on Sunday March 26, 2017 @01:03PM (#13961728)
Related: http://asciimath.org/

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

Re:Mathify – Simple Text Equation to LaTeX by kevindong on Sunday March 26, 2017 @11:46PM (#13965033)
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'.

Re:Mathify – Simple Text Equation to LaTeX by lucb1e on Sunday March 26, 2017 @04:38PM (#13963130)
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.
Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @04:42PM (#13963158)
Hey do you mind sending me a picture? You can reach me at [email protected]
Re:Mathify – Simple Text Equation to LaTeX by lucb1e on Sunday March 26, 2017 @07:30PM (#13963998)
No problem. Email sent with those two screenshots: https://snag.gy/cmDhG6.jpg and https://snag.gy/U4unJ2.jpg
Re:Mathify – Simple Text Equation to LaTeX by amenghra on Sunday March 26, 2017 @03:28PM (#13962634)
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?

Re:Mathify – Simple Text Equation to LaTeX by marvy on Sunday March 26, 2017 @03:39PM (#13962715)
You want something more than deTeXify?
Re:Mathify – Simple Text Equation to LaTeX by idreyn on Sunday March 26, 2017 @01:00PM (#13961707)
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.
Re:Mathify – Simple Text Equation to LaTeX by jbergknoff on Sunday March 26, 2017 @01:19PM (#13961817)
Re:Mathify – Simple Text Equation to LaTeX by skierscott on Sunday March 26, 2017 @03:26PM (#13962608)
Check out Guppy if you want a live WYSIWYG tool

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

Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @01:09PM (#13961763)
Yes sounds interesting, I will look into it :)
Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @12:56PM (#13961689)
By the way if you find any bugs or something doesn't work the way you expect it please let me know!
Re:Mathify – Simple Text Equation to LaTeX by jmmcd on Sunday March 26, 2017 @01:51PM (#13962019)
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.
Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @02:46PM (#13962361)
I just added mathrm{...your text...} and text{...your text...} to write upright text :)
Re:Mathify – Simple Text Equation to LaTeX by wyldfire on Sunday March 26, 2017 @01:28PM (#13961864)
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.

Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @01:55PM (#13962046)
I changed it so that it only shows the LaTeX box when you type something in.
Re:Mathify – Simple Text Equation to LaTeX by tspiteri on Sunday March 26, 2017 @01:07PM (#13961756)
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.

Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @01:24PM (#13961847)
Ok I added <=, >= to produce \lte and \gte.

Also delta produces \delta instead of \Delta.

Re:Mathify – Simple Text Equation to LaTeX by lifthrasiir on Sunday March 26, 2017 @02:43PM (#13962339)
\ne is also missing.
Re:Mathify – Simple Text Equation to LaTeX by aratno on Sunday March 26, 2017 @01:47PM (#13961982)
Some equations are invalid LaTeX, such as `x_{1+x}_2`, but show up with translations regardless.
Re:Mathify – Simple Text Equation to LaTeX by marvy on Sunday March 26, 2017 @03:37PM (#13962707)
Not seeing it.
Re:Mathify – Simple Text Equation to LaTeX by goerz on Sunday March 26, 2017 @12:52PM (#13961674)
I could see this as being useful if it was available as a library
Re:Mathify – Simple Text Equation to LaTeX by gargarplex on Sunday March 26, 2017 @02:03PM (#13962107)
Combine this with Detexify?
Re:Mathify – Simple Text Equation to LaTeX by wenqin123 on Sunday March 26, 2017 @03:30PM (#13962643)
That's actually a pretty good idea, never thought of that. It would be good for handwritten math notes.
Re:Mathify – Simple Text Equation to LaTeX by umanwizard on Sunday March 26, 2017 @02:41PM (#13962327)
Edit: apparently I didn't read the site closely enough!
Re:Mathify – Simple Text Equation to LaTeX by Kametrixom on Sunday March 26, 2017 @02:50PM (#13962387)
That's literally the second thing the website mentions: To use curly brackets for invisible brackets:

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