1

I'm trying to get Teaching Tech Together ready for publication. The PDF is looking OK, but I'm struggling to get an HTML that I'm happy with, and I'm hoping someone can help. My LaTeX file contains this:

\usepackage[backend=biber,style=alphabetic,sorting=nyt,maxbibnames=99]{biblatex}
\addbibresource{book.bib}

My BibTeX file contains entries like:

@inproceedings{Bacc2013,
  author = {Alberto Bacchelli and Christian Bird},
  title = {Expectations, Outcomes, and Challenges of Modern Code Review},
  booktitle = {2013 International Conference on Software Engineering ({ICSE'13})},
  year = {2013},
  month = {5},
  local = {bacchelli-2013-code-review.pdf},
  note = {A summary of work on code review.}
}

and I compile everything with:

$ pdflatex book.tex
$ biber book
$ pdflatex book.tex
$ pdflatex book.tex

Citations in the body of the PDF use the BibTeX key as the citation key:

Debugging depends on being able to read code, which multiple studies have
shown is the single most effective way to find bugs [Basi1987; Keme2009;
Bacc2013]. The code quality rubric developed in [Steg2014; Steg2016a], which is
online at [Steg2016b], is a good checklist of things to look for, though it is best
presented in chunks rather than all at once.

The bibliography uses the citation key as well, and includes the note field. (I would rather it came after the date, but I'm trying not to ask for the moon.)

[Bacc2013] Alberto Bacchelli and Christian Bird. "Expectations, Outcomes, and
    Challenges of Modern Code Review". In: 2013 International Conference on
    Software Engineering (ICSE’13). A summary of work on code review. May 2013.

How can I replicate this with Pandoc? My command line is:

$ pandoc -s --css=assets/bootstrap.css --css=assets/book.css --toc --toc-depth=2 \
  --template=template.html --bibliography=book.bib \
  -o index.html book.tex

where template.html is a copy of Pandoc's default HTML template lightly tweaked to use Bootstrap CSS. I would like the resulting HTML to use the BibTeX citation key in both the body and the bibliography. (I would also like citations to hyperlink to the bibliography entry, and bibliography entries to include the note field, but one step at a time...) What is the magic I'm looking for?

mb21
  • 34,845
  • 8
  • 116
  • 142
Greg Wilson
  • 1,015
  • 10
  • 24
  • Note: source available in https://github.com/gvwilson/teachtogether.tech/ – Greg Wilson May 26 '19 at 20:54
  • The recommended way is to use markdown input and produce the tex and html from that, see https://pandoc.org/MANUAL.html#citations But maybe it's possible coming from LaTeX as well... – mb21 May 27 '19 at 10:47
  • Note: I am aware of the `--csl` option to Pandoc, and have looked for an appropriate CSL file using https://editor.citationstyles.org/searchByExample/, but have come up dry. – Greg Wilson May 27 '19 at 11:56
  • ah, so you need to write your own csl file then? (maybe try with another csl file to see whether it has an effect) maybe state this clearly in the question and add the CSL tag... or ask on pandoc-discuss. – mb21 May 27 '19 at 13:19
  • I'm really hoping I *don't* have to write a CSL file to accomplish this... – Greg Wilson May 27 '19 at 18:03

1 Answers1

0

In order to produce the same citations across all output formats, pandoc uses the built-in pandoc-citeproc filter, instead of relying on LaTeX. That means also that you cannot use LaTeX to influence citation output:

From the pandoc manual:

Citations and references can be formatted using any style supported by the Citation Style Language, listed in the Zotero Style Repository. These files are specified using the --csl option or the csl metadata field. By default, pandoc-citeproc will use the Chicago Manual of Style author-date format. The CSL project provides further information on finding and editing styles.

See also this answer on tex.stackexchange.

mb21
  • 34,845
  • 8
  • 116
  • 142
  • Thank you - I have modified my command line to include --csl=chicago.csl, where chicago.csl is downloaded from http://www.zotero.org/styles/chicago-fullnote-bibliography-16th-edition and modified as per https://tex.stackexchange.com/questions/271445/use-note-field-in-bibtex-with-cms-via-pandoc. This includes the 'note' field, but does not use the BibTeX key as the citation key, and formats the first author's name as "surname, forename" instead of "forename surname". My attempts to hack the .csl file to solve these two problems have failed so far :-( – Greg Wilson May 29 '19 at 08:56
  • 1
    I'm afraid there's no way to get the citation key with CSL currently -- it just doesn't exist as a variable, so no way to write this into the style. (the forename/surname order would be easy to change & I'm happy to help with that if that'd still be of interest) – adam.smith May 30 '19 at 00:37