Live data from Hacker News

Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

github.com

11–20 of 52 posts

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#11
post #6

As far as I can deduce, you're trying to incorporate LateX into .md using the Markdown Philosophy of "you should write something that's readable as plain text, without compilation, also". Is that basically right? If so it should probably be right at the top, because it's hard to tell right now. The idea makes sense, though I'm not sure if it's... better. Do you expect people to input " ⃗E" and "⨌" as text? Or ... wha…

You are completely right. But I thought

``Both Python and Markdown are very readable languages. Unfortunately LaTeX is not like this. So I wrote SugaTeX extension+transpiler that is highly readable.``

means the same...

As about input. My bad: I forget to tell about SugarTeX completions package for Atom. There to write `` ⃗E`` you type ``\^->``(+E) this autocompletes to `` ⃗E``.

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#12
post #6

As far as I can deduce, you're trying to incorporate LateX into .md using the Markdown Philosophy of "you should write something that's readable as plain text, without compilation, also". Is that basically right? If so it should probably be right at the top, because it's hard to tell right now. The idea makes sense, though I'm not sure if it's... better. Do you expect people to input " ⃗E" and "⨌" as text? Or ... wha…

SugarTeX completions: https://atom.io/packages/sugartex-completions

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#13
post #3

Hi, this desperately needs examples of formulas (code and rendered) front and center. It's pretty hard to understand how this could be useful without that. A comparison to UnicodeMath (which seems very similar and is an existing standard which already works in Latex) would also be useful.

100% agree. But at least there is an example at the very end of the docs: https://github.com/kiwi0fruit/sugartex/blob/master/sugartex.... I don't find it readable, but it is an extreme example - it would sell the concept better to start with simple, effortlessly superior cases. I'm not sure about this whole concept of unicode. It is more readable for sure, but harder to write (to remember which unicode to use, and ho…

My bad: I forget to tell about SugarTeX completions package for Atom. With it writing Unicode is lot faster and simple enough.

https://atom.io/packages/sugartex-completions

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#14
post #9
post #4

Earlier quoted context omitted.

> Designed to be used instead of $formula$ insertions to Markdown. What's the downside of having $formula$ blocks in Markdown?

ˎa/bˎ is easier to read than $\frac{a}{b}$.

Oddly, Knuth prefers ${a \over b}$. I think I agree, if only because it actually reads well.

An odd thing I found, was the once I learned how to verbalize many of the maths that I encountered, reading them became much easier. LaTeX actually helped a lot here, because most of the constructs have good readable macros to typeset them.

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#15

Earlier quoted context omitted.

100% agree. But at least there is an example at the very end of the docs: https://github.com/kiwi0fruit/sugartex/blob/master/sugartex.... I don't find it readable, but it is an extreme example - it would sell the concept better to start with simple, effortlessly superior cases. I'm not sure about this whole concept of unicode. It is more readable for sure, but harder to write (to remember which unicode to use, and ho…

My bad: I forget to tell about SugarTeX completions package for Atom. With it writing Unicode is lot faster and simple enough. https://atom.io/packages/sugartex-completions

OK, so the whole system is: type in latex, becomes unicode text, finally rendered as symbols (e.g. in a pdf). Except that with that atom package, you needn't type the whole latex, because it autocompletes.

