Bastien,

If your goal is to convert your bibliography file into another bibliographic format, then you can follow this route and write a CSL stylesheet that outputs the desired formatting

My goal is actually going from markdown metadata-style bibliography to BibTeX/BibLaTeX. The implementation already available in Pandoc is great, but I need something more minimal and customizable for my purposes. I believe this can be done using panflute which has Metadata capabilities.

I’m quite unfamiliar with CSL, and have some doubts whether I would actually require it for what I’m trying to achieve here. I would, however, like to understand the current way Pandoc does the markdown to BibLaTeX/LaTeX conversion, so that I can implement a similar pattern in my code. Hence why I am asking questions about how Pandoc internally handles this conversion (using citeproc and such). Does CSL really play a major role within this conversion?

I tried the commands you recommended, but the only difference between the output for pandoc .\bibliography.bib -t markdown -s and pandoc .\bibliography.bib -t markdown-citation -s is that the first command has nocite: "[@*]" and the second command has nocite: \[@\*\]. No additional information is generated with markdown-citation as far as I can tell.

I’m still not sure what citeproc actually does. Furthermore I’m also very confused as to whether CSL plays a role here or not. Any clarifications would be very welcome.

Regards,

Amine


On Fri, 26 Aug 2022 at 10:20, Bastien DUMONT <bastien.dumont@posteo.net> wrote:
By default, when converting to markdown, the "citations" extension is enabled, so the output file is formatted as a Pandoc Markdown file to be processed by citeproc, with the bibliographic data in the YAML header but no formatted citations. nocite lists all the bibliographic items not actually cited in the document that should be included in the bibliography: a value of [@*] means "include all". If you wanted a formatted bibliography in markdown, you could use:

pandoc pandoc .\bibliography.bib -t markdown-citations

(You may or may not have to add -V nocite="[*@]", I have not tested it with a bibliography file.)

If your goal is to convert your bibliography file into another bibliographic format, then you can follow this route and write a CSL stylesheet that outputs the desired formatting. In this case, converting to "plain" (witout "-citations") would be preferable in order to avoid undesired wrapping in divs.

