Which is why it would be great if more things generating formatted mathematical output accepted UnicodeMath [0], which is about as minimal a formatting language as possible (and, as a result, maximally readable as plain text.)
Unfortunately, I don't know anything that uses it besides Microsoft's formula editors (in various Office apps.)
The output for x 2 was chosen to print out \sqrt because it is possible to have x ^2 in python whose output would be x ^ 2 as expected. The idea is using to print long sqrt so advantaging this behavior. Although i haven't implemented x^2 planning to do it next week with the new improvements.
Interesting, i wasn't aware of that.However one of the goals of Lax is being extensible through python easily and being simplistic, one could define their own common latex structures in python then reuse it.
Likewise, in SageMath you can turn any expression obj (matrices, fractions, elliptic curves, etc.) into latex by typing `latex(obj)`. (Disclaimer: I started SageMath and wrote a lot of this conversion to latex functionality early on, since it's useful for notebook interfaces.) Most objects in Sage have an _latex_ method, and the latex function works by recursively calling those methods to build a big latex expression. SageTex -- which lets you embed Python code in LaTeX documents -- also uses this latex(obj) functionality.
Shameless plug... if you want to convert from AsciiMath to LaTeX here is something I've written (it's not beautiful and works only online, but it was a showcase only):
I feel that (as much as I personally don't like them) IPython notebooks would solve this niche pretty well (though currently you still need a separate LaTeX document).
I do feel like there is a middle ground somewhere there between the "format all content to fit A4 paper" idiom of Word/TeX, and the more interactive markdown + simulation environment of Jupyter. The latter is really growing on me, but conferences really still want their paper articles and pdf/pptx slide decks.
I am really hopeful for Scribble from Racket as a Latex replacement.
> Scribble is a collection of tools for creating prose documents—papers, books, library documentation, etc.—in HTML or PDF (via Latex) form. More generally, Scribble helps you write programs that are rich in textual content, whether the content is prose to be typeset or any other form of text to be generated programmatically.
Very interesting.
I'd be interested in seeing what an alternative to latex based on S-expressions would look like.
I'm tempted to try and write it first as a scheme library; the end goal would be to have something more structured and closer to a programming language than latex, with a better content/styling separation…
Well Racket doesn't get more scheme like besides well Scheme :) Personally I find Racket to be my favorite Programming Language due to the Lisp and Schemeness.
Do you know how it relates to Skribilo (http://www.nongnu.org/skribilo)? I think that they are both derived from Skribe, but I got the impression that Scribble is more oriented towards documentation, whereas Skribilo is intended more as a general-purpose markup language. Maybe that distinction is specious. (I've been dying to try Skribilo as a properly programmable LaTeX alternative, but I can't manage to install it.)
If this interests you, there's also Sagetex [0]. Sagemath is a fully fledged computer algebra system based on Python; Sagetex is a Latex package that allows you to perform Sagemath computations and auto-generate Latex code while compiling the Latex document.
I don't think pylatex does what lax does i'm not sure though. Try getting latex output from pylatex for formulaes like x * 3 * y * (x/(x-y)). Lax goal is being handy for quickly writing down common math formulaes.
36 comments
[ 3.0 ms ] story [ 83.9 ms ] threadUnfortunately, I don't know anything that uses it besides Microsoft's formula editors (in various Office apps.)
[0] http://unicode.org/notes/tn28/
And even if, does the degree of the root not have to be inverted? I.e.:
[1] http://latex.codecogs.com/gif.latex?%5Cfrac%7B%5Csqrt%5B%5Cl...Their example:
http://docs.sympy.org/latest/tutorial/printing.html#latexhttp://asciimath.org/
Shameless plug... if you want to convert from AsciiMath to LaTeX here is something I've written (it's not beautiful and works only online, but it was a showcase only):
https://github.com/oerpub/mathconverter
https://github.com/iogf/vy
I believe some other editors like emacs/vim could integrate with it so people could easily ease the effort for writing some latex structures.
> Scribble is a collection of tools for creating prose documents—papers, books, library documentation, etc.—in HTML or PDF (via Latex) form. More generally, Scribble helps you write programs that are rich in textual content, whether the content is prose to be typeset or any other form of text to be generated programmatically.
https://docs.racket-lang.org/scribble/
0. http://doc.sagemath.org/html/en/tutorial/sagetex.html