News for hackers. Stuff that matters.
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).