Show HN: TeXnique – A LaTeX Typesetting Game
texnique.xyz
texnique.xyz
Right now, the website is a super simple static HTML page. If we have time, we'd also like to add some new features, like a leaderboard and (hopefully) better comparison logic. Feel free to contribute, and we appreciate the feedback!
\frac 1 n
instead of \frac{1}{n}
though even greater gains would be from having your own bespoke file-of-macros.I feel like the game doesn't give enough time with respect to how long it takes to type certain expressions, so you'll get some high variance on scores just from this cutoff. If you get a big expression right at the end of the time limit, there's a chance you'll lose out on 11 points because it took a second to recognize what you typed --- I played three times, getting around 53 and 55 points the first two times, but then the third time I only got 42 because it didn't recognize the following expression:
W(x,p)=\frac{1}{\pi \hbar}\int_{-\infty}^\infty\langle x+y|\hat\rho|x-y\rangle^{-2ipy/\hbar}dy
and I couldn't spot the difference in the few seconds I had left.For some of the equations, I was tempted to fix the typesetting, but I figured if I did it wouldn't recognize it. For example, there needs to be a hairline space in integrals:
\int u\,dv
Or for divisibility it should use \mid for the relation and not |.A small frustration was the delay between typing an expression, recognition, then rendering the new expression, especially since this all counted toward the time limit. Maybe having MathJax pre-render the expressions could speed some of this up. Another option is instead of a trial of how many you can complete is having a small collection then timing how long it takes to complete that. Instead of having a sequence of expressions with different numbers of points, the page of expressions could all be of a similar level of difficulty.
Thanks for making this!
Very funny how you link to Detexify. That site has been around for a long time and it's a fundamental resource. I think it's still just being run by some dude for fun. I hope it never goes away.
Just say NO! to plain TeX commands.
It also may help to render the formula in different fonts, and require all renderings to pass your heuristics.
1. There's an order of magnitude difference in the difficulty of problems. Some are hardly more complex than a couple of subscripts and maybe a \frac{}{}, while others need matrix notation. However, they all count as "1 problem." That's pretty weird.
2. There were also a couple of problems where I couldn't figure out why it wasn't accepting my answer, as it was visually identical. It must already be allowing for several variations (\text vs. \operatorname, \over vs. \frac), but Latex is so flexible it doesn't seem to be able to catch all the equivalent ways to solve problems. Plus, there's absolutely no feedback, which means you can sink 30 seconds into a hard problem, not have it accept it, and have no idea what to do next.
2. See my comment above - comparison is a tough problem right now, the website is pretty simple. We'd like to improve it though!
But I have a few suggestions.
1) have a variable time. 3 minutes is pretty tough (maybe 5 default?) Sometimes I can get 10, sometimes I can get 1. I know there's the skip, but this is more fun for learning than competing tbh (can't seem to quite get to 40. Maybe a few more goes). (I can hack this like another comment says with console lol)
2) do a recap! Including the ones you skip. That way when you skip you don't feel like you lose out on the learning. It's "I can't remember this, I'll get it next game" kinda thing. It would also be great to see the different possible solutions.
3) there's some cases I can't quite see what's wrong with. There's a few I spent the entire time looking for the difference. Anyone else hit this issue? Most of them were pretty simple too so I wouldn't have expected them to be written in a different way, especially since all parts of my solutions were in other problems that I got right. Maybe also have a "I got this right" button and you the devs can get new methods? (I wouldn't auto store these, but maybe give the points and manually check later. If you're interested in maintaining and continuing this project)
4) some help with formatting would be awesome. I'm writing the messiest latex of my life here simple because I can't use a tab.
But all in all I love this. Already sent to a bunch of friends and I'm going to have students use this.
Edit:
5) maybe make the total points in a game similar. My highest score I got a really large problem and then a small problem. Other runs in going very fast and don't even score 30 because they are all low points.
Edit 2:
Some of these that are low points are really time consuming. Getting to 40 seems like a luck based thing
1. Hmm, perhaps we could change the game model? Instead of solving as many as you can in three minutes, we could (1) have a set time per problem, and a fixed number of problems or (2) have some system to add back time for correct answers.
2. This is on our todo list!
3. Yes, see my comment from above -- we're thinking of simple ways to accept slight variations. A way to contest variations might is a good idea.
4. How do you propose we do this?
5. So right now, a problem is worth ceiling(length of our solution / 10.0) points. This seemed like a good way to reward harder questions proportional to the time spent solving them. Any other suggestions?
I really like the format of the user interface with instant response/feedback.
It seems like you're pretty close to having an genuinely useful page.
Suggestions:
- As-is, this is really only useful to people who already have some familiarity with this material already. It would be way more useful if it had an additional mode for an absolute beginner
- Instead of being just a memory/recall test, the primary usage mode should be a tutorial and response format for learning
- In the learning mode, first present information on one new concept, then allow the user to test their new knowledge on a problem similar to the way the existing system works
I surprised myself by remembering some symbols I haven't used in a while but was stumped on a few I should have known (nth roots).
Thankfully typesetting here meant math formulas, not minipage layouts.
Most researchers / students I know who are "power-users" of TeX have fairly idiosyncratic editing habits, so it would be nice to support `\newcommands` or eventually editor bindings. (I write a lot of "live-TeX" during lectures for school: https://github.com/acganesh/stanford-compendium, and I have one-character `vim` macros for each symbol). I ended up opening a `vim` pane and copying my TeX over to Chrome.
I know Evan Chen (MIT grad student) is a really prolific live-TeXer, so you might try contacting him for feedback. I'm a huge fan of this project of his: https://github.com/vEnhance/napkin.
I really like the visual equation recognition, sort of like a beefed up DeTeXify. It's very helpful to ensure that all "equivalent" TeX commands are matched appropriately.
I think there are some gotchas with space matching (I opened a few GitHub issues, e.g. https://github.com/akshayravikumar/TeXnique/issues/7), but these should be fixable.
Feel free to contact me if I can help! Sounds like a really fun project.
Also, we're friends with Evan and have already gotten his feedback. :)
\sqrt{2}\not\in\mathbb{Q}
It refused to accept this answer, even though it looked pixel-for-pixel identical with the intended output.On further play...perhaps there's some small difference between \not\in and \notin, as there is clearly between \not\exists and \nexists, but I couldn't see it..
Similarly, for the inverse of a complex number, I couldn't figure out why it didn't accept:
z^{-1} = \frac{\overline{z}}{|z|^2},\forall z \neq 0We're figuring out the best way to accept slight variations. It's a tough problem and isn't as simple as increasing the pixel threshold. For example, replacing a + with a - has an extremely small pixel difference (and the two characters have the same width, so it doesn't affect anything else), but we shouldn't accept both.
Finally something to let my TeX mind out at.
A problem is though, that at times the game will surprisingly quit saying I've run out of time? Don't know what is going wrong here.
Obviously I knew the basics, but boy does immersion work in learning a language.
I highly recommend it for anybody who wants to climb the curve.
I'm either rusty, or the time limits aren't reasonable.
I barely made it through the big equation with the partials in it (sorry forgot the name).