public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Kaushal Modi <kaushal.modi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Convert from existing markdown to markdown with citations expanded (with few conditions)
Date: Tue, 17 Jul 2018 14:44:31 -0700 (PDT)	[thread overview]
Message-ID: <ad23b28d-ca24-4470-8d98-88da976f4e4e@googlegroups.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 5914 bytes --]

Hello,

I have this markdown file (which I generate from an Org file using ox-hugo 
exporter in Emacs):


---
title: "Org Pandoc Citation Test Example"
draft: false
bibliography: "example.bib"
nocite: "@giovanelli2016; @eilan2016"
---

## Test Header {#test-header}

Here is a test example file with an in-text citation where someone
important says something important (e.g. @loncar2016). And here is
another bit of blah with a footnote citation.[^fn:1]


## References {#references}

[^fn:1]: See [@thompson2016].

How can I export that to Markdown itself via Pandoc so that:

(1) OK - The YAML front-matter is retained as is.
(2) NOT OK - The citations get lost!
(3) OK - The footnote style stays the same [^N] or [^fn:N]

I tried these, but I cannot get an output that satisfies the above 3 
conditions:

Try 1: *pandoc -f markdown -t markdown -o org-citation-example-md.md 
--bibliography example.bib --atx-headers --standalone 
org-citation-example-source.md*

---
bibliography: 'example.bib'
draft: False
nocite: '@giovanelli2016; @eilan2016'
title: Org Pandoc Citation Test Example
---

## Test Header

Here is a test example file with an in-text citation where someone
important says something important (e.g. @loncar2016). And here is
another bit of blah with a footnote citation.[^1]

## References {#references .unnumbered}

[^1]: See [@thompson2016].

(1) YAML data is rearranged, but is fine.
(2) The citations do not get expanded.
(3) The footnote style is good ([^N])

Try 2: *pandoc -f markdown -t gfm -o org-citation-example-gfm.md 
--bibliography example.bib --atx-headers --standalone 
org-citation-example-source.md*

## Test Header

Here is a test example file with an in-text citation where someone
important says something important (e.g. Loncar (2016)). And here is
another bit of blah with a footnote citation.\[1\]

## References

<div id="refs" class="references">

<div id="ref-eilan2016">

Eilan, Naomi. 2016. “You Me and the World.” *Analysis* 76 (3): 311–24.

</div>

<div id="ref-giovanelli2016">

Giovanelli, Marco. 2016. “"...But I Still Can’t Get Rid of a Sense of
Artificiality" the Reichenbach–Einstein Debate on the Geometrization of
the Electromagnetic Field.” *Studies in History and Philosophy of
Science* 54: 35–51.

</div>

<div id="ref-loncar2016">

Loncar, Samuel. 2016. “Why Listen to Philosophers? A Constructive
Critique of Disciplinary Philosophy.” *Metaphilosophy* 47 (1): 3–25.

</div>

<div id="ref-thompson2016">

Thompson, Morgan, Toni Adleberg, Sam Sims, and Eddy Nahmias. 2016. “Why
Do Women Leave Philosophy? Surveying Students at the Introductory
Level.”

</div>

</div>

1.  See (Thompson et al. 2016).


(1) NOT OK - The YAML data is lost!
(2) OK - The citations get expanded using the referenced bibliography, 
respecting nocite.
(3) NOT OK - The footnote style won't work.. needs to be [^N] or [^fn:N].



---


Is it possible to get the final Markdown with all 3 of those conditions 
satisfied? 

Thanks!


---

Here's the example.bib:


@article{giovanelli2016,
  title = {"...{{But I}} Still Can't Get Rid of a Sense of Artificiality" 
{{The Reichenbach}}–{{Einstein}} Debate on the Geometrization of the 
Electromagnetic Field},
  volume = {54},
  journaltitle = {Studies in History and Philosophy of Science},
  date = {2016},
  pages = {35--51},
  keywords = {Einstein,physics,science},
  author = {Giovanelli, Marco},
  file = 
{/Users/roambot/Dropbox/Work/MasterLib/giovanelli2016_the_reichenbach–einstein_debate.pdf}
}

@article{eilan2016,
  title = {You {{Me}} and the {{World}}},
  volume = {76},
  number = {3},
  journaltitle = {Analysis},
  date = {2016},
  pages = {311--324},
  author = {Eilan, Naomi},
  file = 
{/Users/roambot/Dropbox/Work/MasterLib/eilan2016_you_me_and_the_world.pdf}
}

@article{loncar2016,
  title = {Why {{Listen}} to {{Philosophers}}? {{A Constructive Critique}} 
of {{Disciplinary Philosophy}}},
  volume = {47},
  number = {1},
  journaltitle = {Metaphilosophy},
  date = {2016},
  pages = {3--25},
  author = {Loncar, Samuel},
  file = 
{/Users/roambot/Dropbox/Work/MasterLib/loncar2016_why_listen_to_philosophers.pdf}
}

@article{thompson2016,
  title = {Why {{Do Women Leave Philosophy}}? {{Surveying Students}} at the 
{{Introductory Level}}},
  abstract = {Abstract Although recent research suggests that women are 
underrepresented in philosophy after initial philosophy courses, there have 
been relatively few empirical investigations into the factors that lead to 
this early drop-off in women's representation. In this paper, we.},
  date = {2016},
  author = {Thompson, Morgan and Adleberg, Toni and Sims, Sam and Nahmias, 
Eddy},
  file = 
{/Users/roambot/Dropbox/Work/MasterLib/thompson2016_why_do_women_leave_philosophy.pdf}
}

@article{fricker2016,
  title = {What's the {{Point}} of {{Blame}}? {{A Paradigm Based 
Explanation}}: {{What}}'s the {{Point}} of {{Blame}}},
  volume = {50},
  number = {1},
  journaltitle = {Noûs},
  date = {2016},
  pages = {165--183},
  author = {Fricker, Miranda},
  file = 
{/Users/roambot/Dropbox/Work/MasterLib/fricker2016_what's_the_point_of_blame.pdf}
}

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ad23b28d-ca24-4470-8d98-88da976f4e4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 7820 bytes --]

             reply	other threads:[~2018-07-17 21:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 21:44 Kaushal Modi [this message]
     [not found] ` <ad23b28d-ca24-4470-8d98-88da976f4e4e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-07-17 21:48   ` Kaushal Modi
     [not found]     ` <681c8a02-764e-4cbe-b3e7-93809b5e5a41-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-07-18 15:39       ` Kaushal Modi
2018-07-19 16:48   ` John MacFarlane
     [not found]     ` <yh480kzhyn2mue.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-07-19 16:55       ` Kaushal Modi

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=ad23b28d-ca24-4470-8d98-88da976f4e4e@googlegroups.com \
    --to=kaushal.modi-re5jqeeqqe8avxtiumwx3w@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).