4

I want to write a markdown file with references @ref (and a BibTeX database). When sending the file around, it should be converted to a stand alone markdown file containing rendered references. The rendered reference key should not be numeric, but alphanumeric.

Minimal example:

minimal.md:

@PTDL2008

minimal.bib:

@article{PTDL2008,
  title                    = {{Service-Oriented Computing: State of the Art and Research Challenges}},
  author                   = {Michael P. Papazoglou and Paolo Traverso and Schahram Dustdar and Frank Leymann},
  journal                  = {International Journal of Cooperative Information Systems (IJCIS)},
  year                     = {2008},
  month                    = {June},
  number                   = {2},
  pages                    = {233--255},
  volume                   = {17},
  doi                      = {10.1109/MC.2007.400}
}

Get DIN 1505-2 (alphanumeric, German) and store it in the same directory.

Command line call:

pandoc minimal.md -o minimal-new.md --atx-headers --bibliography="minimal.bib" --csl=din-1505-2-alphanumeric.csl

The result output is

pandoc-citeproc reference with no printed form

The generated minimal-new.md does not contain a rendered reference.

2

Per this thread on the pandoc-discuss mailing list, you should be able to expand the references by adding

-t markdown-citations

to your pandoc arguments. This translates to "markdown minus citations" -- that is, you're disabling the citations extension in the output format, so the citation key will be expanded in the output. (At least, this is how I interpret it.)

I've tried this with your minimal example and pandoc version 1.17.0.2, and it produced the following output:

**???**

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

<div id="ref-PTDL2008">

<span style="font-variant:small-caps;">Papazoglou, Michael P.</span> ;
<span style="font-variant:small-caps;">Traverso, Paolo</span> ; <span
style="font-variant:small-caps;">Dustdar, Schahram</span> ; <span
style="font-variant:small-caps;">Leymann, Frank</span>: Service-Oriented
Computing: State of the Art and Research Challenges. In: *International
Journal of Cooperative Information Systems (IJCIS)* Bd. 17 (2008),
Nr. 2, S. 233–255

</div>

</div>

So, the reference was formatted, but contains HTML tags for things that markdown can't do natively. If you want "pure" markdown, you need to disable some more extensions in your output specifier -- use

-t markdown-raw_html-citations-native_divs-native_spans

and you'll get

**???**

PAPAZOGLOU, MICHAEL P. ; TRAVERSO, PAOLO ; DUSTDAR, SCHAHRAM ; LEYMANN,
FRANK: Service-Oriented Computing: State of the Art and Research
Challenges. In: *International Journal of Cooperative Information
Systems (IJCIS)* Bd. 17 (2008), Nr. 2, S. 233–255

Now the "small caps" mandated by the CSL file have now been approximated using plain old capitals.

Unfortunately, this only gets you halfway to a solution: the bibliographic entry is formatted correctly, but for some reason the in-text citation itself just comes out as **???**. As yet, I haven't found a solution to this.

0

According to https://github.com/jgm/pandoc-citeproc/issues/195 that means, that a reference was not found.

But to me the example looks ok. As also mentioned in the issue it is dependent on the provided csl-file. I would recommend to check it with no --csl specified and using the default citation style, this should produce a more understandable output.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.