Le Friday 26 August 2022 à 07:31:39AM, A A a écrit :
> Dear John (or anyone else),
>
> Would you please respond to the query below? Or perhaps point to some resources
> I can use online to begin answering the question?
>
> I've searched up and down the official pandoc reference but I really can't find
> a detailed explanation as to what the `--citeproc` flag actually *does*, and
> why the `nocite` key is important in the bibliographic metadata.
>
> Regards,
>
> Amine
>
> On Tue, 23 Aug 2022 at 14:42, A A <[1]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>     In my case, nocite contains a value of "[@*]". Would you please elaborate
>     on what that means?
>     As far as I know using --citeproc or not has no impact on the final result.
>     I tried both variants as shown below:
>
>     pandoc .\bibliography.bib -t markdown -s --citeproc
>     pandoc .\bibliography.bib -t markdown -s
>
>     I get the same output for either command. Both have a nocite of "[@*]".
>
>     On Tue, 26 Jul 2022 at 14:53, John MacFarlane [2]fiddlosopher@gmail.com
>     wrote:
>
>         'blocks' is for the body of the document. We store the reference data
>         in the metadata.  In this case it's all references, so no body.
>
>         The 'nocite' entry causes all the references to be included in the
>         bibliography if you process this with --citeproc.  We include that by
>         default so that you can do e.g.
>
>         pandoc my.bib -s -o my.html --citeproc
>
>         and get a formatted HTML bibliography with all the references.
>
>
>         > On Jul 26, 2022, at 4:47 AM, A A <[3]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>         wrote:
>         >
>         > Dear John,
>         > Indeed, I see that there is an internal representation in the form of
>         a Meta object. I made a dummy bibliography with 4 entries. After
>         converting to JSON the following structure was apparent:
>         >
>         > {
>         >     "pandoc-api-version": [...],
>         >     "meta": {
>         >         "nocite": {...}
>         >         "references":  {...}     
>         >     },
>         >     "blocks": []
>         > }
>         >
>         > references contains a list of MetaMapswhich contain the recognizable
>         BibTeX data. blocks is empty and nocite contains some additional data
>         which I don’t understand.
>         >
>         > What is the role of nocite and blocks in this AST?
>         >
>         > Regards,
>         >
>         > Amine
>         >
>         >
>         > On Mon, 25 Jul 2022 at 18:01, John MacFarlane <[4]
>         fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>         >
>         > If you do `pandoc yourbib.bib -t native -s` then you'll see how
>         pandoc represents bibiographies in its AST.  All you need to do, then,
>         is have your custom reader create this sort of structure in the
>         metadata.
>         >
>         >
>         >
>         > > On Jul 25, 2022, at 6:14 AM, A A <[5]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>         wrote:
>         > >
>         > > Suppose that I would like to define my own markup format, something
>         that is not currently supported by pandoc. I could in theory write my
>         own reader and writer in Lua, making use of pandoc's AST elements, and
>         would then be able to convert to and from this new format to other
>         recognized formats.
>         > >
>         > > I'd like to know whether the same can be said of bibliographic
>         formats. Suppose I have a new one that I would like to bake into
>         pandoc. Since the bibliography seems to be decoupled from the AST, what
>         would be the best way to do this?
>         > >
>         > > --
>         > > You received this message because you are subscribed to the Google
>         Groups "pandoc-discuss" group.
>         > > To unsubscribe from this group and stop receiving emails from it,
>         send an email to [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>         > > To view this discussion on the web visit [7]https://
>         groups.google.com/d/msgid/pandoc-discuss/
>         CAMwawgPP62P6%3DXwLSksRv-X11gW7p1A1%2BUhg824n5HAtE_49vw%40mail.gmail.com
>         .
>         >
>         > --
>         > You received this message because you are subscribed to the Google
>         Groups "pandoc-discuss" group.
>         > To unsubscribe from this group and stop receiving emails from it,
>         send an email to [8]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>         > To view this discussion on the web visit [9]https://groups.google.com
>         /d/msgid/pandoc-discuss/
>         04A5D7A1-B4AD-4A59-AB54-7D5849F23ACA%40gmail.com.
>         >
>         > --
>         > You received this message because you are subscribed to the Google
>         Groups "pandoc-discuss" group.
>         > To unsubscribe from this group and stop receiving emails from it,
>         send an email to [10]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>         > To view this discussion on the web visit [11]https://
>         groups.google.com/d/msgid/pandoc-discuss/
>         CAMwawgOt0AE-ibyTeUv-Ov_9pvNESyQWeqr%2BDwCjDdFQ9xHs%3DA%40mail.gmail.com
>         .
>
>         --
>         You received this message because you are subscribed to the Google
>         Groups "pandoc-discuss" group.
>         To unsubscribe from this group and stop receiving emails from it, send
>         an email to [12]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>         To view this discussion on the web visit [13]https://groups.google.com/
>         d/msgid/pandoc-discuss/5BC2C9A0-8D21-43E6-B00B-99D7BC319AE4%40gmail.com
>         .
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to [14]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [15]https://groups.google.com/d/msgid/
> pandoc-discuss/
> CAMwawgOs%3DbC6eVyWqMs1ae-_334Lgzq43-OhQxGgJPWMmkCyKQ%40mail.gmail.com.
>
> References:
>
> [1] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [2] http://mailto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org/
> [3] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [4] mailto:fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [5] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [6] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [7] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgPP62P6%3DXwLSksRv-X11gW7p1A1%2BUhg824n5HAtE_49vw%40mail.gmail.com
> [8] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [9] https://groups.google.com/d/msgid/pandoc-discuss/04A5D7A1-B4AD-4A59-AB54-7D5849F23ACA%40gmail.com
> [10] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [11] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgOt0AE-ibyTeUv-Ov_9pvNESyQWeqr%2BDwCjDdFQ9xHs%3DA%40mail.gmail.com
> [12] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [13] https://groups.google.com/d/msgid/pandoc-discuss/5BC2C9A0-8D21-43E6-B00B-99D7BC319AE4%40gmail.com
> [14] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [15] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgOs%3DbC6eVyWqMs1ae-_334Lgzq43-OhQxGgJPWMmkCyKQ%40mail.gmail.com?utm_medium=email&utm_source=footer

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/YwiCYQlHqYv1Qo5A%40localhost.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgMRA-Ki8hcj-jrwjBLmgbt8K9OYb3Z_Kz2v1moLCA320g%40mail.gmail.com.