-
-
Notifications
You must be signed in to change notification settings - Fork 61
Allow multiple/sectioned bibliographies #89
Comments
While I would like to see this in pandoc-citeproc proper, I have written a script (in dfaligertwood/pandoc-filters) that begins to implement this functionality. It is not really usable in its current form (see the exemplars in the readme), but if anyone knows a way to run pandoc-citeproc without it outputting a bibliography, it could be usable, albeit in a slightly hacky manner. EDIT: The filter in question is 'pandoc-multibib.' link to repo: https://github.com/dfaligertwood/pandoc-filters |
Finally got around to finishing pandoc-multibib. I haven't really tested it yet, but should work OK. You need to make a 'complete' bibliography, and then a number of files with the items you'd like to appear in each section. If something appears in the complete bibliography file but not in one of the sectional bibliographies, then it will still be referenced in-text but won't appear in the final reference list. |
It would also be great to section bibliographies, because when there is more than 3 or 4 references, they can not fit in a single slide (beamer / revealjs / whatever) |
@dfaligertwood Did this ever get merged in? |
@sid-kap It's not a patch for pandoc-citeproc itself, so wouldn't be included - it's a seperate filter which then (ab)uses pandoc-citeproc to actually do the citations. Not sure if it still works, as I don't have a use for it at the moment so haven't maintained it. Give it a go and feel free to hit me up if you have any issues: dfaligertwood/pandoc-filters |
I'm trying to use it, but cannot get it to compile. I know nothing about Haskell, so I struggle a little. If you can make the required changes so that it compiles, I can test it. Thanks! |
By the way, is it possible to use \nocite in some way with this filter? |
Sorry to bring this up again, but has this been addressed? I believe the hacky scripts were meant to be a temporary workaround until this is supported by If there is a better way to achieve this please let me know. Thanks! |
The workaround I use is a LateX file that I use in addition to the md document. It is sufficient for a CV, in which you have to separate journals, conferences, workshops, etc. |
is it still possible to use |
I mean I produce the regular document with pandoc, and the bibliography part separately, then merge PDFs. This means I cannot cite the refs in the document. This is the (strong) limitation of this method. |
The whole point is to be able to use pandoc support for citing, otherwise I'd rather use Thanks anyways, hope this gets some attention in the near future. |
I think the general approach pandoc-multibib takes is actually a pretty reasonable one, and it seems perfectly reasonable for this special case to be handled using another filter (applied after pandoc-citeproc in the filter chain). I have not tried pandoc-multibib myself. If there are problems compiling it, perhaps it needs some updating, or to make it easier for everyone, rewriting as a lua filter. For reference, here's an example of how pandoc-multibib works. You specify multiple bibliographies, together with their titles, in addition to a main bibliography.
Presumably the main bibliography would just be the concatenation of the subsidiary ones. If this functionality were to be included in pandoc-citeproc, it could work in a similar way, but a little more conventently: if there's no Another approach would be to use the |
I agree, both suggestions sound pretty solid. The before mentioned scripts are pretty old too. As I have no experience with Haskell, I couldn't get them to compile and wasted several hours on this (tried whenever the solution is to rewrite the scripts or add it to I just want to write my paper with markdown and be done with it 😭 Thanks! |
pandoc-multibib compiles fine for me.
You should have pandoc-multibib executable. |
I did something similar with a I specify rules for splitting the bibliography in the metadata block as such: ---
splitbib:
- title: Primary Sources
rule: keyword=primary
- title: Secondary Sources
rule: notkeyword=primary
--- These rules are then handled by the following code in a latex template: $if(bibliography)$
$if(biblio-title)$\renewcommand{\bibname}{$biblio-title$}$endif$
$if(splitbib)$
\chapter{\bibname}
$for(splitbib)$
\section{$splitbib.title$}
\printbibliography[heading=none,$splitbib.rule$]
$endfor$
$else$
\chapter{\bibname}
\printbibliography[heading=none]
$endif$
$endif$ I believe that specifying rules explicitly in metadata is far more flexible than relying only on information contained in bibliography files (as do both approaches discussed so far), since it allows handling the same bibliography differently in different documents. |
I've just updated the cabal file for pandoc-multibib, so it should at least now compile without too much fuss. I'm not in academia any more (unless anyone knows of a funded PhD going spare), so I have no particular need for it, but I have free time atm so may do some more work to implement the suggestions of embedded bibliographies and/or auto-concatenation. I'm not sure how everyone else manages their citation DBs, but w.r.t. pandoc-multibib I used to keep everything in one 'global' zotero DB and then use a json filter to split out primary/secondary sources, hence the architecture. Just for clarity, pandoc-multibib actually acts as a wrapper around pandoc-citeproc. This does result in some slightly confusing behaviour - specifically, items will not be in the bibliography unless they are cited in the text (or in the nocite key) @shiro, just for reference - in future if you have issues compiling, just raise an issue on my repo or at me directly. |
Oh, I just learned about pandoc-multibib – very cool! |
Ah, nice! I think you've used the same method I did, and being lua it doesn't require compilation so is probably the best option for non-techie users. |
The idea of allowing for a bibliography that can be broken down into headings has come up on pandoc-discuss a couple of times (there is a very good thread on it from 2010, and I asked about it in August); it would be extremely useful for the many situations that require lists of resources on a number of topics (see e.g. a course site I made up), annotated bibliographies, or publications that ask items in a bibliography to be categorized in some way (e.g. many historical publications distinguish between primary sources and secondary works).
I hope it's not presumptuous of me to put in a request for this; there are some references to a
bibsection
capability in https://github.com/jgm/pandoc-citeproc/blob/master/tests/test-citeproc.hs#L34, but I assume these could be removed if there is no intent to implement this. A simpler alternative would be to implement something that works in reverse to thenocite
option, omitting the specified items from the reference list, which would at least make it easier to deal with two bibliographies in a paper.The text was updated successfully, but these errors were encountered: