public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: <denis.maier-NSENcxR/0n0@public.gmane.org>
To: <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: AW: Automaticly creating bibliography in md?
Date: Tue, 23 Nov 2021 14:08:57 +0000	[thread overview]
Message-ID: <d0c806be088b4d72ac9123b68330608b@unibe.ch> (raw)
In-Reply-To: <5676cd49db054de980fb31d2f3fda9b4-NSENcxR/0n0@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 11450 bytes --]

Ok. Take this input file:

```
---
author: DM
title: Test
date: 18-Jul-2020
references:
- type: article-journal
  id: WatsonCrick1953
  author:
  - family: Watson
    given: J. D.
  - family: Crick
    given: F. H. C.
  issued:
    date-parts:
    - - 1953
      - 4
      - 25
  title: 'Molecular structure of nucleic acids: a structure for
    deoxyribose nucleic acid'
  title-short: Molecular structure of nucleic acids
  container-title: Nature
  volume: 171
  issue: 4356
  page: 737-738
  DOI: 10.1038/171737a0
  URL: https://www.nature.com/articles/171737a0
  language: en-GB
---

bla bla  [@WatsonCrick1953, 5]
```

Convert with
pandoc inputfile.md -o outputfile.md –citeproc -t markdown-citations
gives me :

```
---
author: DM
date: 18-Jul-2020
references:
- author:
  - family: Watson
    given: J. D.
  - family: Crick
    given: F. H. C.
  container-title: Nature
  DOI: 10.1038/171737a0
  id: WatsonCrick1953
  issue: 4356
  issued:
    date-parts:
    - - 1953
      - 4
      - 25
  language: en-GB
  page: 737-738
  title: "Molecular structure of nucleic acids: a structure for
    deoxyribose nucleic acid"
  title-short: Molecular structure of nucleic acids
  type: article-journal
  URL: https://www.nature.com/articles/171737a0
  volume: 171
title: Test
---

bla bla (Watson and Crick 1953, 5)

::: {#refs .references .csl-bib-body .hanging-indent}
::: {#ref-WatsonCrick1953 .csl-entry}
Watson, J. D., and F. H. C. Crick. 1953. "Molecular Structure of Nucleic
Acids: A Structure for Deoxyribose Nucleic Acid." *Nature* 171 (4356):
737--38. https://doi.org/10.1038/171737a0.
:::
:::
```

Denis


Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von denis.maier-NSENcxR/0n0@public.gmane.org
Gesendet: Dienstag, 23. November 2021 15:03
An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Betreff: AW: Automaticly creating bibliography in md?

Not sure, but the xml is your style file.
Can only guess since I don’t have your bibfile, but maybe the command line arguments were a bit messed up :
pandoc inputfile.md -o inputfile.md --csl sage-harvard.csl --citeproc -t markdown-citations
Add a = between --csl and the style => --csl=sage-harvard.csl
Or, can also just omit the style since you have that in your markdown files anyway.

But, if you want the bibliography to appear like in your sublime example, you’ll need to use a filter for this.

Denis


Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>> Im Auftrag von Alan
Gesendet: Dienstag, 23. November 2021 14:09
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discuss@googlegroups.com>>
Betreff: Re: Automaticly creating bibliography in md?


Sure.
I noticed that my yaml is missing. The same file, before this command, produce normal pdf and word output

Note: sublime.md is the same note I generated auto bibliography in ST
On Tuesday, November 23, 2021 at 1:48:33 PM UTC+1 denis...-NSENcxR/0n0@public.gmane.org<mailto:denis...-NSENcxR/0n0@public.gmane.org> wrote:
Can you post a real example?

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>> Im Auftrag von Alan
Gesendet: Dienstag, 23. November 2021 13:45
An: pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...@googlegroups.com>>
Betreff: Re: Automaticly creating bibliography in md?

I am afraid I miss something here. I try the command, ad receive huge xml code in the end + my citation is like this

\[@alexanderTheoryCulturalTrauma2004, 1\]

> P.S. : Why do you use reference-doc here? You’re converting from markdown to markdown.
My bad, I just copy from my docx command :-)

