public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Convert from existing markdown to markdown with citations expanded (with few conditions)
@ 2018-07-17 21:44 Kaushal Modi
       [not found] ` <ad23b28d-ca24-4470-8d98-88da976f4e4e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Kaushal Modi @ 2018-07-17 21:44 UTC (permalink / raw)
  To: pandoc-discuss


[-- 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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Convert from existing markdown to markdown with citations expanded (with few conditions)
       [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-19 16:48   ` John MacFarlane
  1 sibling, 1 reply; 5+ messages in thread
From: Kaushal Modi @ 2018-07-17 21:48 UTC (permalink / raw)
  To: pandoc-discuss


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

Sorry, while typing that long post, I misplaced the list of conditions. Let 
me try to clarify that:

Required list of conditions:

(1) The YAML front-matter is retained as is.
(2) The citations get expanded using the referenced bibliography, 
respecting nocite.
(3) The footnote style stays the same [^N] or [^fn:N]

Status of above conditions for *markdown* output:

(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]

Status of above conditions for *gfm* output:

(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].

-- 
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/681c8a02-764e-4cbe-b3e7-93809b5e5a41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Convert from existing markdown to markdown with citations expanded (with few conditions)
       [not found]     ` <681c8a02-764e-4cbe-b3e7-93809b5e5a41-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-07-18 15:39       ` Kaushal Modi
  0 siblings, 0 replies; 5+ messages in thread
From: Kaushal Modi @ 2018-07-18 15:39 UTC (permalink / raw)
  To: pandoc-discuss


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

I am basically looking for a way to use pandoc to **only** replace the 
citation annotations in a Markdown file (using the provided bibliography 
file) and leave everyone else as-is (YAML, footnotes, whole Markdown 
markup).

Is that possible?

-- 
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/0ecb37c4-0b06-44bc-8044-cbcd4daf895d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Convert from existing markdown to markdown with citations expanded (with few conditions)
       [not found] ` <ad23b28d-ca24-4470-8d98-88da976f4e4e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2018-07-17 21:48   ` Kaushal Modi
@ 2018-07-19 16:48   ` John MacFarlane
       [not found]     ` <yh480kzhyn2mue.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2018-07-19 16:48 UTC (permalink / raw)
  To: Kaushal Modi, pandoc-discuss


Try:

pandoc -f markdown -t markdown-citations

`markdown-citations` means "pandoc markdown without the
citations extension."  This will cause citations to be
expanded instead of being included as markdown citations.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Convert from existing markdown to markdown with citations expanded (with few conditions)
       [not found]     ` <yh480kzhyn2mue.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2018-07-19 16:55       ` Kaushal Modi
  0 siblings, 0 replies; 5+ messages in thread
From: Kaushal Modi @ 2018-07-19 16:55 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss

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

Thanks John.

That worked!

On Thu, Jul 19, 2018 at 12:48 PM John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

>
> Try:
>
> pandoc -f markdown -t markdown-citations
>
> `markdown-citations` means "pandoc markdown without the
> citations extension."  This will cause citations to be
> expanded instead of being included as markdown citations.
>
> --

Kaushal Modi

-- 
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/CAFyQvY1jVu5wXWRV6vBHyQBWp_Q_sL-VZx%3D-Hmwy4NLVb%2B6yaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-19 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 21:44 Convert from existing markdown to markdown with citations expanded (with few conditions) Kaushal Modi
     [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

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).