rootstock icon indicating copy to clipboard operation
rootstock copied to clipboard

Citing specific book pages with Manubot

Open lubianat opened this issue 5 years ago • 1 comments

Hello,

First of all, thank you very much! Manubot made my workflow of scientific writing much easier.

In my last manubot manuscript, I wanted to r_eference a specific page of a book,_ but did not find an easy way of doing it.

It always upset me to see references to whole books (how the hell I'm supposed to find that mention in a 400+ page book, right?).

Is something like that already implemented? If not, do you think something like that can be implemented?

lubianat avatar Sep 11 '20 11:09 lubianat

Pandoc support citation locators, which sounds like your use case. From https://pandoc.org/MANUAL.html#citations

Citations go inside square brackets and are separated by semicolons. Each citation must have a key, composed of '@' + the citation identifier from the database, and may optionally have a prefix, a locator, and a suffix. The citation key must begin with a letter, digit, or _, and may contain alphanumerics, _, and internal punctuation characters (:.#$%&-+?<>~/). Here are some examples:

Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].

Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].

Blah blah [@smith04; @doe99].

pandoc-citeproc detects locator terms in the CSL locale files. Either abbreviated or unabbreviated forms are accepted. In the en-US locale, locator terms can be written in either singular or plural forms, as bookbk./bks.chapterchap./chaps.columncol./cols.figurefig./figs.foliofol./fols.numberno./nos.linel./ll.noten./nn.opusop./opp.pagep./pp.paragraphpara./paras.partpt./pts.sectionsec./secs.sub verbos.v./s.vv.versev./vv.volumevol./vols./¶¶§/§§. If no locator term is used, "page" is assumed.

pandoc-citeproc will use heuristics to distinguish the locator from the suffix. In complex cases, the locator can be enclosed in curly braces (using pandoc-citeproc 0.15 and higher only):

[@smith{ii, A, D-Z}, with a suffix]
[@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]

The default manubot CSL doesn't actually show locators in the rendered numeric citations. But at least they'd be in the source. You might be able to find an alternative style that does show them or edit the manubot style to include them.

dhimmel avatar Sep 11 '20 12:09 dhimmel