I'm trying to convert a Latex file to a markdown format with pandoc 3.1
but the resulting markdown file doesn't generate the title nor the references properly. I'm kind of at my wits end here as nothing I do seems to have the correct output. I'm not sure how to proceed. I'll provide a minimal example below:
main.tex
\documentclass{article}
\title{title}
\author{}
\affil{}
\date{}
\begin{document}
\maketitle
\section{Summary}
Sentence one \cite{gavison1980privacy, martin2017role}. \cite{westin1968privacy} sentence two.
\bibliographystyle{apa}
\bibliography{references}
\end{document}
references.bib
@article{gavison1980privacy,
title={Privacy and the Limits of Law},
author={Gavison, Ruth},
journal={The Yale law journal},
volume={89},
number={3},
pages={421--471},
year={1980},
publisher={JSTOR}
}
@article{martin2017role,
title={The role of data privacy in marketing},
author={Martin, Kelly D and Murphy, Patrick E},
journal={Journal of the Academy of Marketing Science},
volume={45},
pages={135--155},
year={2017},
publisher={Springer US}
}
@article{westin1968privacy,
title={Privacy and freedom},
author={Westin, Alan F},
journal={Washington and Lee Law Review},
volume={25},
number={1},
pages={166},
year={1968}
}
I'm using the following pandoc command:
pandoc -o output.md main.tex --bibliography=references.bib
I've also tried adding the apa.csl
and adding a --csl=apa.csl
in the pandoc command. No dice.
The output is always the following with no title or references:
# Summary
Sentence one [@gavison1980privacy; @martin2017role]. @westin1968privacy
sentence two.
I'd want something like the following:
---
title: "titl"
author: ""
date: ""
bibliography: references.bib
csl: apa.csl
---
# Privacy Metrics
## Summary
Sentence one (Gavison, 1980; Martin & Murphy, 2017). Westin (1968) sentence two.
## References
<div id="refs" class="references">
<div id="ref-gavison1980privacy">
Gavison, R. (1980). Privacy and the Limits of Law. *The Yale law journal*, *89*(3), 421–471. https://doi.org/10.2307/795662
</div>
<div id="ref-martin2017role">
Martin, K. D., & Murphy, P. E. (2017). The role of data privacy in marketing. *Journal of the Academy of Marketing Science*, *45*, 135–155. https://doi.org/10.1007/s11747-016-0496-x
</div>
<div id="ref-westin1968privacy">
Westin, A. F. (1968). Privacy and freedom. *Washington and Lee Law Review*, *25*(1), 166.
</div>
</div>
--standalone
to get the title and bib information in a header.