On Tuesday, November 23, 2021 at 10:35:25 AM UTC+1 denis...-NSENcxR/0n0@public.gmane.org<mailto:denis...-NSENcxR/0n0@public.gmane.org> wrote:
Well, IIUC, pandoc works from an input file to an output file.
If you have your references in your metadata you can probably just do this :

pandoc inputfile.md -o inputfile.md –csl sage-harvard.csl –citeproc -t markdown-citations

(The important part is `-t markdown-citations`. That’s a big counter-intuitive : It does not mean « give me a markdown file without citations» , but rather « give me a markdown file without the citations extension, i.e., with citations being resolved ».)

If that does not work, convert to a temp file first, then rename. You can automate the process with a script or makefile.

Denis

P.S. : Why do you use reference-doc here? You’re converting from markdown to markdown.


Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>> Im Auftrag von Alan
Gesendet: Dienstag, 23. November 2021 10:28
An: pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...@googlegroups.com>>
Betreff: Re: Automaticly creating bibliography in md?

I know (and use) this command

pandoc --reference-doc my-reference.docx -s text1.md --citeproc --csl sage-harvard.csl -o text2.md

and my bib file is referenced in YAML head.
The question is how to achieve to have bibliography in SAME file I am working with?
I have an animated gif in imgur to show the process, but google doesn't let me post link, message is automatically deleted.

On Tuesday, November 23, 2021 at 10:11:59 AM UTC+1 denis...-NSENcxR/0n0@public.gmane.org<mailto:denis...-NSENcxR/0n0@public.gmane.org> wrote:
You will need to specify your reference library, of course.
--bibliography=you_bibfile.bib

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>> Im Auftrag von denis...-NSENcxR/0n0@public.gmane.org<mailto:denis...-NSENcxR/0n0@public.gmane.org>
Gesendet: Dienstag, 23. November 2021 10:11
An: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: AW: Automaticly creating bibliography in md?

Sure, you can convert from markdown to markdown with resolved citations.

pandoc inputfile.md -o outputfile-md -C -t markdown-citations

Denis

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>> Im Auftrag von Alan
Gesendet: Dienstag, 23. November 2021 10:08
An: pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-...@googlegroups.com>>
Betreff: Automaticly creating bibliography in md?

Hi,
In sublime_zk package for Sublime Text, you can create auto bibliography from citations in document and place it at the end of current .md document. Is it possible to do that with command or some script, which can be executed in Windows 10 :-)
Thanks
--
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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discus...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ac73582b-8acc-469a-94ff-38160275d4a1n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/ac73582b-8acc-469a-94ff-38160275d4a1n%40googlegroups.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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discus...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/504e0de4e201441ea14525b281bba30c%40unibe.ch<https://groups.google.com/d/msgid/pandoc-discuss/504e0de4e201441ea14525b281bba30c%40unibe.ch?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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discus...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ab3295e2-0e57-459f-a626-84b632f02ef6n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/ab3295e2-0e57-459f-a626-84b632f02ef6n%40googlegroups.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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discus...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a24adbdb-f2ef-4bbc-8199-5aab0bee653cn%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/a24adbdb-f2ef-4bbc-8199-5aab0bee653cn%40googlegroups.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<mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5bec2468-843a-4196-ada8-7b42200dc2d6n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/5bec2468-843a-4196-ada8-7b42200dc2d6n%40googlegroups.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<mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5676cd49db054de980fb31d2f3fda9b4%40unibe.ch<https://groups.google.com/d/msgid/pandoc-discuss/5676cd49db054de980fb31d2f3fda9b4%40unibe.ch?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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d0c806be088b4d72ac9123b68330608b%40unibe.ch.

