TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

From Word to Markdown to InDesign: Fully Automated Typesetting Using Pandoc

114 pointsby rhythmvsover 9 years ago

11 comments

Animatsover 9 years ago
Well, yes, if you dumb your document down to the level of &quot;markdown&quot;, it&#x27;s not hard to grind them out as plain text with some styling. You can write HTML in that style, too. People did that 20 years ago.[1] That was the original vision of HTML.<p>Some people wanted to stop there, and limit HTML to describing the semantics of a document, not its visual appearance. They lost.[2]<p>Pandoc doesn&#x27;t really use &quot;markdown&quot;. It uses &quot;enhanced markdown&quot;:<p><i>&quot;Pandoc’s enhanced version of Markdown includes syntax for footnotes, tables, flexible ordered lists, definition lists, fenced code blocks, superscripts and subscripts, strikeout, metadata blocks, automatic tables of contents, embedded LaTeX math, citations, and Markdown inside HTML block elements.&quot;</i><p>Pandoc&#x27;s &quot;markdown&quot; now has roughly the feature set of HTML 3.<p>[1] <a href="http:&#x2F;&#x2F;www.animats.com&#x2F;papers&#x2F;articulated&#x2F;articulated.html" rel="nofollow">http:&#x2F;&#x2F;www.animats.com&#x2F;papers&#x2F;articulated&#x2F;articulated.html</a> [2] <a href="http:&#x2F;&#x2F;www.w3.org&#x2F;People&#x2F;Raggett&#x2F;book4&#x2F;ch02.html" rel="nofollow">http:&#x2F;&#x2F;www.w3.org&#x2F;People&#x2F;Raggett&#x2F;book4&#x2F;ch02.html</a>
评论 #10666398 未加载
评论 #10666330 未加载
评论 #10666463 未加载
评论 #10666876 未加载
rubidiumover 9 years ago
So 30% of my current job is writing technical user guides for large, custom, automated research systems (the rest is design and development of those systems).<p>Each one is slightly different, and so needs its own guide. We currently are stuck using Word b&#x2F;c it&#x27;s so fast. Yes it&#x27;s ugly. Yes it&#x27;s a pain to work with sometimes. But I haven&#x27;t found anything that&#x27;s faster to produce these docs with.<p>The reason we haven&#x27;t switched to html, latex, or xml etc... is because I haven&#x27;t found a typesetting program that is as easy to drag and drop images into and out of. Each guide has 30+ images on average. I _need_ that interface to be drag and drop otherwise it&#x27;s too tedious to write the guide. The formatting of the text I&#x27;d love to do in some sort of markup language, but the images have to be dead simple.<p>Short version: Anyone know of a typsetting solution with some markup language, version control, print to PDF happen at click of a button, and drag and drop images?
评论 #10667295 未加载
评论 #10667100 未加载
评论 #10668055 未加载
评论 #10667081 未加载
评论 #10668653 未加载
joluxover 9 years ago
Is Markdown really &quot;relatively new?&quot; According to Wikipedia, it&#x27;s older than OOXML, aka .docx .xlsx .pptx etc.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Markdown" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Markdown</a> <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Office_Open_XML" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Office_Open_XML</a>
评论 #10666140 未加载
评论 #10666130 未加载
shortformblogover 9 years ago
From the perspective of someone with experience working in the print industry: This is impressive work, and you nail down the biggest issue with Word—if you don&#x27;t use pure style sheets, you get cruddy code. (Google Docs has this problem, too.)<p>I think that lots of folks are trying to find different ways to solve this problem in the print world, especially as stories have to be pulled into CMSes as well.<p>Personally, I&#x27;d be curious if it&#x27;d be possible to cull copy from a InDesign file to convert into Markdown, complete with links to images used in the document that could then be edited.
katabasisover 9 years ago
It&#x27;s great to see others in the publishing world moving away from proprietary software like Word and towards plain-text based processes. As the author points out there are many benefits of this.<p>Here&#x27;s something to consider: you&#x27;ve ditched MS Word, maybe you can ditch InDesign too? In my experience once content goes into an Adobe program, it&#x27;s hard to get it out again in a clean way. It&#x27;s pretty impressive what you can accomplish using CSS3 for print layout[1].<p>I work at an academic publisher, and I&#x27;ve spent much of the last year preaching the benefits of a similar workflow. Some of the editors are now editing manuscripts in Markdown files directly. Currently we&#x27;re building a system where a single set of text files get fed into a program like a static website generator. This produces a web version, but also PDF, ePUB, etc. automatically. We&#x27;re getting pretty close[2]. I think this is the future for many forms of publishing.<p>I think one of the big remaining pieces of the puzzle is creating a better Markdown editor, something suited for the needs of scholars &amp; academics with support for things like footnotes, bibliographies, etc, while remaining a plain-text format.<p>[1] <a href="http:&#x2F;&#x2F;alistapart.com&#x2F;article&#x2F;building-books-with-css3" rel="nofollow">http:&#x2F;&#x2F;alistapart.com&#x2F;article&#x2F;building-books-with-css3</a> [2] <a href="http:&#x2F;&#x2F;egardner.github.io&#x2F;posts&#x2F;2015&#x2F;building-books-with-middleman&#x2F;" rel="nofollow">http:&#x2F;&#x2F;egardner.github.io&#x2F;posts&#x2F;2015&#x2F;building-books-with-mid...</a>
zyxleyover 9 years ago
Unlinked footnotes in a webpage?<p>With all that unused margin space on a desktop, it seems like they would have made more sense as Tufte-style marginal notes anyway.
评论 #10665996 未加载
akavelover 9 years ago
@rhytmvs Have you considered using SILE [1][2] instead of LaTeX (and maybe even InDesign)? (I&#x27;m not affiliated, but I believe it may become a worthy successor to TeX in future.)<p>[1]: <a href="http:&#x2F;&#x2F;video.fosdem.org&#x2F;2015&#x2F;main_track-typesetting&#x2F;introducing_sile__CAM_ONLY.mp4" rel="nofollow">http:&#x2F;&#x2F;video.fosdem.org&#x2F;2015&#x2F;main_track-typesetting&#x2F;introduc...</a><p>[2]: <a href="https:&#x2F;&#x2F;archive.fosdem.org&#x2F;2015&#x2F;schedule&#x2F;event&#x2F;introducing_sile&#x2F;attachments&#x2F;slides&#x2F;772&#x2F;export&#x2F;events&#x2F;attachments&#x2F;introducing_sile&#x2F;slides&#x2F;772&#x2F;sile.pdf" rel="nofollow">https:&#x2F;&#x2F;archive.fosdem.org&#x2F;2015&#x2F;schedule&#x2F;event&#x2F;introducing_s...</a>
cossatotover 9 years ago
Will it work with equations? A major peeve of mine is trying to get Tex to deal with figures in a better manner, especially in space-limited situations (e.g. grant proposals), and I used to use InDesign for that before my work got too mathy.
评论 #10668842 未加载
pjstewover 9 years ago
I&#x27;ve been looking into the same problem for a while, and came to exact same solution a few weeks ago, coincidently. I haven&#x27;t actually got round to completing all the code for it, but have tested each section. I was delighted when I spotted your article this morning, but was hoping you would have also shared your code... No git repository? I&#x27;m sure I can make the whole system myself, but I&#x27;m always happy to use others work if it exists. If you do have a working version of this process, please do share it!
pessimizerover 9 years ago
I prefer asciidoc: <a href="http:&#x2F;&#x2F;powerman.name&#x2F;doc&#x2F;asciidoc" rel="nofollow">http:&#x2F;&#x2F;powerman.name&#x2F;doc&#x2F;asciidoc</a> <a href="http:&#x2F;&#x2F;asciidoctor.org&#x2F;docs&#x2F;what-is-asciidoc&#x2F;" rel="nofollow">http:&#x2F;&#x2F;asciidoctor.org&#x2F;docs&#x2F;what-is-asciidoc&#x2F;</a>
todd8over 9 years ago
I&#x27;m really looking forward to the evolution of Markdown, but it will not be a complete replacement for TeX (for many years). TeX is designed around a powerful (macro based) programming system. This is an excerpt from a comment that I posted on HN a while back that is apropos this discussion:<p>TeX&#x27;s macro style of programming is too difficult. Nevertheless, people have done amazing things with it.<p>TeX has somewhere around 325 primatives, and one of the most important is the \def primative used to define macros. These primatives are used to define additional macros, hundreds of them, available in different so called formats. A basic format known as Plain TeX includes about 600 macros in addition to the 325 primatives. LaTeX is another format, the most widely used, but there are others, like ConTeXt, that are also very capable. Each of these extend TeX&#x27;s primatives with their own macros resulting in different kinds of markup language. TeX&#x27;s primatives are focused on the low level aspects of typesetting (font sizes, text positions, alignment, etc.). LaTeX provides a markup language that is focused on the logical description of the document&#x27;s components: headings, chapters, itemized lists, and so forth. The result is a system that does simple things easily while allowing very complex typesetting to be performed when needed.<p>In addition to the TeX core primatives and the hundreds of commands (implemented as macros) in a format like LaTeX there are additional packages, classes, and styles that are used to provide support for any conceivable document. LaTeX has a rich ecosystem of packages. Typesetting chess? There&#x27;s a LaTeX package for that. Complex diagrams and graphics, there&#x27;s a LaTeX package for that. Writing a paper in the style of Tufte? Writing a book? or a musical score? or building a barcode? there are packages for that. The <i>documentation</i> for the Tikz &amp; PGF graphics package is over 1100 pages long! The documentation for the Memoir package is 570 pages.<p>The amazing thing is that all of this is built out of macros. Diving into this, and once one needs to customize the look of a document it&#x27;s inevitable, you find yourself in a maze of twisty little passages. Once upon a time, while writing assembly language for large computers, I enjoyed writing fancy assembler macros. I was facinated with Calvin Moore&#x27;s Trac programming language based on macros and Christopher Strachey&#x27;s General Purpose Macrogenerator. These were early (mid 1960&#x27;s) explorations into the viability of macro processors as means for expressing arbitrary computations. Reader&#x27;s interested in trying out macros for programming can try the m4 programming language (by Kernighan and Ritchie) found on Unix and Linux systems. m4 is used in autoconf and sendmail config files. Yet, TeX macros are in a whole other dimension. All of these powerful macro systems have one thing in common: parameterized macros can be expanded into text that is then rescanned looking for newly formed macros calls (or new macro definitions) to expand as many times as one wants. This isn&#x27;t just an occasional leaky abstraction; it is programming by way of leaky abstractions. Looking at TeX packages is some of the most difficult programming that I&#x27;ve done. It&#x27;s unbelievably impressive what people have come up with (e.g. floating point implemented via macro expansion in about 600 lines of TeX), but it&#x27;s also unbelievably frustrating to program in such an environment. The LaTeX3 project is an attempt to rewrite LaTeX (still running on top of the TeX core). Started in the early 1990&#x27;s it is still not done. I think its just that they are mired in a swamp of macros. They do have a relatively stable set of macros written, with the catchy name expl3, that are intended for use when writing LaTeX3. Here&#x27;s a sample<p><pre><code> \cs_gset_eq:cc { \cf@encoding \token_to_str:N #1 } { ? \token_to_str:N #1 } </code></pre> This is described in the documentation as being a big improvement over the old macros and &quot;far more readable and more likely to be correct first time&quot;. I can&#x27;t wait.<p>I think LaTeX is absolutely without peer, but I wish improving it&#x27;s programming method wasn&#x27;t so daunting. I keep toying with starting a project to do just that, but so many others have tried and failed. It&#x27;s disheartening.<p>Links:<p>[TRAC] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;TRAC_(programming_language)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;TRAC_(programming_language)</a><p>[GPM] <a href="http:&#x2F;&#x2F;comjnl.oxfordjournals.org&#x2F;content&#x2F;8&#x2F;3&#x2F;225.full.pdf" rel="nofollow">http:&#x2F;&#x2F;comjnl.oxfordjournals.org&#x2F;content&#x2F;8&#x2F;3&#x2F;225.full.pdf</a><p>[m4] info pages available on Unix and Linux<p>[Tikz &amp; PGF] <a href="https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;pgf?lang=en" rel="nofollow">https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;pgf?lang=en</a><p>[Memoir] <a href="https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;memoir?lang=en" rel="nofollow">https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;memoir?lang=en</a><p>[expl3] <a href="https:&#x2F;&#x2F;www.tug.org&#x2F;TUGboat&#x2F;tb30-1&#x2F;tb94wright-latex3.pdf" rel="nofollow">https:&#x2F;&#x2F;www.tug.org&#x2F;TUGboat&#x2F;tb30-1&#x2F;tb94wright-latex3.pdf</a>
评论 #10668477 未加载