Live data from Hacker News

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

github.com

1–10 of 52 posts

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

#2
SugarTeX is a more readable LaTeX language extension and transcompiler to LaTeX. Designed to be used instead of $formula$ insertions to Markdown.

I use Markdown with Python code blocks for document programming via [Pandoctools](https://github.com/kiwi0fruit/pandoctools) (like R-Markdown).

Both Python and Markdown are very readable languages. Unfortunately LaTeX is not like this. So I wrote SugaTeX extension+transpiler that is highly readable. In order to achieve this it heavily uses Unicode so that SugarTeX install instructions even have recommended monospace font fallback chains.

[SugarTeX repo](https://github.com/kiwi0fruit/sugartex) with description.

Example of input to output conversion is at the end of [this PDF](https://github.com/kiwi0fruit/sugartex/blob/master/sugartex....).

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

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

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

#4

SugarTeX is a more readable LaTeX language extension and transcompiler to LaTeX. Designed to be used instead of $formula$ insertions to Markdown. I use Markdown with Python code blocks for document programming via [Pandoctools]( https://github.com/kiwi0fruit/pandoctools ) (like R-Markdown). Both Python and Markdown are very readable languages. Unfortunately LaTeX is not like this. So I wrote SugaTeX extension+transpi…

> Designed to be used instead of $formula$ insertions to Markdown.

What's the downside of having $formula$ blocks in Markdown?

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

#5
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 how to get it).

Perhaps surprisingly, java allows unicode identifiers etc, so I experimented with variables like δx and δt, and even ½i for PIC grids in CFG. It's cute, but I'm not really sure it's a good idea.

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

#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 ... what? Do you type the TeX and then have Atom autocomplete it into the Unicode symbols?

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

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

The pdf version is better than the markdown.

https://github.com/kiwi0fruit/sugartex/blob/master/sugartex....

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

#8
The juice is at the very end of the README, where you can see the unicode markup (ignore HN-mangled newlines):

ˎˎ ˱∇ × [ ⃗B] - 1∕c ∂[ ⃗E]∕∂t ˳= 4π∕c [ ⃗j] ¦# ∇ ⋅ [ ⃗E]\ ˳= 4πρ ¦ ∇ × [ ⃗E] + 1∕c ∂[ ⃗B]∕∂t ˳= [ ⃗0] ¦ ∇ ⋅ [ ⃗B]\ ˳= 0 ˲ ,ˎˎ{#eq:max}

where ˎ[ ⃗B], [ ⃗E], [ ⃗j]: ℝ⁴ → ℝ³ˎ – vector functions of the form

ˎ(t,x,y,z) ↦ [ ⃗f](t,x,y,z), [ ⃗f] = (f_˹x˺, f_˹y˺, f_˹z˺)ˎ.

renders to:

$$ \begin{aligned}∇ × {\mathbf{B}} - \frac{1}{c} \frac{∂{\mathbf{E}}}{∂t} &= \frac{4π}{c} {\mathbf{j}}\ ∇ ⋅ {\mathbf{E}}\ &= 4πρ \ ∇ × {\mathbf{E}} + \frac{1}{c} \frac{∂{\mathbf{B}}}{∂t} &= {\mathbf{0}} \ ∇ ⋅ {\mathbf{B}}\ &= 0 \end{aligned} ,$${#eq:max}

where ${\mathbf{B}},,{\mathbf{E}},,{\mathbf{j}}:,ℝ^{4} → ℝ^{3}$ -- vector functions of the form $(t,x,y,z) ↦ {\mathbf{f}}(t,x,y,z),,{\mathbf{f}} = (f_{\mathrm{x}}, f_{\mathrm{y}}, f_{\mathrm{z}})$.

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

#9
post #4

SugarTeX is a more readable LaTeX language extension and transcompiler to LaTeX. Designed to be used instead of $formula$ insertions to Markdown. I use Markdown with Python code blocks for document programming via [Pandoctools]( https://github.com/kiwi0fruit/pandoctools ) (like R-Markdown). Both Python and Markdown are very readable languages. Unfortunately LaTeX is not like this. So I wrote SugaTeX extension+transpi…

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

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

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

It needs indeed...

I guess Unicode Math is a part of SugarTeX as every valid LaTeX is a valid SugarTeX (unless it has new SugarTeX meaning, otherwise it's a bug). Or maybe there's something I do not know about Unicode Math? I thought it simply replaces/treats some Unicode characters with LaTeX commands. So I used this feature and didn't bother replacing some Unicode.

Post reply on HN