[-- Attachment #2: Type: text/html, Size: 34397 bytes --]

  parent reply	other threads:[~2021-11-23 14:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AQHX4EmdUkyuGVJXmkeJzQdUDcZ8NawQ0w0wgAAAejD///PhAIAAESEggAAl94CAABGvUP//9QOAgAAemMCAAAJK0IAAAgGAgAE5aNCAAAF0kIAAAWpQ>
     [not found] ` <AQHX4EmdUkyuGVJXmkeJzQdUDcZ8NawQ0w0wgAAAejD///PhAIAAESEggAAl94CAABGvUP//9QOAgAAemMCAAAJK0A==>
     [not found]   ` <AQHX4EmdUkyuGVJXmkeJzQdUDcZ8NawQ0w0wgAAAejD///PhAIAAESEggAAl94CAABGvUA==>
     [not found]     ` <AQHX4EmdUkyuGVJXmkeJzQdUDcZ8NawQ0w0wgAAAejD///PhAIAAESEg>
     [not found]       ` <AQHX4EmdUkyuGVJXmkeJzQdUDcZ8NawQ0w0wgAAAejA=>
2021-11-23  9:07         ` Alan
     [not found]           ` <ac73582b-8acc-469a-94ff-38160275d4a1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-23  9:10             ` AW: " denis.maier-NSENcxR/0n0
     [not found]               ` <504e0de4e201441ea14525b281bba30c-NSENcxR/0n0@public.gmane.org>
2021-11-23  9:11                 ` denis.maier-NSENcxR/0n0
     [not found]                   ` <77539b7686aa450cb87fb3ec489410e0-NSENcxR/0n0@public.gmane.org>
2021-11-23  9:27                     ` Alan
     [not found]                       ` <ab3295e2-0e57-459f-a626-84b632f02ef6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-23  9:35                         ` AW: " denis.maier-NSENcxR/0n0
     [not found]                           ` <e7e3e37f41254e9687d781f28454054d-NSENcxR/0n0@public.gmane.org>
2021-11-23 12:44                             ` Alan
     [not found]                               ` <a24adbdb-f2ef-4bbc-8199-5aab0bee653cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-23 12:48                                 ` AW: " denis.maier-NSENcxR/0n0
     [not found]                                   ` <ddf8ad0d1ac1492b8f0298fbc8972404-NSENcxR/0n0@public.gmane.org>
2021-11-23 13:08                                     ` Alan
     [not found]                                       ` <5bec2468-843a-4196-ada8-7b42200dc2d6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-23 14:03                                         ` AW: " denis.maier-NSENcxR/0n0
     [not found]                                           ` <5676cd49db054de980fb31d2f3fda9b4-NSENcxR/0n0@public.gmane.org>
2021-11-23 14:08                                             ` denis.maier-NSENcxR/0n0 [this message]
     [not found]                                               ` <d0c806be088b4d72ac9123b68330608b-NSENcxR/0n0@public.gmane.org>
2021-11-23 15:13                                                 ` Alan
     [not found]                                                   ` <7181c39d-c239-4a63-bbae-800bc4d8b523n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-24  8:59                                                     ` AW: " denis.maier-NSENcxR/0n0
     [not found]                                                       ` <bb5a3b682ae748a09280ba75cb8b05c3-NSENcxR/0n0@public.gmane.org>
2021-11-24  9:01                                                         ` denis.maier-NSENcxR/0n0
     [not found]                                                           ` <efd32a748f6f4f00877746b83932f0bd-NSENcxR/0n0@public.gmane.org>
2021-11-24  9:05                                                             ` denis.maier-NSENcxR/0n0
     [not found]                                                               ` <b42ae61e3dcf498fb3a3e0ec82f1bb91-NSENcxR/0n0@public.gmane.org>
2021-11-24 16:09                                                                 ` Alan
     [not found]                                                                   ` <14327db1-9d76-448b-a4ae-e11a74cccc37n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-24 16:23                                                                     ` AW: " denis.maier-NSENcxR/0n0
2021-11-24 17:23                                                         ` John MacFarlane
     [not found]                                                           ` <m21r35v55t.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-11-25  8:49                                                             ` Alan
     [not found]                                                               ` <224d053e-b400-4ca7-87a0-4086ce0aa8efn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-25  9:03                                                                 ` AW: " denis.maier-NSENcxR/0n0
     [not found]                                                                   ` <053b6935558c434a9ae35c71b76a2010-NSENcxR/0n0@public.gmane.org>
2021-11-25 18:03                                                                     ` Alan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0c806be088b4d72ac9123b68330608b@unibe.ch \
    --to=denis.maier-nsencxr/0n0@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).