Live data from Hacker News

Pandoc

pandoc.org

21–30 of 298 posts

Re: Pandoc

#21
post #7

I wrote pretty much all my university work in Markdown with inline Latex, using Pandoc to generate a pdf. I'm sure there are things you can do in "pure" latex that you can't do this way, but for most normal cases, it's so much easier. You just use the simple Markdown syntax for basic text formatting, and then can use the power of Latex when you need to display mathematics, graphs, tables or similar.

Me too :-) It was a steep learning curve but worth it. I used it 'within' VSC.

Re: Pandoc

#22

Every couple of years I need pandoc for some project. And teach time I relearn the same idiosyncrasies. Some odd defaults, the sometimes annoying depths you have to do to customize HTML templates, the weird filter infrastructure. What a neat strange program it is.

I have this same issue, and the same with `jq` and `GNU Parallel`.

When you need them you need them, and nothing else quite works, but I have to re-learn them every time.

Re: Pandoc

#24
post #4

As is generally the case, there are official docker images readily available and it's a fantastically light, low-coupling way of adding conversion to a stack. Recently rewrote a content stack to use Markdown (among other formats) for the source, the file system as the database, generating outputs (including HTML with embedded Mathjax LATEX) via pandoc, and it works absolutely brilliantly. Fully recommend.

Why do you use the docker image instead of just the normal executable?

I'd reckon it's partly habit, but it is a very nice way of "installing" something easily and being able to also very easily _uninstall_ it without leaving any cruft behind, as well as having completely disparate multiple versions of things, if you need that.

For single-file binaries this is less of an issue, but even those sometimes require dependencies that you already have something else that needs a different version of that same dependency causing conflict.

Re: Pandoc

#25
post #13

I tried to use it to make an invoice system: wanted to convert plain-text CSV (description,amount,cost) --> to Markdown tables --> to PDF. But I was unable to align the following 2nd table with taxes: cells are all over the place and it does whatever it wants. And there is no information online to be found about it. (I eventually gave up long time ago and still to this day manually do them in LibreOffice Writer addin…

Maybe you could use html as an intermediate point instead of markdown. Might give you more control over the layout. Might have to use a headless chromium wrapper (maybe pandoc has this anyway) to then get to pdf but that may not be too bad

I was thinking the same thing: I would use HTML as an intermediate, targeting PDF through weasyprint.

In fact I quite often go .md -> .html with pandoc, but write the .md in such a way that, when translated, it is the kind of html that weasyprint will be able to turn into the PDF that I want.

Re: Pandoc

#26
The only issue I have with pandoc is the dependency hell it requires. It requires a lot of haskell dependencies and just eats up your storage space.

Re: Pandoc

#27

This is one of the most useful programs that I use. I use it for turning .md files into .html or .pdf. I use it for creating slides with it. I even use it for fixing the hard-wrapped text I write in vim before sending emails. When I write in vim, I prefer the text to be hard-wrapped, but for emails, I like it better when the text is not wrapped. I recommend arp242's essay explaining the problem with hard-wrapping [1]…

Interesting. And how do you send and read emails? Mutt?

Re: Pandoc

#28
I use pandoc with some Make scripts to generate the epub of my novels and short stories. Having a reproducible way to iterate from source to final docs during edits and correction passes is amazing. I can't imagine doing it any other way.

Re: Pandoc

#29
I use it to generate PDF/EPUB versions from GitHub style markdown for my ebooks. The default output was good enough, but I wanted to customize a few things [0]. I didn't know LaTeX, but I was able to use solutions from stackoverflow sites. Later I found that some users had created templates I could've borrowed.

I use mdBook [1] for web versions though. I found the default setup much easier to use. And it came with themes (light/dark/etc) that readers can choose.

[0] https://learnbyexample.github.io/customizing-pandoc/

[1] https://github.com/rust-lang/mdBook

Re: Pandoc

#30

Pandoc is one of my favourite all time tools. As the website says: > If you need to convert files from one markup format into another, pandoc is your swiss-army knife It also sits at the heart of Quarto[0], which adds Jupyter-like code execution (in R, Python and others) into document production. Combined with RStudio as an IDE, it's my new favourite way to write anything - from static documents to full on code noteb…

Codebraid[0] is another option for integrating code execution with Pandoc. I find myself using Quarto for building sites and Codebraid more for single documents. Both great tools building on Pandoc.

--

[0]: https://codebraid.org/

Post reply on HN