News for hackers. Stuff that matters.
Re:Pandoc by Schiphol on Monday August 27, 2018 @07:35PM (#17855414)
I do all of my academic writing in pandoc. As compared to LaTeX this means no boilerplate (yet you can still use full LaTeX syntax for equations and the like) and, if the publisher 'needs' a Word file, you are one click away from providing it. All with plain text files that you can put under version control, get meaningful diffs, etc. It's just great.
Re:Pandoc by icc97 on Monday August 27, 2018 @08:34PM (#17855719)
Sorry to be pedantic - but I didn't think that 'pandoc' was an actual document format purely a tool for converting between formats. Do you mean that you do your writing in kind of a 'pandoc flavoured' markdown? [0]

[0]: https://pandoc.org/MANUAL.html#pandocs-markdown

Re:Pandoc by mort96 on Tuesday August 28, 2018 @03:23AM (#17857086)
Well, between Pandoc's markdown flavor and how it has its own way of letting you insert latex code anywhere, you're not going to be able to process your document using anything that's not trying to be compatible with pandoc documents.
Re:Pandoc by smohare on Monday August 27, 2018 @10:25PM (#17856184)
I’ve never understood the impetus for not using full LaTeX in an academic contex, given that the boiler plate is so minimal and presumably one has a built up a personal template over time.

For blog posts and notes I see the appeal, since the boilerplate can be a hindrance to spontaneous writing.

Re:Pandoc by CJefferson on Tuesday August 28, 2018 @02:10AM (#17856867)
Latex can't produce web output, which is increasingly a target I want.

Also, Latex can't produce any output which is accessible to blind people (other than giving them the raw LaTeX). The PDFs latex produces are probably the least accessible format available (much worse than a word proeuced pdf, or some html). This matters to me, and should matter more to other people (in my opinion).

Re:Pandoc by baldfat on Tuesday August 28, 2018 @08:53AM (#17858406)
BUT that is what makes Pandoc powerful. You convert your latex or your whatever into: (Can we please add Racket's Scribble? It is by far the reason why Racket has the best documentation of any language. https://docs.racket-lang.org/scribble/)

Markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, TWiki markup, TikiWiki markup, Creole 1.0, Vimwiki markup, OPML, Emacs Org-Mode, Emacs Muse, txt2tags, Microsoft Word docx, LibreOffice ODT, EPUB, or Haddock markup to

HTML formats

    XHTML, HTML5, and HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides
Word processor formats

    Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML, Microsoft PowerPoint.
Ebooks

    EPUB version 2 or 3, FictionBook2
Documentation formats

    DocBook version 4 or 5, TEI Simple, GNU TexInfo, Groff man, Groff ms, Haddock markup
Archival formats

    JATS
Page layout formats

    InDesign ICML
Outline formats

    OPML
TeX formats

    LaTeX, ConTeXt, LaTeX Beamer slides
PDF

    via pdflatex, xelatex, lualatex, pdfroff, wkhtml2pdf, prince, or weasyprint.
Lightweight markup formats

    Markdown (including CommonMark and GitHub-flavored Markdown), reStructuredText, AsciiDoc, Emacs Org-Mode, Emacs Muse, Textile, txt2tags, MediaWiki markup, DokuWiki markup, TikiWiki markup, TWiki markup, Vimwiki markup, and ZimWiki markup.
Custom formats

    custom writers can be written in lua.
https://pandoc.org/
Re:Pandoc by CJefferson on Tuesday August 28, 2018 @10:09AM (#17858869)
Well, except LaTeX probably isn't the best base format to write in -- Pandoc's LaTeX parser isn't very good, it doesn't parse (from a quick check) any of the papers I've written. They've tried hard, but I think it's a losing battle, particularly once people start using a large range of packages.

That's not surprising -- it's basically impossible to "parse" LaTeX, as it's defined by execution.

Re:Pandoc by babahoyo on Tuesday August 28, 2018 @11:31AM (#17859574)
iirc pandoc's markdown provides the set of functionality that one is capable of transforming back and forth. So as long as you stay within those formatting confines, you are set.

This works for everything except table notes a la ```threeparttable```

Re:Pandoc by lqet on Tuesday August 28, 2018 @06:59AM (#17857842)
What about htlatex? It is quite powerful. In most of the cases, it produces nice HTML pages out of the box, with automatic rendering of figures and mathematical equations into PNG. It is part of most LaTeX distributions. On Linux, for example, just type

  $ htlatex mydoc.tex
instead of

  $ pdflatex mydoc.tex
Re:Pandoc by michaelhoffman on Tuesday August 28, 2018 @08:29AM (#17858232)
For me, at least, htlatex never works just quite right. There are a lot of edge cases where it's broken. If you want to preserve having non-PDF output, starting in something like Pandoc Markdown is a better idea. And I do most of my documents in regular LaTeX.
Re:Pandoc by voltagex_ on Tuesday August 28, 2018 @02:59AM (#17857022)
>Also, Latex can't produce any output which is accessible to blind people

This sounds like it should definitely be a target of a grant. I guess most government organisations around the world are using Word et al, which isn't too bad these days accessibility wise (AFAIK).

Can you provide a small example of a LateX document that produces an inaccessible PDF?

Re:Pandoc by CJefferson on Tuesday August 28, 2018 @03:15AM (#17857066)
If you grab any academic paper (particularly two columns) there is a good chance getting the text out will be hard, and any part of the paper with maths or tables will be unusable. Sorry. I'm away from a computer now, to make a smaller example.
Re:Pandoc by masklinn on Tuesday August 28, 2018 @03:41AM (#17857164)
The paper "GADTs Meet Their Match" (first I had in my list) seems to work fine, but I don't know what it was generated with.
Re:Pandoc by voltagex_ on Tuesday August 28, 2018 @05:38AM (#17857582)
cairo 1.13.1 is listed as the generator.

http://checkers.eiii.eu/en/pdfcheck/?url=https%3A%2F%2Fwww.m...

The ACM template fails more! http://checkers.eiii.eu/en/pdfcheck/?url=https://www.acm.org..., and it's generated by pdfTex-1.40.15

Re:Pandoc by CJefferson on Tuesday August 28, 2018 @06:21AM (#17857714)
I'll pick on one of my own random papers:

https://www.cs.york.ac.uk/aig/projects/implied/docs/cp03.pdf

Try extracting "Theorem 2" on page 5, or any text really. I just get random noise through either a PDF reader, or something like pdf2ascii / ps2ascii.

We just made this with standard latex.

Re:Pandoc by mkl on Tuesday August 28, 2018 @07:53AM (#17858076)
Any chance you could post the source code for this? It's using bitmaps for characters instead of proper fonts, which shouldn't happen nowadays. Maybe you should put "\usepackage{lmodern}" at the start? See for example https://tex.stackexchange.com/questions/1291/why-are-bitmap-...

I work with course materials made in Latex, and students sometimes need/want to copy and paste from them, so I try to avoid these kinds of problems.

Re:Pandoc by Gorgor on Tuesday August 28, 2018 @07:09AM (#17857878)
That’s interesting. Did you \usepackage[T1]{fontenc}?
Re:Pandoc by CJefferson on Tuesday August 28, 2018 @08:32AM (#17858256)
Thanks paper is from 2003, so I'm not sure.

This is just an example. From experience, most PDFs at conferences and journals, generated from pdf, are not accessible to varying degrees.

Re:Pandoc by jimhefferon on Tuesday August 28, 2018 @09:37AM (#17858654)
Accessibility is a big current push from the TeX Users Group. The president, Boris Veytsman, has made moving it forward a big goal. I know that a lot of people are working on aspects of that, but the name I hear the most is Ross Moore, who I have heard talk on making the output be PDF/A-3a compliant. I understood that it is a long way there.
Re:Pandoc by CJefferson on Tuesday August 28, 2018 @01:29PM (#17860799)
I hope so, because honestly, Tex generated PDFs are the single biggest problem with being a blind researcher (I'm not blind, but I know a blind researcher).
Re:Pandoc by BeetleB on Tuesday August 28, 2018 @01:11AM (#17856659)
>I’ve never understood the impetus for not using full LaTeX in an academic contex, given that the boiler plate is so minimal and presumably one has a built up a personal template over time.

I don't find the boilerplate minimal at all. Contrast the following:

    \begin{itemize}
     \item First
     \item Second
     \item Third
    \end{itemize}
with

     - First
     - Second
     - Third
I won't even get into the hell that is tables.

I loved LaTeX until I discovered Org Mode. Pandoc also scratches the same itch.

Re:Pandoc by susam on Tuesday August 28, 2018 @12:46AM (#17856588)
I agree. If one is going to use LaTeX directly or indirectly via Pandoc, eventually one would have to build up a personal template to fine-tune the look and feel of the documents.

If one is going to write LaTeX code anyway, it seems easier and cleaner to use LaTeX all the way, move all the boilerplate along with the personal template to say, a file named preamble.tex, and \input{preamble.tex} in the documents.

However, there are situations where Pandoc can be convenient. For example, I wanted a document[1] to be written primarily as README.md (CommonMark format), so that GitHub could render it as the project README. At the same time I wanted to render a PDF output from a customized form of the content. Pandoc is convenient for cases like this although it takes a bit of work to fine-tune the formatting and customize the content for each output format.

[1]: https://github.com/susam/gitpr

[2]: https://github.com/susam/gitpr/blob/master/Makefile

Re:Pandoc by BeetleB on Tuesday August 28, 2018 @01:13AM (#17856670)
>If one is going to write LaTeX code anyway, it seems easier and cleaner to use LaTeX all the way, move all the boilerplate along with the personal template to say, a file named preamble.tex, and \input{preamble.tex} in the documents.

Not sure why you think it has to be that way. I author LaTeX documents using org mode. Org mode handles most of the boilerplate, and I can still put pretty much any custom LaTeX within the org document, wherever I want it (this includes \newcommand, etc). I lose nothing by going to org mode, and I gain much in terms of reduced boilerplate.

Re:Pandoc by tonyarkles on Tuesday August 28, 2018 @01:27AM (#17856726)
Yup. I’ve got a pandoc template for doing org-latex-pdf conversion, as well as some org templates for common documents that my clients need. Hack away on the document in org (which I’m probably going to be doing anyway, since the rest of my life is in there too), and then when it’s ready to hand off, turn it into a PDF using a shell script.

My absolute favourite moment with that flow was a client who wanted one as a docx instead of a PDF. Pandoc obliged and they commented that I must have spent a lot of time reformatting things for them :)

Re:Pandoc by Nullabillity on Tuesday August 28, 2018 @09:33AM (#17858634)
Why not use Org's built-in org->latex->pdf exporter? AFAIK Pandoc isn't compatible with many of the more interesting Org features, such as Babel.
Re:Pandoc by tonyarkles on Wednesday August 29, 2018 @07:00PM (#17872837)
That's a good question! The flow started out as markdown->latex->pdf via pandoc, and then when I got back into Org, it just slid right into that workflow to replace Markdown.

I'm curious now though... maybe I'm missing out!

Re:Pandoc by foo101 on Tuesday August 28, 2018 @01:56AM (#17856823)
It isn't clear to me whether you are saying that Pandoc is necessary or if you are saying that Pandoc is unnecessary and LaTeX alone is sufficient for all purposes.

I think your parent comment was saying that LaTeX alone is sufficient. You also seem to be saying that LaTeX alone is sufficient while using Org mode. Would you please clarify if I am interpreting your comment correctly or not?

Re:Pandoc by BeetleB on Tuesday August 28, 2018 @10:15AM (#17858908)
>It isn't clear to me whether you are saying that Pandoc is necessary or if you are saying that Pandoc is unnecessary and LaTeX alone is sufficient for all purposes.

I'm not saying either. The parent said it's easier and cleaner to use LaTeX all the way. I was pointing out that it is easier to write in a format like Org mode and export to LaTeX (whether via Pandoc or Org mode's built-in exporter).

Of course LaTeX is "sufficient". It is also, IMO, painful.

Re:Pandoc by brennebeck on Tuesday August 28, 2018 @02:33AM (#17856942)
Pretty sure they are saying pandoc is unnecessary.
Re:Pandoc by sevensor on Tuesday August 28, 2018 @10:37AM (#17859076)
I wrote my dissertation using Pandoc. It might seem that the LaTeX boilerplate is minimal, but Markdown is even more minimal, and it preempts the urge to fuss with your layout. Writing in Markdown means that you can wave your hand at the document and say, "It's a draft, I'll fix the formatting once I'm sure I even want this material." Afterwards, fixing the layout is really easy because you can drop raw LaTeX in wherever you need to, and you haven't wasted countless hours laying out a float you later end up cutting.
Re:Pandoc by stdbrouw on Tuesday August 28, 2018 @04:03AM (#17857256)
Having to use `\textbf{...}` is impetus enough for writing in Markdown instead.
Re:Pandoc by nanna on Tuesday August 28, 2018 @06:07AM (#17857663)
LaTeX editors have simple keybindings for this, like ctl-b., or C-c C-f C-b in emacs, which makes this kind of thing a non-issue for me...
Re:Pandoc by Anonymous4C54D6 on Tuesday August 28, 2018 @07:24AM (#17857932)
Just reading C-c C-f C-b is an issue for me and I haven't even tried to remember and type it yet.
Re:Pandoc by disgruntledphd2 on Tuesday August 28, 2018 @07:54AM (#17858079)
C-c C-f is a prefix key, you get bold with C-b, italic with C-i and so on. At least it was last time I used AucTex :)
Re:Pandoc by hatmatrix on Monday August 27, 2018 @11:17PM (#17856342)
I agree - while pandoc is great it's usually not 'one click' to any format, especially when have html or latex-specific markups.

It's not for everyone, but emacs+auctex really reduces the latex boilerplate (at least writing it) that I don't really feel it's a hindrance.

Re:Pandoc by neves on Tuesday August 28, 2018 @10:54AM (#17859223)
I didn't use LaTex for years, is it still a hell to make tables? And also very difficult to use templates to generate good looking documents that doesn't like an academic paper?
Re:Pandoc by uvtc on Monday August 27, 2018 @09:40PM (#17856020)
Yes! It's great to be able to put LaTeX-formatted equations directly into your pandoc-flavored markdown source file.

Incidentally, I really like the thoughtful syntax additions Pandoc makes over olde Markdown (eg., tables, definition lists, and span & div syntax as well). Such a great all-around doc tool.

Re:Pandoc by dr_coffee on Monday August 27, 2018 @07:41PM (#17855437)
What's your workflow for inserting and managing references
Re:Pandoc by tekknolagi on Monday August 27, 2018 @08:29PM (#17855683)
Not OP, but I used `+citations` and `pandoc-citeproc` along with a bibtex file that I managed by hand for https://bernsteinbear.com/dat-paper/ (a small senior project paper). It worked pretty well for me.
Re:Pandoc by meanmrmustard92 on Monday August 27, 2018 @10:34PM (#17856220)
Add bibliography=path/to/library.bib (and optionally specify a csl for bibliography formatting; I like econometrica) in frontmatter yaml. Insert citations with @bibcitekey. compile with --pandoc-citeproc filter.
Re:Pandoc by sevensor on Tuesday August 28, 2018 @10:48AM (#17859187)
It was a couple of years ago that I wrote my dissertation using Pandoc, so things may have changed. At the time, I started out using pandoc-citeproc with my BibTeX database, but eventually I needed more control over formatting and I switched to writing \cite everywhere. Even with hundreds of references, it only took an afternoon, so I'm happy I did it the way I did. My approach with Pandoc is to use it until you have to invest LaTeX-level effort into making it do what you want. At that point, swapping in LaTeX is rarely painful. Often you can get away with editing Pandoc's generated LaTeX and pasting it back in to your source.
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @01:24PM (#17860752)
You can control the formatting pandoc-citeproc (which is now built in to pandoc) produces with a CSL file. That's great if your institution provides one, otherwise... you'll have to learn CSL ;-/
Re:Pandoc by ryanmarsh on Monday August 27, 2018 @08:29PM (#17855684)
I use pandoc-crossref.
Re:Pandoc by criddell on Tuesday August 28, 2018 @07:26AM (#17857939)
> if the publisher 'needs' a Word file, you are one click away from providing it

Once the work has moved into a Word file, isn't that where it stays? Editors and publishers often make heavy use of features like track changes and notes. Doesn't pandoc lose that information?

Re:Pandoc by aquova on Tuesday August 28, 2018 @08:15AM (#17858177)
It does. I think the assumption here is that the author is the only contributor to the document. Exporting into a Word doc would serve the same function as exporting to a .pdf, others could read it and even mark it up, but the author would have to make the noted changes in their original plain text document themselves.
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @09:33AM (#17858632)
pandoc has a --track-changes option, so you can convert a docx file with its proposed changes back to, say, markdown.
Re:Pandoc by jonathanstrange on Tuesday August 28, 2018 @03:53AM (#17857219)
I tried and it didn't work for me. Pandoc's conversion functionality is good but unfortunately also fails very often, at least in my experience. I suppose with custom templates and a lot of trickery I could get it working for the kind of papers I write, but I've found it easier to convert LaTeX to Word manually when needed - which is a pain in the ass, too, of course.
Re:Pandoc by nanna on Tuesday August 28, 2018 @06:10AM (#17857672)
In my experience it works so long as you keep to very vanilla LaTeX code. Pandoc's support for LaTeX packages tends to be very patchy.
Re:Pandoc by baldfat on Tuesday August 28, 2018 @09:13AM (#17858533)
I have to put in a word for Racket's Scribble. Programmiclly creating documents is powerful, and this system makes it simple. You can also basically use it as a "Markup-less" system.

Scribble Code Example:

#lang scribble/base

@title{On the Cookie-Eating Habits of Mice}

If you give a mouse a cookie, he's going to ask for a glass of milk.

@section{The Consequences of Milk}

That ``squeak'' was the mouse asking for milk. Let's suppose that you give him some in a big glass.

He's a small mouse. The glass is too big---way too big. So, he'll probably ask you for a straw. You might as well give it to him.

@section{Not the Last Straw}

For now, to handle the milk moustache, it's enough to give him a napkin. But it doesn't end there... oh, no.

Scribble -

Scribble is a collection of tools for creating prose documents—papers, books, library documentation, etc.—in HTML or PDF (via Latex) form. More generally, Scribble helps you write programs that are rich in textual content, whether the content is prose to be typeset or any other form of text to be generated programmatically. - https://docs.racket-lang.org/scribble/

Some languages based on Scribble

Skribilo -

Skribilo is a free document production tool that takes a structured document representation as its input and renders that document in a variety of output formats: HTML and Info for on-line browsing, and Lout and LaTeX for high-quality hard copies.

The input document can use Skribilo's markup language to provide information about the document's structure, which is similar to HTML or LaTeX and does not require expertise. Alternatively, it can use a simpler, “markup-less” format that borrows from Emacs' outline mode and from other conventions used in emails, Usenet and text. https://www.nongnu.org/skribilo/

Pollen -

Pollen is a publishing system built on top of Scribble and Racket. So far, I’ve optimized Pollen for web-based books, because that’s mainly what I use it for. But it can be used for small projects too, and non-webby things like PDF.

As a publishing system, Pollen includes:

    A programming language. The Pollen language is a variant of Scribble, with specific dialects tailored to different kinds of source files. You don’t need to use the programming features to do useful work, but they’re available when you need them.

    A set of tools & libraries. Pollen can produce output in any format, but it’s especially useful for markup-style formats like XML and HTML.

    A development environment. Pollen works with the DrRacket IDE. It also includes a project web server so you can dynamically preview and revise your publication. http://docs.racket-lang.org/pollen/Backstory.html

They are Domain Specific languages that excel at outputting awesome HTML and PDF. They really aren't markup but really they are a Macro system that is built on top of a full Lisp (Racket) It is easier and much more powerful then anything I have seen on Pandoc and Latex (I use Latex still for specific targets but not for general papers anymore).

Racket has the best documentation period and it is because the documentation

Re:Pandoc by mb2100 on Tuesday August 28, 2018 @06:26AM (#17857726)
Occasional pandoc contributor here, AMA :-)

Just a few links:

- Where everything is documented: http://pandoc.org/MANUAL.html

- If you have questions or suggestions: https://groups.google.com/forum/#!forum/pandoc-discuss

- Contributing to pandoc is also a great way to get your feet wet with Haskell. In my experience, very supportive community. See http://pandoc.org/CONTRIBUTING.html and for good first issues: https://github.com/jgm/pandoc/issues?q=is%3Aopen+is%3Aissue+...

Finally, a great feature, that hasn't been mentioned here, is pandoc filters. Basically, pandoc provides a way for scripts (in any programming language) to hook into the transformation pipeline and modify the document AST (similar to the HTML DOM) in-between the reading and writing steps. See http://pandoc.org/filters.html

Re:Pandoc by paule89 on Tuesday August 28, 2018 @07:17AM (#17857901)
everytime I see a project using google groups, i think it is already dead. Gladly yours seems to be used quite often. At least you can search it even years later, compared to an irc or slack channel.
Re:Pandoc by neves on Tuesday August 28, 2018 @10:51AM (#17859208)
IRC channels and mailing list are excellent for informal questioning about a project. You can search for guidance, see if a feature would be well received, and receive a green light before starting to implement something.

Other day I thought about contributing to Yarn, the Javascript package manager, but the only way that I found to communicate with the developers were issues in GitHub. Since I didn't know if the feature I wanted would be well received, I just quit.

Re:Pandoc by dean177 on Tuesday August 28, 2018 @11:26AM (#17859515)
That seems a little bit extreme, why not just open the issue?
Re:Pandoc by y4mi on Tuesday August 28, 2018 @12:00PM (#17859835)
that issue becomes part of public history.

i'm not the parent, but that is the main reason i try to abstain from posting on public forums unless its under a pseudonym, which my github account isn't.

I'm not trying to say that my anonymity is guaranteed with irc, its just unlikely that future employers and similar link it to me.

Re:Pandoc by cerberusss on Wednesday August 29, 2018 @04:02AM (#17866551)
Have a look at Firefox Multi-Account Containers. You can open a tab that has a different color, and it uses a different cookie database. Very useful, because you can create an extra Github account and quickly switch between those accounts.

https://addons.mozilla.org/en-US/firefox/addon/multi-account...

Re:Pandoc by reitanqild on Wednesday August 29, 2018 @12:27AM (#17865621)
Agree. That's probably one of tje reasons why HN is so interesting:

Requiring everyone to sign in with full, verified name limits what people can talk about.

In fact I'd almost recommend against commenting online on anything using your full name.

Re:Pandoc by mb2100 on Tuesday August 28, 2018 @08:46AM (#17858351)
Aren't mailing lists even older than IRC? Anyway, whatever works, right?
Re:Pandoc by benhoyt on Tuesday August 28, 2018 @08:13AM (#17858173)
Heh, not quite. Go (the programming language) uses Google Groups (golang-nuts and golang-dev), and it's very alive.
Re:Pandoc by roblabla on Tuesday August 28, 2018 @10:28AM (#17859008)
Hey, just a one-time contributor here (fixed a small bug in the wikitext parser), I have to say that the community is really, really great! I had never done any haskell before, but with just a little guidance from the IRC channel (#pandoc on freenode), I was put on the right track and submitted my small PR, which was merged quickly.

Overall great experience. Thanks for the great tool :).

Re:Pandoc by mariushn on Tuesday August 28, 2018 @06:04PM (#17863339)
Could we consider Pandoc a rough replacement for leanpub publishing tools?
Re:Pandoc by mb2100 on Wednesday August 29, 2018 @03:52AM (#17866498)
Probably. I'm not too familiar with leanpub, but seems like they're actually using pandoc to import docx.[0] And with pandoc you can also export to epub, pdf, docx, indesign, etc.

[0]: https://leanpub.com/anewcourse

Re:Pandoc by koolba on Monday August 27, 2018 @07:20PM (#17855332)
My favorite pandoc hack is using it to convert word docs into markdown which can then be diffed similar to source code. Works great for legal redlining.
Re:Pandoc by d99kris on Monday August 27, 2018 @09:17PM (#17855909)
Agree, and it can be nicely integrated with Git: http://blog.martinfenner.org/2014/08/25/using-microsoft-word...
Re:Pandoc by flatline on Monday August 27, 2018 @07:59PM (#17855520)
Do Word’s native diff features not work for you?
Re:Pandoc by lucb1e on Monday August 27, 2018 @08:35PM (#17855728)
Can you diff two Word docs with Word? Afaik you can only hit the "track changes" button, which doesn't help if you got a new version of a document from someone else.
Re:Pandoc by Terretta on Monday August 27, 2018 @09:06PM (#17855851)
Tools, Track Changes, Compare Documents ...

https://support.office.com/en-us/article/compare-and-merge-t...

Had this forever, here's a visual on old version of Word:

http://www.techyard.net/how-to-compare-two-word-documents-an...

For more advanced, try legal blacklining:

https://support.office.com/en-us/article/compare-document-di...

Or combine multiple sources of a similar document:

https://support.office.com/en-us/article/combine-documents-f...

Re:Pandoc by antt on Tuesday August 28, 2018 @01:44AM (#17856782)
None of that is version control. At best that's a visual based manual patch file tool.

That you can't concat two word files together in 2018 is ridiculous.

Re:Pandoc by wadkar on Tuesday August 28, 2018 @03:23AM (#17857084)
> That you can’t concat two word files

Of course you can!

# cat word1.doc word2.doc > word3.doc

Sounds ludicrous? So does your statement.

Setting aside the hyperbole, I believe it would be a conceptual nightmare to start defining concat of two docs. For simple cases, feel free to make copy pasta :-)

Re:Pandoc by majewsky on Tuesday August 28, 2018 @04:15AM (#17857300)
> I believe it would be a conceptual nightmare to start defining concat of two docs.

Just append the pages of document 2 to the end of document 1. Then the user can decide whether to remove the page break introduced by it. I have this in my env for doing this with PDF:

  $ cat =concatpdf
  #!/bin/bash
  if [ "$1" = "to" ]; then
      shift
      gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$*
  else
      echo Usage: concatpdf to out.pdf in.pdf in2.pdf in3.pdf
  fi
The peculiar syntax with "to" ensures that I do not invocate it incorrectly.
Re:Pandoc by antt on Tuesday August 28, 2018 @09:52PM (#17864696)

    $ pandoc file1.md file2.md -o file.docx
Tada, I two files into one word file.

It isn't difficult. TeX and LaTeX have been doing it since the 70s and 80s respectively.

Re:Pandoc by thanatropism on Monday August 27, 2018 @09:21PM (#17855925)
Yes, and you can merge changes too.

Classic Word workflow: I make a document and send it to my boss; he makes some changes but suggests further research etc. and sends me his altered version, but I stupidly work on my own version. Making this right takes like four clicks.

Re:Pandoc by CPAhem on Tuesday August 28, 2018 @03:58AM (#17857243)
Syncdocs [0] is also pretty good for merging and tracking changes between Word and Google Docs. It also has a feature with real-time collaboration between Google Docs and Word.

[0] https://www.syncdocs.com/

Re:Pandoc by yitchelle on Tuesday August 28, 2018 @02:09AM (#17856864)
I have been searching for this for a long time and not able to achieve it without resorting to manual copy and paste from one doc to the other.

This sounds like utopia. :-) Do you have a link to a page that outlines these steps?

Re:Pandoc by TuringTest on Tuesday August 28, 2018 @03:48AM (#17857199)
It works if you don't change formatting, don't edit the same section, don't rearrange chapters and don't have lots of changes or a large document. You do any of that, and the application crashes.

It's good for a small fix, but not something to rely upon in your main documentation workflow.

Re:Pandoc by fiddlerwoaroof on Tuesday August 28, 2018 @02:05AM (#17856851)
Even if you can do it with Word, GUI interactions aren't composable and extensible the way shell commands are, so you're limited to the features the GUI designer thought of.
Re:Pandoc by coldtea on Tuesday August 28, 2018 @03:43AM (#17857176)
>GUI interactions aren't composable and extensible the way shell commands are

They might not be in word, but they absolutely can be, and in fact are a superset of CLI interactions (since a GUI interaction step in e.g. Automator can invoke any shell command).

>so you're limited to the features the GUI designer thought of

And in the traditional shell pipeline (that is, not Powershell) I'm limited to working on dumb streams from one command to another.

Re:Pandoc by raws on Monday August 27, 2018 @08:48PM (#17855775)
Completely new to this: so you're highlighting the differences between two documents in word? say 2 terms of service 1 old and 1 new?
Re:Pandoc by coldtea on Tuesday August 28, 2018 @03:44AM (#17857178)
Yes
Re:Pandoc by PhasmaFelis on Monday August 27, 2018 @09:06PM (#17855850)
Hmmm. Wonder what "track changes" does if you Ctrl-A highlight the entire old doc, and paste the entire new doc over it.

(I imagine it registers it as one huge change, rather than tracking a zillion individual changes, but it might be interesting to try.)

Re:Pandoc by TuringTest on Tuesday August 28, 2018 @03:50AM (#17857206)
It does exactly that. I don't know why someone downvoted you for that comment.
Re:Pandoc by copperx on Monday August 27, 2018 @08:05PM (#17855553)
Diff works great in Word.
Re:Pandoc by unsignedint on Monday August 27, 2018 @10:33PM (#17856213)
Another option I recommend comparing two Word docs (and just about anything) is Beyond Compare.[0]

It's the software you would have to buy, but if you have to compare files a lot I would highly recommend it. (Runs on multiple platforms, too.)

[0]: https://www.scootersoftware.com

Re:Pandoc by TuringTest on Tuesday August 28, 2018 @05:23AM (#17857535)
WinMerge does the same, and it's open source. It's only for Windows, though.

http://winmerge.org/

Re:Pandoc by unsignedint on Tuesday August 28, 2018 @01:12PM (#17860629)
Yeah, WinMerge a nice tool, too.

Aside from multi platform, BC has things like CSV compare and marking unimportant changes are fairly robust. I do personally prefer open source myself, but BC is certainly one of the few that I didn't mind paying for.

Re:Pandoc by amelius on Tuesday August 28, 2018 @05:31AM (#17857559)
Trying pandoc on a word doc gives me:

    # pandoc test.doc -o test.pdf
    pandoc: Unknown reader: doc
    Pandoc can convert from DOCX, but not from DOC.
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @06:03AM (#17857647)
As the error says, pandoc doesn't support .doc files, only .docx.
Re:Pandoc by amelius on Tuesday August 28, 2018 @06:29AM (#17857738)
Ok, but then they shouldn't call the tool pandoc.
Re:Pandoc by njsubedi on Tuesday August 28, 2018 @06:34AM (#17857748)
Get out :P
Re:Pandoc by psychometry on Monday August 27, 2018 @08:29PM (#17855687)
Does it come up with the right semantic content for lists and tables?
Re:Pandoc by tomrod on Monday August 27, 2018 @09:34PM (#17855990)
> legal redlining

Is this underlining, and not redlining as defined in financial services? (redlining: differential pricing based on demographic makeup of a zip code or neighborhood)

Re:Pandoc by URSpider94 on Monday August 27, 2018 @10:03PM (#17856108)
Attorneys and business folks use it to mean “marked up” - a redlined contract has additions in red, and removals in red with red lines through them.
Re:Pandoc by prdonahue on Monday August 27, 2018 @09:36PM (#17856007)
Redline as in how strikethrough appears in Word. It's a colloquial term.
Re:Pandoc by h4b4n3r0 on Monday August 27, 2018 @10:03PM (#17856109)
OP was referring to diffing changes between the original and modified version of a legal document (typically a contract).
Re:Pandoc by err4nt on Monday August 27, 2018 @07:01PM (#17855225)
I use Pandoc to convert directories of Markdown files into static HTML websites.

Here's the build command for responsive.style[1]:

    pandoc $file -f markdown -t html5 -H templates/header-prod.html -B templates/nav.html -A templates/footer-prod.html -o (echo "../$file" | sed '$s/\.md$/.html/') -s  --data-dir=./ --highlight-style breezedark --variable=file:(echo "$file" | sed '$s/\.md$/.html/')
Works beautifully!

1: https://github.com/tomhodgins/responsive.style/blob/master/s...

Re:Pandoc by uvtc on Monday August 27, 2018 @09:46PM (#17856046)
Nice.

I wrote up a tool as well, with navigation and prev/next links: http://www.unexpected-vortices.com/sw/rippledoc/index.html

Re:Pandoc by ArlenBales on Monday August 27, 2018 @07:29PM (#17855385)
I know Blot.im as one static site generator that uses it: https://github.com/davidmerfield/Blot/blob/master/app/models...
Re:Pandoc by privong on Monday August 27, 2018 @08:14PM (#17855609)
Hakyll is another: https://jaspervdj.be/hakyll/
Re:Pandoc by ggambetta on Tuesday August 28, 2018 @04:14AM (#17857299)
Another happy Pandoc user here :)

I built a pipeline to convert a Markdown file to publishing-ready files for ebooks, Kindle and paperback for my novel; the whole thing is described here: http://www.gabrielgambetta.com/tgl_open_source.html

My website itself is static, generated from a bunch of Markdown files, some HTML templates, and a bit of postprocessing. But most of the work is done by Pandoc.

Re:Pandoc by odiroot on Tuesday August 28, 2018 @04:44AM (#17857408)
Hey. Can you give us some more context of your novel writing in Markdown? I'd be interested in your process.
Re:Pandoc by ggambetta on Tuesday August 28, 2018 @05:39AM (#17857583)
Sure. The technical side of things is explained here: http://www.gabrielgambetta.com/tgl_open_source.html (same link as above). If you're more interested in the creative aspect, I wrote a bit here: http://www.gabrielgambetta.com/tgl_swiss_trains.html. If you're interested in anything not covered there, feel free to ask, I'll be happy to share :)
Re:Pandoc by bravura on Tuesday August 28, 2018 @06:04AM (#17857650)
"Soon the structure underlying The Da Vinci Code and Angels and Demons and The Lost Symbol was laying bare before my eyes. I could see why the stories worked.

I had reverse-engineered Dan Brown."

Could you talk a little more in depth about what Dan Brown's pattern/structure is?

Re:Pandoc by ggambetta on Tuesday August 28, 2018 @07:16AM (#17857898)
I get that request a lot, so I'll have to write something about it :)

All I can offer right now is my raw notes, which are in Spanish. This is a structural analysis of Angels and Demons, The da Vinci Code, and The Lost Symbol: https://imgur.com/bX6ByJA

This is an one-page treatment of the three books, with the "blanks" filled appropriately for each: https://imgur.com/LlDVUKn

I doubt any of this is groundbreaking. Story structure is a widely studied topic (and one that I find fascinating). But it seems like Dan Brown uses a very well defined, customised version of this, that makes for engaging, fast-paced books.

I sort of proved (for myself, at least) that this works, by writing a novel whose structure was originally based on this pattern (although it later diverged a bit), and which causes the expected effect - a couple of readers have read it in a single sitting :)

Re:Pandoc by bambax on Tuesday August 28, 2018 @08:21AM (#17858197)
Very interesting! Could you maybe provide those links in text form, so that we may run them through Google Translate? ;-)
Re:Pandoc by ggambetta on Tuesday August 28, 2018 @08:36AM (#17858287)
Re:Pandoc by ggambetta on Tuesday August 28, 2018 @12:24PM (#17860111)
English translation done!
Re:Pandoc by odiroot on Tuesday August 28, 2018 @01:08PM (#17860594)
Thanks for the second link! This is exactly what I meant.

EDIT One more question. How do you write dialogues in MD?

Re:Pandoc by ggambetta on Wednesday August 29, 2018 @05:37AM (#17866955)
Maybe I'm misunderstanding your question, but there's nothing special about dialogue in MD. Quotation marks, inner thoughts in italics.

  "It's just some text between quotation marks", Gabriel typed. *Have I completely misunderstood his question?*
Re:Pandoc by odiroot on Monday September 03, 2018 @02:31PM (#17904153)
No, that's exactly that. Thank you!
Re:Pandoc by myself248 on Monday August 27, 2018 @11:02PM (#17856296)
The one thing it can't do is give HN posts descriptive titles.
Re:Pandoc by wadkar on Tuesday August 28, 2018 @03:29AM (#17857112)
Thanks, this made me chuckle. Its comments like these which make HN a bit more colorful :-)
Re:Pandoc by jaggederest on Monday August 27, 2018 @07:36PM (#17855420)
Also, interesting point of trivia, the maintainer, John MacFarlane is a professor of logical philosophy at UC Berkeley.
Re:Pandoc by tambourine_man on Monday August 27, 2018 @07:10PM (#17855271)
One nice trick that I use all the time is to convert html to md and back again in order to clean it.

Anyway, pandoc is great.

Re:Pandoc by gitgud on Tuesday August 28, 2018 @02:27AM (#17856923)
Would that be a good way to sanitise user input? Like removing script tags etc...
Re:Pandoc by tambourine_man on Tuesday August 28, 2018 @07:30AM (#17857960)
It’s usually not a good idea to “get creative” when it comes to security
Re:Pandoc by majewsky on Tuesday August 28, 2018 @04:18AM (#17857313)
Only if you trust Pandoc enough to expose it to unsanitised user input.
Re:Pandoc by mwcampbell on Tuesday August 28, 2018 @12:59AM (#17856622)
It appears that Pandoc generates PDF documents via LaTeX. One problem with this is that, as far as I can tell, LaTeX can't generate tagged PDFs. This is an accessibility problem. Granted, for documents that are heavy on math and/or graphics, the point is probably moot. But many technical documents that are distributed as PDFs would benefit from being tagged.

Luckily, LibreOffice can produce tagged PDFs. And unoconv is a convenient utility for doing this from the command line. So you can use pandoc to convert to a format that LibreOffice can consume, then issue a command like this:

    unoconv -f pdf -e UseTaggedPDF=true mydoc.odt
I've tried it, and it works.
Re:Pandoc by mkesper on Tuesday August 28, 2018 @01:48AM (#17856795)
Pandoc can convert into ConTeXt which can produce PDF/A (tagging included) easily. Why this can't be done in one command like with xelatex, wkhtml2pdf and what else is supported, I don't know. Many programs can be used to create PDFs but the quality of output isn't always the same.
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @06:06AM (#17857659)
> Why this can't be done in one command

ConTeXt is supported as well: `pandoc input.md -t context -o output.pdf`

Re:Pandoc by flukus on Monday August 27, 2018 @08:08PM (#17855566)
Pandoc (or latex) + make + iNotifyWait work really well together for WYSIWYG like editing too:

  watch: $(ALL)
    while true; do \
    clear; \
    make $(WATCH); \
      inotifywait -qr -e close_write .; \
    done
"make watch WATCH=build" will now compile documents on every save. Works well for single documents, collections of documents or entire websites.
Re:Pandoc by tetov on Friday September 07, 2018 @06:44AM (#17933247)
I've been using a JS script[1] to watch directories, but this seems neater. Would you mind sharing the whole makefile?

[1] https://gist.github.com/timpulver/0d01285952b97deb70df6104cc...

Re:Pandoc by eevilspock on Monday August 27, 2018 @09:15PM (#17855895)
Pandoc's creator, John MacFarlane, is also the lead guy on CommonMark[1].

There are a small number of corner cases that need to be spec'd out before CommonMark can declare a v1.0 release[2]. If you have the skills for this kind of thing, please weigh in!

[1] https://commonmark.org

[2] https://talk.commonmark.org/t/issues-we-must-resolve-before-...

Re:Pandoc by pmlnr on Tuesday August 28, 2018 @04:09AM (#17857282)
Please, please involve definition lists. They are useful. They were present on the first webpage[1].

[1]: http://info.cern.ch/hypertext/WWW/TheProject.html

Re:Pandoc by ashton314 on Tuesday August 28, 2018 @01:50AM (#17856799)
I wrote a little utility that uses Pandoc to read Markdown files like `man` pages in the terminal:

https://github.com/ashton314/marked-man

It's just a one-liner: `pandoc -s -t man "$1" | groff -T utf8 -man | $PAGER`

(That was basically stolen from an answer to one of my questions on Stack Overflow—thanks to those who answered! :)

Re:Pandoc by mixedmath on Tuesday August 28, 2018 @07:59AM (#17858109)
In a similar vein, I use pandoc to convert markdown pages to man pages, and write new/add notes to manpages. I think it's definitely easier than actually writing groff files.
Re:Pandoc by beefhash on Tuesday September 04, 2018 @08:05AM (#17908409)
I find it easier to write man pages directly. Admittedly, I write mdoc (not the ancient "man" macros), which has been around only since the 80s. It's easier for me to remember the semantics ("Is this a flag/command/function?") than the correct traditional markup ("Should this be bold/italic/nothing?").
Re:Pandoc by ryanianian on Monday August 27, 2018 @08:13PM (#17855600)
I sometimes use pandoc to clean up my markdown-formatted documents, especially given its abilities to "wrap" text and add indentation-style whitespace that makes plain-text documents look nearly suitable for publishing as-is (almost kinda like RFC docs but without header/footer cruft).

There are a few things (in latest version, 2.2.3.2) that don't really survive round-trip from markdown back to markdown:

- reference-style links (e.g. `[foo][f]`). They are converted to inline links e.g. `[foo](http://...)`.

- setext vs hashmark headers. `foo\n=====` will get converted to `# foo`.

- markdown allows for forced-linebreak <br>s to be added with two trailing blank spaces at the end of a line. Pandoc escapes these with a trailing `\` at the end of the line.

These are only occasional nuisances, but overall the documents (at least in my experience) are not butchered.

I also occasionally go from markdown to docx for the purposes of uploading to google-docs and copy/pasting large sections into other docs. This is the only markdown-to-google-docs workflow I've found that works to preserve formatting. It's never really butchered anything, except a few times the syntax-highlighting for code-blocks gets confused and keywords get the wrong colors.

Re:Pandoc by confounded on Tuesday August 28, 2018 @01:44AM (#17856783)
IIRC, there are CLI flags for your first two points. I think the latter is something like —atx-headers.

You can choose whether reference links go at the end of the paragraph or the document.

Re:Pandoc by CodexArcanum on Tuesday August 28, 2018 @09:16AM (#17858548)
I "love" how many comments are one person praising pandoc for helping them in some workflow, and then commenters ripping into them for not using some other tool. I wonder if there's a corollary to some internet rule that the more generally useful a tool is, the more detractors will push for other tools to be used? It would help explain why programming language discussions get so contentious.

Pandoc is seriously a great tool! I love the way it's designed and have found it useful off and on over the years. Truly marvelous for making information available in any needed format.

Re:Pandoc by jph on Monday August 27, 2018 @06:56PM (#17855203)
Pandoc is great software for converting among file formats, such as text, markdown, HTML, PDF, etc.

Example:

    pandoc in.md -o out.html -V pagetitle="My Title" --to=html5 --template="my.html" --css "my.css"
The example converts a markdown file to HTML, using a given title, a template file, and a stylesheet file.

The pipeline is also well implemented with Haskell, which is good for writing your own fast functional transformations.

Re:Pandoc by phalangion on Monday August 27, 2018 @06:52PM (#17855189)
I love pandoc. I've been using it intermittently for years to turn my Markdown and org-mode documents into other formats. Just wish it would take Asciidoc as an input format.
Re:Pandoc by copperx on Monday August 27, 2018 @08:13PM (#17855603)
Asciidoctor and the other asciidoc tools do the job that I use pandoc for: tables, custom numbering, all the other markdown extensions that one needs to be able to create a highly structured document. With Asciidoc, you don't need md extensions. It's all in there.
Re:Pandoc by phalangion on Monday August 27, 2018 @08:25PM (#17855665)
Ya, I've been using Asciidoctor and Asciidoctor-pdf for long time. Those are some awesome tools, too.
Re:Pandoc by mmsimanga on Tuesday August 28, 2018 @04:17AM (#17857307)
I mainly use Asciidoc for two reasons. 1) Ability to include external code snippets. This is not possible in pandoc without installing the pandoc-iclude-code filter which doesn't have Windows binaries. I am on Windows. 2) Tables. Asciidoc has powerful support for tables. You can create tables that include rowspan and colspan among other features. You can even specify an external CSV file as a table.

I tried creating a workflow from Asciidoc through Pandoc to MS Word but that didn't work so well. Tables being the biggest issue.

Re:Pandoc by adzm on Monday August 27, 2018 @07:31PM (#17855393)
There is useful discussion on the issue regarding Asciidoc

https://github.com/jgm/pandoc/issues/1456

Re:Pandoc by patricklouys on Tuesday August 28, 2018 @05:16AM (#17857514)
I used pandoc to format my book [0]. Not everything worked perfectly, I'm pretty happy with how everything turned out (especially the print version).

It was a little work to set up the workflow with scripts etc, but being able to write the book in markdown and still having full control over the design was definitely worth it.

[0] sample here: https://patricklouys.com/professional-php-sample.pdf

Re:Pandoc by caconym_ on Monday August 27, 2018 @08:35PM (#17855727)
I write fiction as a hobby, I do it in markdown and use Pandoc to turn it into epub files with a custom CSS. It works great. Thanks Pandoc!
Re:Pandoc by clebio on Monday August 27, 2018 @08:48PM (#17855774)
Is the CSS derived from the markdown, or you supplement MD to HTML with custom CSS? Definitely curious to know!
Re:Pandoc by flocial on Monday August 27, 2018 @10:09PM (#17856139)
I used a similar workflow. The CSS is for the EPUB and maps to the html elements supported. But if you get too fancy cross device support could get hairy.

See: https://github.com/FriendsOfEpub/Blitz

Re:Pandoc by caconym_ on Monday August 27, 2018 @09:55PM (#17856076)
Custom CSS. Nothing fancy, I haven't really explored what's possible with epub.
Re:Pandoc by davnn on Tuesday August 28, 2018 @04:11AM (#17857289)
You can use the Haskell-based static site generator Hakyll with Pandoc to create the best best blogging experience imho.

An example of how easy this is and the styles I use for my personal blog: https://curious.observer https://github.com/davnn/curiousobserver

Re:Pandoc by basementcat on Monday August 27, 2018 @07:43PM (#17855450)
Maybe I used an older version but my attempts to use pandoc usually resulted in the document being butchered because the internal representation was not as expressive as the source or target formats.
Re:Pandoc by adzm on Monday August 27, 2018 @07:30PM (#17855389)
Pandoc is also a great educational Haskell project for those looking into how it all works.
Re:Pandoc by scentoni on Monday August 27, 2018 @07:50PM (#17855477)
If you don't want to install Haskell and other dependencies, several folks have developed Docker images for using pandoc:

https://users.soe.ucsc.edu/~ivo/_posts/2015-03-12-repeatable...

http://gbraad.nl/blog/document-generation-using-markdown-and...

https://github.com/jagregory/pandoc-docker

Re:Pandoc by chipotle_coyote on Monday August 27, 2018 @08:03PM (#17855545)
You could also just download one of the packages from the "Installing" page on the Pandoc web site, which has prebuilt binaries for Windows, macOS, and Linux. Installing a whole Docker image to do this seems like it might be overkill for a lot of uses.
Re:Pandoc by uvtc on Tuesday August 28, 2018 @12:00AM (#17856474)
You'd only need to install Haskell if you wanted to build Pandoc. Pandoc the executable is a binary. I install it on Debian via: `apt install pandoc`.
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @06:14AM (#17857692)
although the version in the default repo is usually quite old. You can grab a binary from https://github.com/jgm/pandoc/releases/latest
Re:Pandoc by mkesper on Tuesday August 28, 2018 @11:52AM (#17859750)
Bonus hint: If you somehow aren't able to upgrade the binary (enterprise...), using an up to date template helps a lot (at least for LaTeX).
Re:Pandoc by subinsebastien on Tuesday August 28, 2018 @05:19AM (#17857524)
Yet another pandoc user here. I built a blog engine using Pandoc as the core. Code available here : https://github.com/subinsebastien/kyll And the website built using the blog engine is available here : http://xtel.in/
Re:Pandoc by rotorblade on Tuesday August 28, 2018 @04:24AM (#17857345)
I tried to use pandoc a while ago to convert the latex-sources of arxiv.org documents to epub, since those are often much more comfortable to read on small devices than pdfs.

The problem I had was that latex was turned into images, but changing the font-size of the reader did not change the size of the images, making the text readable, but the maths barely readable.

This is something I would love to see happen though.

Re:Pandoc by fntlnz on Tuesday August 28, 2018 @10:06AM (#17858847)
Take a look at arxiv vanity https://www.arxiv-vanity.com/
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @06:10AM (#17857674)
> latex was turned into images

You can add some CSS to the generated EPUB to change that. But if your EPub reader supports MathML, you can do that with pandoc. See http://pandoc.org/epub.html#math

Re:Pandoc by patkai on Tuesday August 28, 2018 @04:28AM (#17857350)
I've seen this problem on Kindle books with equations, is that a related problem?
Re:Pandoc by tjoff on Tuesday August 28, 2018 @05:11AM (#17857498)
Seems like an issue with the epub reader though?
Re:Pandoc by disqard on Monday August 27, 2018 @07:49PM (#17855473)
I like pandoc. I've been using Typora [1] for all of my writing, and it's decent, but a little slow.

What editor do HN folks use? I wonder if there's a leaner editor out there with an equally nice distraction-free editing interface. Thanks in advance!

[1] https://typora.io/

Re:Pandoc by arminiusreturns on Monday August 27, 2018 @10:56PM (#17856285)
Emacs and emacs ord mode, and then you can export to html5 latex/pdf, etc. My notes, calendar, todo, data science workbooks, etc all live in emacs org mode. Especially love the ability to call programs on the fly in my data science workbooks, so I can call R, Julia, python, and bash all in one place.
Re:Pandoc by canhascodez on Monday August 27, 2018 @08:36PM (#17855730)
Asking what editor HN uses is a pretty loaded question, but it looks like there's a couple neo/vim plugins for live markdown preview. This one[0] says it can use pandoc as a backend. I'm pretty sure that emacs offers something similar, and org-mode may be worth consideration all on its own. I hear spacemacs and spaceneovim are nice.

  [0] https://github.com/euclio/vim-markdown-composer
Re:Pandoc by heliostatic on Monday August 27, 2018 @08:07PM (#17855561)
I've been really enjoying the Caret beta -- https://caret.io/

Not free, but a real pleasure to use.

Re:Pandoc by applecrazy on Monday August 27, 2018 @09:56PM (#17856081)
I tried Caret and loved it but had to uninstall because of the huge font size on equation renders in a math-heavy document. Is there a way to fix that? I tried to look but they don't have much documentation yet.
Re:Pandoc by hatmatrix on Monday August 27, 2018 @07:10PM (#17855273)
Even though org-mode has its own exporters, Pandoc is great for the extra bibtex integration.
Re:Pandoc by voltagex_ on Tuesday August 28, 2018 @03:00AM (#17857026)
The only problem I have with pandoc is I have to lug the entire GHC around with it.
Re:Pandoc by nh2 on Tuesday August 28, 2018 @06:15AM (#17857694)
That is not the case.

https://pandoc.org/installing.html

> We provide a binary package for amd64 architecture on the download page. This provides both pandoc and pandoc-citeproc. The executables are statically linked and have no dynamic dependencies or dependencies on external data files.

Re:Pandoc by loudmax on Tuesday August 28, 2018 @08:43AM (#17858335)
There's an unofficial Arch package for it: https://aur.archlinux.org/packages/pandoc-bin/

I wish I'd known about this sooner. I don't spend much time with text documents outside the web, but when I do, pandoc handles the disparate formats admirably. The only inconvenience is when I update my system, there's guaranteed to be a huge pile of Haskell libraries to download.

Re:Pandoc by voltagex_ on Tuesday August 28, 2018 @06:28AM (#17857732)
Thanks! I wonder how it was built.
Re:Pandoc by shakna on Monday August 27, 2018 @07:19PM (#17855322)
What don't I use it for?

+ Static websites from any input to html

+ Markdown & TeX & References to pdf for academia

+ Generating manpages for new tools

+ Generating ebooks

... Let's just say I get a bit lost when it isn't available.

Re:Pandoc by geraldcombs on Monday August 27, 2018 @07:45PM (#17855458)
> + Generating manpages for new tools

Do any of your tools use long options (prefixed with a double dash)? If so, make sure you disable the "smart" extension, otherwise you might end up with en dashes.

Re:Pandoc by shakna on Monday August 27, 2018 @10:03PM (#17856112)
Aye. I've got several long lists of options, depending on the project. Manpages might have been the most fiddly to get right.
Re:Pandoc by copperx on Monday August 27, 2018 @08:17PM (#17855627)
OP said he doesn't use pandoc for such things. It's a list of things that have better tooling.
Re:Pandoc by icegreentea2 on Monday August 27, 2018 @08:28PM (#17855678)
Maybe he edited his post, but it now ends with "... Let's just say I get a bit lost when it isn't available. " suggesting that he actually does use pandoc for stated tasks.
Re:Pandoc by shakna on Monday August 27, 2018 @09:59PM (#17856097)
I'm sorry if it came across that way. The list is what I use pandoc for. I use it for a lot, so much that I think I use it for every project.
Re:Pandoc by kaushalmodi on Monday August 27, 2018 @10:36PM (#17856227)
I found it confusing too. You were supposed to use interrobangs (‽) instead of "?" :)
Re:Pandoc by shakna on Monday August 27, 2018 @11:11PM (#17856321)
Would that not only be applicative if I were making an exclamation? Whilst instead, I was making a statement.
Re:Pandoc by kaushalmodi on Monday August 27, 2018 @11:18PM (#17856345)
It sounded like a rhetorical question, and based on the context that you use it for a lot of things, I sensed a bit on excitement there too, and thus the exclamation.. like "Isn't that awesome‽".
Re:Pandoc by copperx on Monday August 27, 2018 @08:16PM (#17855618)
What do you use for ebooks? Asciidoc?
Re:Pandoc by shakna on Monday August 27, 2018 @10:02PM (#17856103)
A mix. Depends on the book.

For novels, I tend to just use Markdown, as kerning will be done in CSS.

For academics, I use LaTeX and Asciidoc together, but some paragraphs might be inserted in various other formats - whatever is easier. The build tool doesn't care what the format is, it'll take any input pandoc accepts.

Re:Pandoc by bovermyer on Tuesday August 28, 2018 @09:10AM (#17858511)
I love pandoc, but I'm very surprised that such an established tool has (at time of writing) 865 points and is #1 on HN.

I guess it's not as well-known as I thought.

Re:Pandoc by epynonymous on Tuesday August 28, 2018 @01:54AM (#17856813)
i have been using catdoc and pdftotext to convert doc and pdf files, respectively. nice to see that there's an alternative that also includes a library, will be checking this out.

a couple questions i have, seems firstly that old school .doc files are not supported, docx yes. unfortunately i still get a lot of docs in .doc format which seems to be microsoft's proprietary format (docx seems to be more open).

my second question is whether or not there's a filter for golang, most of my development is in golang, so i either need to call your cli as a forked process or best to have a native library. i have never worked with haskell so not sure if i can import a haskell library from golang directly. i imagine there'd need to be a golang wrapper around the cli.

Re:Pandoc by duckerude on Tuesday August 28, 2018 @07:01AM (#17857849)
You could use Libreoffice's command line interface to convert from .doc to a more manageable format.

  lowriter --convert-to odt some-document.doc
odt is not the only supported target, but doc --libreoffice--> odt --pandoc--> plain seems to give better results than e.g. doc --libreoffice--> txt or doc --libreoffice--> docx --pandoc--> plain.
Re:Pandoc by epynonymous on Tuesday August 28, 2018 @12:43PM (#17860339)
if that's the case, i'll stick with catdoc. my use case is to create a full text search index of the content, trading libre office cli for catdoc, i'd rather just stick with catdoc, but thanks.
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @06:16AM (#17857699)
1. yes, only docx is supported. 2. for Go pandoc filters, this seems to work: https://github.com/oltolm/go-pandocfilters
Re:Pandoc by epynonymous on Tuesday August 28, 2018 @11:39AM (#17859646)
thanks, will check this out
Re:Pandoc by GlenTheMachine on Monday August 27, 2018 @07:32PM (#17855397)
As a guy attempting to transition from macOS to Linux:

Pages to anything else, please.

Re:Pandoc by jagger27 on Monday August 27, 2018 @08:12PM (#17855590)
A quick Google suggests that the most straightforward way is to run an Automator script to convert everything to PDF using Pages itself.
Re:Pandoc by GlenTheMachine on Monday August 27, 2018 @09:25PM (#17855948)
Yeah. But then you can't edit it. Converting it to opendoc or something would be more useful.
Re:Pandoc by _emacsomancer_ on Monday August 27, 2018 @10:14PM (#17856153)
Maybe this ( http://tyorex.com/iWorkConverter/ ) and then a batch doc->odt converter? (Though for the sake of sanity, I recommend avoid word processors where possible.)
Re:Pandoc by mark_l_watson on Monday August 27, 2018 @10:05PM (#17856121)
Pages will export to Word format, then use pandoc to generate markdown files. (Just one idea)
Re:Pandoc by GlenTheMachine on Monday August 27, 2018 @10:27PM (#17856193)
But then I have to keep a Mac around, just to convert documents. Not ideal.
Re:Pandoc by fyfy18 on Tuesday August 28, 2018 @12:24AM (#17856532)
You can do this via iCloud too (through the browser).
Re:Pandoc by GlenTheMachine on Tuesday August 28, 2018 @11:15AM (#17859415)
Yeah, I know about that. I'm a government employee. Cloud services are mostly off limits to me.
Re:Pandoc by kccqzy on Monday August 27, 2018 @11:17PM (#17856340)
Pandoc is great! I use pandoc for all kinds of formal writing (conversion to PDF via LaTeX). We also run pandoc in production to produce customer-facing PDFs.
Re:Pandoc by bkyan on Monday August 27, 2018 @07:13PM (#17855293)
Is there an equivalent of this for spreadsheets?
Re:Pandoc by scentoni on Monday August 27, 2018 @07:42PM (#17855439)
The closest thing I'm aware of is the spreadsheet functionality in Emacs org-mode:

https://orgmode.org/worg/org-tutorials/org-spreadsheet-intro...

https://orgmode.org/manual/The-spreadsheet.html

Re:Pandoc by bkyan on Tuesday August 28, 2018 @01:08AM (#17856645)
Sorry, I'm a little confused... How would I use org mode to convert between different spreadsheet formats?
Re:Pandoc by rllin on Monday August 27, 2018 @09:24PM (#17855940)
frustratingly slow for word docs. antiword is better for those of you who wish to convert word docs en masse
Re:Pandoc by nambit on Monday August 27, 2018 @08:21PM (#17855645)
I have used pandoc with uikit to autoconvert my markdown pages to html. Works like a charm.
Re:Pandoc by rydel on Tuesday August 28, 2018 @02:52AM (#17856995)
Really one of the best tool! Simple to use and makes things done.
Re:Pandoc by fastier on Monday August 27, 2018 @09:01PM (#17855829)
Where is .djvu?
Re:Pandoc by gwern on Monday August 27, 2018 @09:33PM (#17855985)
Do you need an option for that? You can convert to PDF and then `pdf2djvu` it.
Re:Pandoc by vortico on Monday August 27, 2018 @09:31PM (#17855977)
I believe the best you could do is extract the raw OCR'd text from the document (with some other tool). No formatting or text hierarchy is preserved in the OCR process, only the physical locations and size of the text on the page. From text, you can convert to Markdown or whatever and then manually edit to give the OCR text some structure.
Re:Pandoc by boonasty69 on Tuesday August 28, 2018 @07:25AM (#17857936)
updated and secure.
Re:Pandoc by another-cuppa on Tuesday August 28, 2018 @04:15AM (#17857301)
I write any document that doesn't need extensive custom typesetting (which is 90% of stuff) in org-mode and then use pandoc to convert it to "normal people" formats at the end. I have made a basic template for MS Word that looks pretty good.
Re:Pandoc by Numberwang on Monday August 27, 2018 @07:12PM (#17855283)
I wish they’d fix the md to adoc table conversion issues. Apart from that I love it.
Re:Pandoc by kevin_thibedeau on Monday August 27, 2018 @07:45PM (#17855457)
The core problem with Pandoc is that the internal document representation is limited to its particular flavor of Markdown. Any feature PD-MD doesn't support is ignored or loses semantics. You can see this in the poor ReST support (try converting captioned figures). It would be useful to rearchitect it with a Docbook-style semantics internally since they are more comprehensive than Markdown.
Re:Pandoc by euske on Monday August 27, 2018 @10:30PM (#17856203)
I know it's well intended and somewhat successful, but I can't help but thinking of xkcd.com/927

Sorry, I couldn't resist.

Re:Pandoc by Lio on Tuesday August 28, 2018 @07:43AM (#17858034)
Although it does offer some useful extensions for Markdown, Pandoc doesn't attempt to establish new standards.

It's a conversion tool for existing formats.