[{"data":1,"prerenderedAt":312},["ShallowReactive",2],{"project-14592728":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":27,"sentiment":28,"stance_mix":29,"scored_comments":33,"aspects":34,"strip":40,"post_text":42,"what":43,"said":71,"maker_in_thread":170,"shape":177,"grid":181,"attempts":263,"same_week":274,"maker_shows":224,"maker_hidden":304,"reader_version":305,"card":306},"14592728","Lax","Write Python to output LaTeX","title","Show HN: Lax – Write Python to output LaTeX","https:\u002F\u002Fgithub.com\u002Fiogf\u002Flax","github.com","iogf",1497942861,2017,74,34,601,2242,27,"notable","dev_tools","latex generator","cli",[24,25,26,21],"latex","python","math formula","roasted",-0.545,{"positive":30,"neutral":31,"mixed":31,"critical":32},0,1,9,11,{"idea":35,"execution":37,"docs":39},{"positive":30,"critical":36},6,{"positive":30,"critical":38},2,{"positive":30,"critical":31},[41,30,30,30,30,31,30,31,30,30,30,30,30,30,30,30,31,30,30,30,30,30,30,30,30,41,30,31,31,31,31,31,31,30],3,null,{"problem":44,"audience":42,"pricing":42,"motivation":54,"time_to_build":42,"stack":62,"openness":69,"stage":70,"team_size":70},{"value":45,"source":46,"evidence":47},"Writing LaTeX math formulas by hand is tedious","inferred",[48,51],{"id":49,"by":11,"text":50},"14593175","The main idea consists of implementing sort of a \"latex-like\" templating system using python. Lax goal is similar to what markdown is for html.",{"id":52,"by":11,"text":53},"14593279","My next plan is extending Lax with a basic set of latex structures and integrating with vy. (This was one of the goals behind Lax) https:\u002F\u002Fgithub.com\u002Fiogf\u002Fvy I believe some other…",{"value":55,"source":56,"evidence":57},"Quickly writing common math formulas; a LaTeX-like templating system akin to markdown for HTML","maker",[58,59],{"id":49,"by":11,"text":50},{"id":60,"by":11,"text":61},"14594888","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\u002F(x-y)). Lax goal is being handy for quickly…",[63],{"value":64,"source":56,"evidence":65},"Python",[66,68],{"id":67},"post",{"id":49,"by":11,"text":50},"open_source","unknown",{"praise":72,"objections":81,"requests":108,"questions":119,"alternatives":127},[73],{"value":74,"source":75,"evidence":76},"Cool project, may use it in the future","commenter",[77],{"id":78,"by":79,"text":80},"14593400","lucb1e","The title suggests you can write Python and get LaTeX, but it's \"converting ordinary expressions into mathTeX\". I was expecting something like this: ``` def…",[82,90,101],{"value":83,"source":75,"evidence":84},"Title suggests writing Python to produce full documents, but it only converts expressions to math LaTeX",[85,86],{"id":78,"by":79,"text":80},{"id":87,"by":88,"text":89},"14594626","stared","Title should be more like \"convert fractions to LaTeX using Python\". Otherwise it's misleading\u002Foveradvertising.",{"value":91,"source":75,"evidence":92},"Output for powers is wrong: x ** 2 becomes a square root",[93,97],{"id":94,"by":95,"text":96},"14592999","adsche","Interesting. Quick question though: ``` tau@eletron:~$ lax -c '((x-1) ** ((x-1)\u002F(x+2)))\u002F(y-z+k-e+w)' \\frac{\\sqrt[\\left(\\frac{x-1}{x+2}\\right)]{\\left(x-1\\right)}}{y-z+k-e+w} ```…",{"id":98,"by":99,"text":100},"14593234","S4M","A simpler example: ``` $ 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} ```",{"value":102,"source":75,"evidence":103},"Unclear why the project exists",[104],{"id":105,"by":106,"text":107},"14592902","isatty","why tho",[109,115],{"value":110,"source":56,"evidence":111},"Support x^2 power notation",[112],{"id":113,"by":11,"text":114},"14593620","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…",{"value":116,"source":56,"evidence":117},"Integration with vy editor and emacs\u002Fvim support",[118],{"id":52,"by":11,"text":53},[120],{"value":121,"source":75,"evidence":122},"How does it handle variables only known at run time?",[123],{"id":124,"by":125,"text":126},"14592918","amelius","I wonder how it deals with code that depends on variables that are known only at run time.",[128,139,146,156,163],{"value":129,"source":75,"evidence":130},"PyLaTeX",[131,135],{"id":132,"by":133,"text":134},"14593089","edwinksl","Related: https:\u002F\u002Fgithub.com\u002FJelteF\u002FPyLaTeX, which is a \"Python library for creating LaTeX files\".",{"id":136,"by":137,"text":138},"14594528","Rick_Sullivan","PyLaTeX does that: ``` with doc.create(Section('A section')): doc.append('Some regular text and some ') doc.append(italic('italic text. ')) ``` https:\u002F\u002Fgithub.com\u002FJelteF\u002FPyLaTeX",{"value":140,"source":75,"evidence":141},"SymPy latex printer",[142],{"id":143,"by":144,"text":145},"14593192","jmmcd","I think Sympy's latex solution is probably more complete, but of course it requires a bigger install (but Sympy is already in Anaconda). Their example: ``` >>>…",{"value":147,"source":75,"evidence":148},"AsciiMath",[149,153],{"id":150,"by":151,"text":152},"14593216","therealmarv","This \"pythonic\" way looks for me like AsciiMath http:\u002F\u002Fasciimath.org\u002F Shameless plug... if you want to convert from AsciiMath to LaTeX here is something I've written (it's not…",{"id":154,"by":151,"text":155},"14593247","you should check out AsciiMath ... http:\u002F\u002Fasciimath.org It's one of the easiest ways of writing math and already pretty complete.",{"value":157,"source":75,"evidence":158},"Scribble (Racket)",[159],{"id":160,"by":161,"text":162},"14593454","baldfat","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,…",{"value":164,"source":75,"evidence":165},"SageTeX",[166],{"id":167,"by":168,"text":169},"14594163","n4r9","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…",{"comments":36,"answered":31,"key":171},[172,175,176],{"id":173,"text":174},"14593152","I'm not sure i have fully understood your question, could you rephrase?",{"id":113,"text":114},{"id":52,"text":53},{"commenters":18,"max_depth":178,"maker_replies":36,"first_comment_mins":179,"lifespan_hours":180},5,58,32,[182,184,188,192,195,196,198,200,201,203,207,208,211,213,216,218,220,222,223,225,227,230,233,236,239,240,243,244,246,248,251,254,257,260],[78,30,41,183,79,30],"project\u002Fmixed\u002Fidea",[185,30,30,186,187,30],"14593502","other\u002Fneutral\u002Fidea","cyphar",[189,30,30,190,191,30],"14594524","other\u002Fneutral\u002Fnone","thearn4",[193,30,30,190,194,30],"14595669","joshuamorton",[136,30,30,186,137,30],[94,31,31,197,95,30],"project\u002Fcritical\u002Fexecution",[173,31,30,199,11,31],"maker\u002Fneutral\u002Fnone",[98,31,31,197,99,30],[113,31,30,202,11,31],"maker\u002Fneutral\u002Fexecution",[204,31,30,205,206,30],"14594319","commenter\u002Fcritical\u002Fdesign","maxerickson",[160,38,30,186,161,30],[209,38,30,186,210,30],"14596319","cedex12",[212,38,30,190,161,30],"14599828",[214,38,30,190,215,30],"14604359","JadeNB",[52,41,30,217,11,31],"project\u002Fneutral\u002Fidea",[150,219,30,186,151,30],4,[87,178,31,221,88,30],"project\u002Fcritical\u002Fdocs",[132,36,30,186,133,30],[167,224,30,186,168,30],7,[143,226,30,186,144,30],8,[228,226,30,229,11,31],"14593254","maker\u002Fneutral\u002Fidea",[231,226,30,190,232,30],"14593361","jakeogh",[234,226,30,190,235,30],"14595359","williamstein",[237,32,30,186,238,30],"14594811","denfromufa",[60,32,30,229,11,31],[124,241,41,242,125,30],10,"project\u002Fneutral\u002Fexecution",[49,33,30,229,11,31],[154,33,31,245,151,30],"project\u002Fcritical\u002Fidea",[105,247,31,245,106,30],12,[249,247,31,245,250,30],"14593028","techdragon",[252,247,31,245,253,30],"14593271","majewsky",[255,247,31,245,256,30],"14594290","shawnz",[258,247,31,245,259,30],"14596946","posterboy",[261,247,30,190,262,30],"14597016","dragonwriter",[264,265,268,271],{"id":4,"t":12,"points":14,"comments":15},{"id":266,"t":267,"points":247,"comments":36},"18401859",1541620650,{"id":269,"t":270,"points":224,"comments":30},"19823942",1556936690,{"id":272,"t":273,"points":38,"comments":30},"22766240",1585886747,[275,280,285,290,295,300],{"id":276,"name":277,"points":278,"category":279},"14558582","Snips",372,"ai",{"id":281,"name":282,"points":283,"category":284},"14583882","Decaffeinate",361,"languages",{"id":286,"name":287,"points":288,"category":289},"14587669","rust-algorithms",320,"learning_science",{"id":291,"name":292,"points":293,"category":294},"14593906","Copyfish",292,"productivity",{"id":296,"name":297,"points":298,"category":299},"14597485","NBox",286,"security_privacy",{"id":301,"name":302,"points":303,"category":284},"14588333","html5-parser",169,false,"v2",{"id":307,"name":5,"line":6,"ai":304,"cat":20,"year":13,"points":14,"comments":15,"rec":27,"s":308,"top":18,"kw":309,"maker":11,"domain":10,"tier":19,"attempts":219,"strip":310,"url":9,"mix":311,"praise":74,"objection":83,"sub":21},14592728,-0.55,[24,25,26,21],"3000010100000000100000000301111110",[30,31,31,32],1794036556484]