[Tex/LaTex] Add Markdown Citations using Pandoc

bibliographiescitingmarkdownpandoc

I am going through a process of converting all our code documentation from LaTeX to Markdown. I figured that my best bet was to use Pandoc. We have developed our own flavor of Markdown so I will need to go in and edit by hand some of the freshly converted markdown.

I am having trouble producing proper citations within my markdown. The current command I am using seems to be "hardcoding" the citations in without markdown short cuts (ie. (Hammond et. all 2015) vs [@cite:Hammond]). I have the .bib files. Is there a way to make this work?

Code I am currently running to convert from LaTeX to MD

pandoc --ascii -f latex -t gfm --filter=pandoc-citeproc -o test.md input.tex

Code I have tested but still doesn't work

pandoc -s -V biblio-files=../../../../../../doc/content/bib/*.bib --filter=pandoc-citeproc -f latex -t gfm -o test.md input.tex

How can I get it to produce a dynamic markdown citation instead of hardcoding it in?

Sample TeX File

\documentclass[11pt]{article}
\usepackage{cite}

\begin{document}

\title{My Article}
\author{Nobody Jr.}
\date{Today}
\maketitle

Blablabla said Nobody ~\cite{Nobody06}.

\bibliography{name}{}
\bibliographystyle{plain}
\end{document}

Sample Bib File

@misc{ Nobody06,
       author = "Nobody Jr",
       title = "My Article",
       year = "2006" }

Sample Output Markdown File

Blablabla said Nobody  (Jr 2006).

<div id="refs" class="references">

<div id="ref-Nobody06">

Jr, Nobody. 2006. “My Article.”

</div>

</div>

What I want

Blablabla said Nobody [@Nobody06].

Best Answer

I found an answer thanks to @moewe's help. Apparently Github Flavored Markdown does not support short-linking citations but pandoc's own markdown does. A 2nd problem arose, in that, pandoc's markdown does not support pipe_tables by default. Running the below code gave me in text citations and also played well with all the other Markdown requirements I needed:

pandoc --ascii -f latex -t markdown-multiline_tables-simple_tables --atx-headers -o test.md test.tex
Related Question