Live data from Hacker News

Pandoc

pandoc.org

31–40 of 298 posts

Re: Pandoc

#31

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…

I tried something like that but ended up going with markdown -> html -> puppeteer to generate an A4 pdf -> ghostscript to compress it.

It’s an ugly script that’s been working quite well for more than a decade, but I wouldn’t recommend it to anyone other than myself.

Re: Pandoc

#32
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?

A better question is why wouldn't I use the docker image? The docker image is an official work output of the project, handles all dependencies without messing up my target machines (I use the pandoc/extra which includes pretty much every ancillary need such as Latex), and is trivial to keep up to date and current holistically. It is by default isolated and controlled to a degree, and allows me to trivially tape together as necessary.

The other comment nailed it pretty well, though they hedged it by citing habit (presumably to counter the weird anti-docker trend that has arisen). Dockerizing (or simply containerizing) most vendored products is a choice that is often beneficial, and the marginal overhead is a rounding error.

Re: Pandoc

#34
Pandoc saved my ass so many times when I worked in research. I would write a beautiful typeset paper in latex and then have to send a colleague a word doc.

You can turn any file into anything. PDF to rtf, latex to .doc, etc. It does a great job. Written in Haskell, too!

Re: Pandoc

#35

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]…

I'll probably lose some nerd cred: I do most of my writing in MS word, I find it easier to cut and paste and add footnotes and section headers. And then I use Pandoc to convert the docx into the format I want, usually HTML*. I used to do markdown in vim but I found that for most of what I do I prefer word. I do write code in vim...

* I use this css file when converting: https://gist.github.com/killercup/5917178

Re: Pandoc

#36

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…

I tried something like that but ended up going with markdown -> html -> puppeteer to generate an A4 pdf -> ghostscript to compress it. It’s an ugly script that’s been working quite well for more than a decade, but I wouldn’t recommend it to anyone other than myself.

I have a very similar homegrown mess. I wonder how many of us there are doing the same thing for this use case.

Re: Pandoc

#37
This is what I used to typeset my novel. My editor and publisher tried multiple methods and they kept being impressed by how clean and "just right" the versions I sent them were... In the end, we ended up using the PDFs generated by Pandoc instead of InDesign or whatever proprietary stuff they used.

Re: Pandoc

#38

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.

Set a huge number for your shell history and dedup. You’ll effectively save every command you ever typed in chronological order. You can even append comments to the end of the command for your future self.

Then, fzf your history.

Re: Pandoc

#39
Pandora is awesome. Add a self published author, this is a key tool in my tickets to have a single source of truth and (relatively) easily create beautiful PDFs and EPUBs.

I previously used restructured text and had to write custom tooling, but now I can write markdown on Jupyter.

Re: Pandoc

#40

Earlier quoted context omitted.

I tried something like that but ended up going with markdown -> html -> puppeteer to generate an A4 pdf -> ghostscript to compress it. It’s an ugly script that’s been working quite well for more than a decade, but I wouldn’t recommend it to anyone other than myself.

I have a very similar homegrown mess. I wonder how many of us there are doing the same thing for this use case.

By looking at this thread, quite a few. The problem is creating a solution that would fit all of our idiosyncrasies.

For example, in my code, if a table has the class “total” it sums all s which contains a dollar sign, and so on.

Post reply on HN