due to the nature of PDF, none of the tools mentioned here can do things as simple as detecting tables on pages with high accuracy

PDF is absolutely mint for display but it really suffers when parsing is involved

Yeah, I've been expecting someone to work up a system where:

- source file is .md

- file is compiled to .pdf _and_ the .md source file is included as an attachment

- when working with the file beyond viewing as a .pdf the .md is extracted and used instead of the .pdf

The LaTeX folks have a similar system ages ago where the .tex source would be included in a .pdf made from a .tex file for embedding in documents so that it could be sent in say an e-mail and then edited by the recipient --- absolutely awesome for discussing math via e-mail.

That's a good concept but I don't think Markdown is expressive enough for all the layouts & formatting that people typically want in PDFs. More likely that the source format would be something like HTML or SVG or .docx.

Restructured text has mostly 1:1 correspondence with Docbook. I use an XSLT transform to convert its XML schema into Docbook and PDF from there via XSL-FO.