Show HN: Lax – Write Python to output LaTeX
github.com
github.com
def section(name='Abstract'):
print('We present a novel new way...')
fig(path='my.png', width='90%')
Anyway, still a cool project! I might make use of this in the future. Just remarking that the title hints at something else -- at least to me. with doc.create(Section('A section')):
doc.append('Some regular text and some ')
doc.append(italic('italic text. '))
https://github.com/JelteF/PyLaTeX tau@eletron:~$ lax -c '((x-1) ** ((x-1)/(x+2)))/(y-z+k-e+w)'
\frac{\sqrt[\left(\frac{x-1}{x+2}\right)]{\left(x-1\right)}}{y-z+k-e+w}
That does not make sense to me. Why do you use a root here? A root with that long of a degree just looks weird to me [1].And even if, does the degree of the root not have to be inverted? I.e.:
x**(y/z) == \sqrt[z/y]{x}
[1] http://latex.codecogs.com/gif.latex?%5Cfrac%7B%5Csqrt%5B%5Cl... $ lax -c 'x ** 2'
\sqrt[2]{x}
While the output should be: x^2.
If you wanted to use sqrt, it would have to be: \sqrt[\frac{1}{2}]{x}> 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.
I believe some other editors like emacs/vim could integrate with it so people could easily ease the effort for writing some latex structures.
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):
Their example:
>>> print(latex(Integral(sqrt(1/x), x)))
\int \sqrt{\frac{1}{x}}\, dx
http://docs.sympy.org/latest/tutorial/printing.html#latexUnfortunately, I don't know anything that uses it besides Microsoft's formula editors (in various Office apps.)