Live data from Hacker News

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

github.com

21–30 of 52 posts

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

#21

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…

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.

It's very cool, especially combined with your sugarTeX idea. I believe your abbreviations are faster for an expert; but using widely-known latex makes it more accessible to new adopters. They can shift to your expert shortcuts later!

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

#22

Earlier quoted context omitted.

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…

Yep, this initially started as Pandoc filter that iterates over math elements and applies regex replacing. Then I switched to Panflute to iterate over math easier. And eventually added {, } counter with left, right and center regex patterns for binary math operators.

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

#23
Transcompiler !

As if 'transpiler' was not nails-on-the-board grating enough. 'Compiler' is a fine word and the right word.

Anyone knows who started this 'transpiler' nonsense. Seems very common in the javascript community but not sure if it was their 'innovation'.

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

#24
post #23

Transcompiler ! As if 'transpiler' was not nails-on-the-board grating enough. 'Compiler' is a fine word and the right word. Anyone knows who started this 'transpiler' nonsense. Seems very common in the javascript community but not sure if it was their 'innovation'.

[deleted]

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

#25
I do not understand what this is exactly, but I'm very interested! What is a LaTeX "extension" ? Is it a LaTeX package that will allow me to write my math directly in unicode ? That would be so cool!

Could you please clarify the documentation (add some context) so that it is understandable to LaTeX users? Especially to LaTeX users that will want to keep using their own editor, and do not want to touch Atom with a long stick...

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

#26

I do not understand what this is exactly, but I'm very interested! What is a LaTeX "extension" ? Is it a LaTeX package that will allow me to write my math directly in unicode ? That would be so cool! Could you please clarify the documentation (add some context) so that it is understandable to LaTeX users? Especially to LaTeX users that will want to keep using their own editor, and do not want to touch Atom with a lon…

I meant extension in sence that it's a LaTeX language extension to it's superset.

There's no LaTeX package and I myself will not port it. SugarTeX is Pandoc/Markdown oriented project in the first place.

You can use it as a command line prepocess text filter though. It should work as long as you use ˎ or ˎˎ to define SugarTeX.

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

#27
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}$.

If it is only about reading then why not something like auctex preview (shows rendered graphics in place of commands)?

https://www.gnu.org/software/auctex/img/preview-screenshot.p...

or fold-mode (shows unicode and abbreviations in place of commands)?

https://www.flannaghan.com/2013/01/11/tex-fold-mode

Changing the representation seems more sensible to me than changing the underlying file.

Also, while the a/b syntax is easier for easy cases, I shudder to think how a continued fraction might be type set: https://en.wikipedia.org/wiki/Continued_fraction

This seems to make easy things easier and harder things really hard.

Kinda like https://www.lyx.org/Screenshots or using org-mode for latex. Convenient for simple matters and something you have to fiddle with or work around when you want to do anything more advanced.

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

#28

I do not understand what this is exactly, but I'm very interested! What is a LaTeX "extension" ? Is it a LaTeX package that will allow me to write my math directly in unicode ? That would be so cool! Could you please clarify the documentation (add some context) so that it is understandable to LaTeX users? Especially to LaTeX users that will want to keep using their own editor, and do not want to touch Atom with a lon…

You can already write your mathematics directly in Unicode, without needing any additional LaTeX package. See e.g. https://tex.stackexchange.com/q/87257/48 and the questions in the "Linked" sidebar on the right. (You may have to declare a few things one time; there are examples in the linked questions.) This thing here is only relevant if you're using Markdown and Pandoc, AFAICT.

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

#29

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…

Snippets perhaps? Something like https://github.com/SirVer/ultisnips may be useful here. It's got completion and replaces with templates (with some other powerful things too)

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

#30
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.

Also, if you're interested in readable languages, there's the family of roff languages that might seem terse at first when coming from LaTeX but actually have a very enjoyable grammar. The LaTeX ecosystem is so great that I don't really miss roff but I do have nice memories of writing reports in roff a couple of years ago. More to the point I found it wonderful to write graphics in the roff pic sublanguage.

Edit: actually even more to the point is the eqn sublanguage which really competes with Knuth notation.

Post reply on HN