Live data from Hacker News

Typst: An easy to learn alternative for LaTex

github.com

181–190 of 192 posts

Re: Typst: An easy to learn alternative for LaTex

#181

Can I use this to generate PDF invoices from PHP? I've been searching for a good solution for the past 15 years. Never been happy with the solutions, and my PDFs are always very ugly.

Used it in a recent PHP project, only real caveat/issue I ran into is you can't pipe out to STDOUT on windows: Wrapper class I wrote to handle it: https://gist.github.com/tehbeard/a54a2c77b4b8bf1af26920ce7a7... >

That's awesome, thanks!

I need to print big tables of data though, I remember hitting limits before when I've tried to pass too much as shell args.

Re: Typst: An easy to learn alternative for LaTex

#183

Earlier quoted context omitted.

Used it in a recent PHP project, only real caveat/issue I ran into is you can't pipe out to STDOUT on windows: Wrapper class I wrote to handle it: https://gist.github.com/tehbeard/a54a2c77b4b8bf1af26920ce7a7... >

That's awesome, thanks! I need to print big tables of data though, I remember hitting limits before when I've tried to pass too much as shell args.

Then a slower but similar simpel option could be to write your data to a json/csv/xml file and read it directly with Typst.

Re: Typst: An easy to learn alternative for LaTex

#184

Earlier quoted context omitted.

The curse of support. If you need something that will be supported for the next 20/30/50/100 years, you pick an already established product that is widely used and does not depend on any single organization. You can't rely on volunteer projects, as volunteers have no duty to maintain and support the product. And you can't rely on anything made by a single company, as companies lose interest and die all the time.

LaTeX's support is already problematic. Most people just don't use it in sufficient intensity to notice. We produce thousands of (mostly) custom written technical reports a year using LaTeX and there are all sorts of subtle issues cropping up. It's a distribution (edit: or at least texlive is) of many, many packages from many developers, and maintenance can be spotty and vary. Unlike some people would like to believe…

LaTeX has always been like that. Random packages have never worked together properly, and submitting the manuscript in the format the publisher requires has always been a struggle. It's often easier to reinvent the wheel than to use a third-party package for some functionality.

The way I learned it, the best practice of using LaTeX has always been based on whitelisting. When you create documents for yourself, you establish a list of packages that work well together and stick to it. And if you expect documents from others, you provide a document class and a list of supported packages.

But despite all these shortcomings, LaTeX is widely supported. Both in the technical sense and in the social sense. Journals and similar entities not only accept but often except LaTeX documents.

Re: Typst: An easy to learn alternative for LaTex

#185
post #72

Earlier quoted context omitted.

Yes, latex's HTML output is fairly good nowadays, after a lot of people made very heroic efforts to put it in a system never intended to support it. Starting a new markup system with no plan for making accessible documents was, in my opinion, a very bad idea. I refuse to use typst until it can produce accessible documents.

> Yes, latex's HTML output is fairly good nowadays, after a lot of people made very heroic efforts to put it in a system never intended to support it. Mind saying more? Didn't know there'd been progress here.

Might be worth mentioning that arXiv is doing mass conversion of TeX to HTML these days: https://info.arxiv.org/about/accessible_HTML.html

Re: Typst: An easy to learn alternative for LaTex

#186

Does this have support for macros? It doesn't appear to, and so feels a bit like another variant on markdown (with its own special syntax)? It's not clear to me why I'd use this, compared with RST (where I can generate LaTeX or HTML, and script with python)?

No, it has no macros, that is its greatest selling point. Instead you can use an embedded programming language which will look familiar to anyone who has some experience with software development to script it. Replacing TeX's abysmal macro expansion language with a reasonably normal programming language is one of the reasons you would use it. Look at the example on their GitHub to see how the language works in a docu…

I take it you don't write much maths then? Most of the macros I define are to make the process of writing maths faster, easier and more correct (common expressions become short macros, macros for specific semantics etc.), and the lack of amsmath-equivalent means that Typst loses out on a major part of its audience.

The "reasonably normal programming language" part is a turn-off for non-software-devs, and for software devs I'm not sure why I wouldn't generate LaTeX via something like jinja2, or directly create PDFs with reportlab.

Re: Typst: An easy to learn alternative for LaTex

#187

Earlier quoted context omitted.

I've done .doc -> .md -> .tex -> .pdf via pandoc (e.g. to convert a confluence document to a nicely typeset PDF), so I'm not sure there's much difference. Naturally, a format with more metadata loses metadata when converted to one with less (and the reverse, you may need to add metadata in when going up the chain), but unless your document is bound to a specific format (in which case, I'd pick RST for HTML and LaTeX…

Markdown doesn't give you a table of contents, an index, page breaks, control over typesetting, control over table layout, captioned figures, diagramming tools, etc. The difference is about the same magnitude as between Pong and Call of Duty. Yes they're both video games, sometimes one is preferable over the other, but they are not equivalent.

Exactly, and I need those features, I'd use LaTeX (and if collaboration is needed, either git or overleaf depending on who I'm working with). For a ~1 page document of text, where there is minimal markup required, markdown through pandoc produces a nicer looking document than using the output from web-based editors (e.g. google docs, confluence), which is typically where I'm starting with .doc.

Re: Typst: An easy to learn alternative for LaTex

#188

Having composed many pieces of coursework using Typst, I must say that it certainly makes academic writing more streamlined, engaging, and dare I say fun — though that might just be me. The functional nature of Typst's syntax ensures I don't have the erratic behaviour emblematic of modern day Microsoft Word and sometimes even Google Docs. Using a local IDE such as VSCode brings all the features one could like. In com…

As someone who almost never needs equations, does this have any benefits to me over using markdown?

What are you doing with Markdown? My own requirements for a format are:

* 30 year viability. * simple but explicit formatting: I need to specify font size, underline, and red text. * clarity in writing is almost as important as clarity in reading, so I am not fond of formatting directives mixed in with text.

That led me to RTF, since Markdown fails on the second and third point, and LaTeX fails on the last. But you have to determine your own requirements from your use case.

Re: Typst: An easy to learn alternative for LaTex

#189

I would love to replace latex but I only use it for making physical books and none of the replacements have the features needed...

Which features?

Generally things like front matter, footnotes, callouts, tables, figure captions, index entries, code formatting. I don't remember which of these Typst didn't support when I last checked it out.
Post reply on HN