pandoc-citeproc: “stdin” (line 31, column 2): unexpected “b”

Today I came across the following error in pandox (pandoc-citeproc) that was a bit cryptic to me:

pandoc-citeproc: "stdin" (line 31, column 2): unexpected "b"
expecting "c", "C", "p", "P", "s" or "S"
[...]

When I also got this on an empty text (markdown) file with just a reference in it, I realized that the markdown document was not the problem. Indeed, I had inadvertedly deleted a trailing comma in the bibtex document.

@article{lee
title = {Racial [...]

doesn’t work; it should be:

@article{lee,
title = {Racial [...]

LaTeX to Word

Ever needed to convert a LaTeX document to Word, like to submit it to a social sciences journal insisting on MS Word format? There are several options out there, including using Adobe Reader to save the PDF as a Word document. In my experience, the best results can be obtained when using MS Word to open the PDF document (yes, MS word can open PDF documents!). Obviously you’ll have to check everything carefully, but recent version of Word even seem to handle most equations right.

Alternatively, write in Pandoc Markdown to start with (or Sciflow if you need online collaborative writing), and you can create beautiful PDF as well as Word document, whatever you need.

pandoc document conversion failed with error 43

Today I had a “pandoc document conversion failed with error 43” error when compiling a document in Rstudio and directly with rmarkdown. Such an error used to occur a couple of years ago, but that bug has long been fixed. At first I was a bit puzzled, given that this was a rather simple document. It turned out that this error can be a sign of a poorly specified ‘date’ argument in the header, more specifically pandoc does not like a period there.

So
---
title: "Something"
author: "Didier Ruedin"
date: "7 March 2017"
output: pdf_document
---

works, while

---
title: "Something"
author: "Didier Ruedin"
date: "7. March 2017"
output: pdf_document
---

does not. In German, typically there is a period in dates, like 7. März 2017.

Use MS Word to Convert PDF Files

Recently we had to convert a PDF file to MS Word so that we could benefit from the Track Changes feature in MS Word. The proofreader did not want to use the commenting tools in Adobe/Acrobat because he found them inefficient to propose changes in the text. (Yes, he could make direct changes, but it takes much more time.) We had a LaTeX source file and faced the common challenge of turning this into a Word file. I remembered that Adobe/Acrobat can export PDF to Word files, but as I have experienced many times, the output did not satisfy me at all. I also tried pandoc, but it turned out that we used bits of LaTeX pandoc cannot (yet) handle. When checking the output, I discovered that Word can open PDF files. We quite liked the output and had to tidy up only a few bits and pieces to have an acceptable Word file.

We could have avoided this challenge by using markdown and pandoc to start with… my usual approach these days.

Syntax Highlighting for Pandoc/Markdown in Notepad++

There are several files out there to add syntax highlighting for pandoc/markdown to Notepad++. I couldn’t find one that is ready for the Solarized (dark) theme, so I modified one of the existing ones. Embarrassingly I cannot recall which one I used as the based; I’ll be very happy to give credit if someone points me to the source. The modified version is available here. I also removed the code that highlighted everything between underscores (which renders as italic), because I sometimes have bibtex identifiers that include underscores…