Live data from Hacker News

Pandoc

pandoc.org

251–260 of 298 posts

Re: Pandoc

#251
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.

I do something similar for my notes, but instead converting to HTML! (e.g. https://cswartout.com/notes/cse422.html) I keep my notes as markdown in a repo, then "build" them onto a web server after pushing. I've found it easy to write and always accessible, which is nice.

Re: Pandoc

#252

A question to experienced Pandoc users: I want to write a small book that I want to generate in 3 formats: HTML pages, EPUB and PDF. What is the best input format (source format) for the book? Pandoc Markdown? CommonMark? GFM? I'm a little hesitant to committing myself to Pandoc Markdown or any Markdown because they all have tiny differences with each other. Each is like its own standard. I considered Org-mode for so…

I use LateX mostly but if it's not a very complex document I'd say markdown wins for simplicity.

Re: Pandoc

#253
You can use Markdown with pandoc to make a pdf akin to the LaTex ones. For simple stuff, it was nice.

Re: Pandoc

#255

Earlier quoted context omitted.

Most tech people who use Word know how to use it and that is exactly the problem. We don't have the benefit of ignorance. We send off drafts to someone for commenting or editing and get an inconsistently formatted mess back because others don't even know that styles exist and use manual / direct formatting instead. We are the ones that have to suffer because people we are forced to collaborate with do not take 5 minu…

Is there a way to lock documents in some way, so that direct formatting is disallowed and only styles work? Not that we could truly lock a document, but at least having some sort of header that lists allowed features, such that one would get a warning whenever they veered off course?

Yes. Protect document and then select limit formatting to a selection of styles. Can’t remember the exact name of the checkbox.

Re: Pandoc

#256
Quite honestly the most valuable tool I'd learned in the 2010s (having been a significant Unix / Linux user since the 1980s).

In the late 1990s / early aughts, I'd written a toolchain to generate multiple document formats from a source based on HTML fragments. With Pandoc (and usually Markdown, occasionally LaTeX), I've discarded all of that, and have greater utility (more outputs, and FWIW, more input formats as well if I choose those).

Re: Pandoc

#257
post #66

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 probably use it every day, without noticing, to view markdown docs in a terminal, via a `.lessfilter` invoking [my fork of] https://github.com/Orange-OpenSource/pandoc-terminal-writer I also very much like Pandoc-markdown's ‘simple table’ syntax, because it's actually human-readable and human-writable without confusion and pain.

less filters are another highly underappreciated tool.

Back in the day there were a couple of utilities (I think they were "catdoc" and "wordview") which could take MS Word input and generate text-only output. Good for reading MS Word attachments in mutt or from a terminal / console / SSH session.

Re: Pandoc

#258

Earlier quoted context omitted.

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

I used to use Mutt, but now I don't because my email has its own special domain, and the email hosting service I use doesn't let me export IMAP and POP3 details unless I pay them. Currently, I just open vim in the terminal, write what I need, then copy the text. I open dmenu using a shortcut, type something like "unwr", which is sufficient for selecting the "unwrap-clipboard" script of mine, press enter, which unwrap…

You might find the "edit in vim" extension useful.

I've got it installed on MacOS and Linux, occasionally use it for longer HN comments.

The extension automatically invokes a vim session with the contents of your current browser edit window, and reads back in the output of your vim session when you're done with it.

https://addons.mozilla.org/en-US/firefox/addon/edit-with-vim...>

Re: Pandoc

#259

Earlier quoted context omitted.

> I had a script that piped to curl to send, Mail.app for downloading via POP and Vim to read/write Wow, this is very interesting, and I might even try it at some point. It might have been a bit challenging to sync and read the emails though, but the sending part seems nice. Was the reason for why you gave up related to syninc emails?

I liked that Mail.app stored every message as a single separate file, instead of the mbox that Thunderbird and others did. But at some version they started saving a hash with a multiple folder structure and that broke the setup. I had a few issues with MIME encoding as well, which were probably my fault. It was too much work and I eventually gave up, but if I find the will to do it again, I'd choose a simple POP down…

FYI, the maildir format (usable with mutt and numerous other email clients) also saves each email message as an individual file, and avoids mbox's notorious quoting issue.

https://en.wikipedia.org/wiki/Maildir>

Re: Pandoc

#260
post #165

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

In Vim, J on a selected paragraph does this job.

The usual challenge (and what OP said ... somewhere in this thread IIRC) is that that can be tedious to invoke on long (many paragraphs) documents.

There are recipies which will reflow paragraphs to the end of a document (or a given mark), but here one of the issues is text which shouldn't be reflowed, say, Markdown syntax for tables, lists, possibly blockquotes, code blocks, and the like.

My preferred solution is to write either single-sentence-per-line (rarely) or flowed text in vim using:

  :set tw=0 linebreak nolist wrap
Latter lets me just type paragraphs without breaking lines. Vim will flow those in the edit buffer. Other tools which can't handle hard linebreaks are much happier.
Post reply on HN