BTW what is that kind of completion called (i.e. where it doesn't just complete, but also replaces it with something else); and is something like that available for vim - or for rlwrap? (I searched, but "completion" brings up all the standard vim completion modes). EDIT vim has "abbreviations", but the no built-in automcomplete mode for them (though you could also put them in a file, and have completion scan that file - or write your own).

A "desugarTeX" could transform an existing latex doc into a unicode version, which could still be used as a source document, via sugarTeX. Arguably, this desugarTeX is kinda sorta like an output format of latex (like pdf or dvi), except that it's also machine readable as latex input.

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#16

Earlier quoted context omitted.

My bad: I forget to tell about SugarTeX completions package for Atom. With it writing Unicode is lot faster and simple enough. https://atom.io/packages/sugartex-completions

OK, so the whole system is: type in latex, becomes unicode text, finally rendered as symbols (e.g. in a pdf). Except that with that atom package, you needn't type the whole latex, because it autocompletes. BTW what is that kind of completion called (i.e. where it doesn't just complete, but also replaces it with something else); and is something like that available for vim - or for rlwrap? (I searched, but "completion…

Not really. With that package you can type in LaTeX. But it's inherited behavior.

I myself prefer type `\^:` to get vector superscript symbol, type `\^->` to get another vector superscript symbol. Type:.\rot`to get matrix superscript symbol. Type `\-->` to get long arrow.

But yes, type `\\` to get broken vertical bar that's a new newline symbol, type `\&` to get small sing below that later again converts to `&`.

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#17

Earlier quoted context omitted.

My bad: I forget to tell about SugarTeX completions package for Atom. With it writing Unicode is lot faster and simple enough. https://atom.io/packages/sugartex-completions

OK, so the whole system is: type in latex, becomes unicode text, finally rendered as symbols (e.g. in a pdf). Except that with that atom package, you needn't type the whole latex, because it autocompletes. BTW what is that kind of completion called (i.e. where it doesn't just complete, but also replaces it with something else); and is something like that available for vim - or for rlwrap? (I searched, but "completion…

I'd better call it 'TeX-Sugarer', though. And yes it's possible to create it to import LaTeX to SugarTeX.

SugarTeX completions is forked from latex-completions Atom package. I haven't seen something like this before.

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#18
post #14
post #9

Earlier quoted context omitted.

ˎa/bˎ is easier to read than $\frac{a}{b}$.

Oddly, Knuth prefers ${a \over b}$. I think I agree, if only because it actually reads well. An odd thing I found, was the once I learned how to verbalize many of the maths that I encountered, reading them became much easier. LaTeX actually helped a lot here, because most of the constructs have good readable macros to typeset them.

More on Knuth preferring `\over`: https://tex.stackexchange.com/a/390977/48 (I may have gone a little overboard…) The LaTeX (not TeX) community seems to strongly prefer `\frac` and strongly discourages `\over`, e.g. https://tex.stackexchange.com/questions/73822/what-is-the-di...

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#19

Earlier quoted context omitted.

OK, so the whole system is: type in latex, becomes unicode text, finally rendered as symbols (e.g. in a pdf). Except that with that atom package, you needn't type the whole latex, because it autocompletes. BTW what is that kind of completion called (i.e. where it doesn't just complete, but also replaces it with something else); and is something like that available for vim - or for rlwrap? (I searched, but "completion…

Not really. With that package you can type in LaTeX. But it's inherited behavior. I myself prefer type `\^:` to get vector superscript symbol, type `\^->` to get another vector superscript symbol. Type:.\rot`to get matrix superscript symbol. Type `\-->` to get long arrow. But yes, type `\\` to get broken vertical bar that's a new newline symbol, type `\&` to get small sing below that later again converts to `&`.

I think you started with something simple, but quickly found you needed to add features for it to work properly for you - and I'd guess it is more-or-less complete for your use-case now. The documentation is a reference for all the features. But it's difficult for a newcomer, to see the full complexity of the end-product, first.

Echoing the root of this thread, I think a tutorial would help, covering the simplest and most common features first (and the ones that work most neatly and elegantly). I'd suggest, for every example, have three parts, in the order a user would experience them:

  1. user-entered shortcut  e=mc\^2
  2. unicode appearing      e=mc²
  3. an image of pdf
I'd omit the actual latex from this tute, because the user never actually sees it...

Re: Show HN: SugarTeX – readable LaTeX language extension and transcompiler to LaTeX

#20

Earlier quoted context omitted.

My bad: I forget to tell about SugarTeX completions package for Atom. With it writing Unicode is lot faster and simple enough. https://atom.io/packages/sugartex-completions

OK, so the whole system is: type in latex, becomes unicode text, finally rendered as symbols (e.g. in a pdf). Except that with that atom package, you needn't type the whole latex, because it autocompletes. BTW what is that kind of completion called (i.e. where it doesn't just complete, but also replaces it with something else); and is something like that available for vim - or for rlwrap? (I searched, but "completion…

Yep, such examples are needed...

BTW: `mc\^2` gives mc²

Post reply on HN