public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* yaml_metadata_block and bibliography
@ 2018-05-02 14:57 Stephen Mildenhall
       [not found] ` <856c6edc-e70f-4e0c-9387-29c399679b28-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Mildenhall @ 2018-05-02 14:57 UTC (permalink / raw)
  To: pandoc-discuss


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

My understanding is I can specify variables in yaml and use the 
yaml_metadata_block extension to pass them as metadata key value pairs to 
pandoc. Thus if my input file is:

---
bibliography: somefile.bib
---

Content and @references


and I run 

>> pandoc -f markdown+yaml_metadata_block [other options] 

I should get the same result as 

>> pandoc -f markdown -M bibliography=somefile.bib [...] 

and the same as 

>> pandoc -f markdown -bibliography=somefile.bib.

The last two versions, where I pass the biblio filename explicitly, work as 
expected. But going through the yaml block and using the extension does 
not. The csl= options is also ignored. But link-citations: true works from 
yaml when I use the explicit version. 

What am I missing? 

Being able to control everything from the yaml would be fantastically 
helpful....so I hope there is a solution.

Thanks!

Steve

-- 
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/856c6edc-e70f-4e0c-9387-29c399679b28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: yaml_metadata_block and bibliography
       [not found] ` <856c6edc-e70f-4e0c-9387-29c399679b28-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-05-02 17:47   ` John MacFarlane
       [not found]     ` <yh480kfu3aymot.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  2018-05-02 19:08   ` John MacFarlane
  1 sibling, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2018-05-02 17:47 UTC (permalink / raw)
  To: Stephen Mildenhall, pandoc-discuss


Yes, you can indicate the bibliography in a YAML metadata block.

Note, however, that you need to tell pandoc explicitly to
use the pandoc-citeproc filter

    --filter pandoc-citeproc

For backwards compatibility, it does this automatically when
you specify --bibliography on the command line. But not when
you have this in YAML metadata.

Stephen Mildenhall <stephen.j.mildenhall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> My understanding is I can specify variables in yaml and use the 
> yaml_metadata_block extension to pass them as metadata key value pairs to 
> pandoc. Thus if my input file is:
>
> ---
> bibliography: somefile.bib
> ---
>
> Content and @references
>
>
> and I run 
>
>>> pandoc -f markdown+yaml_metadata_block [other options] 
>
> I should get the same result as 
>
>>> pandoc -f markdown -M bibliography=somefile.bib [...] 
>
> and the same as 
>
>>> pandoc -f markdown -bibliography=somefile.bib.
>
> The last two versions, where I pass the biblio filename explicitly, work as 
> expected. But going through the yaml block and using the extension does 
> not. The csl= options is also ignored. But link-citations: true works from 
> yaml when I use the explicit version. 
>
> What am I missing? 
>
> Being able to control everything from the yaml would be fantastically 
> helpful....so I hope there is a solution.
>
> Thanks!
>
> Steve
>
> -- 
> 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/856c6edc-e70f-4e0c-9387-29c399679b28%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: yaml_metadata_block and bibliography
       [not found]     ` <yh480kfu3aymot.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2018-05-02 18:28       ` Stephen Mildenhall
       [not found]         ` <fbea6c6e-f31b-4047-9c96-82f30bfeef2e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Mildenhall @ 2018-05-02 18:28 UTC (permalink / raw)
  To: pandoc-discuss


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

Thanks. But you can't specify to run citeproc in the yaml with filter: 
pandoc-citeproc. Is there some reason that option doesn't pass through? 


On Wednesday, May 2, 2018 at 1:48:01 PM UTC-4, John MacFarlane wrote:
>
>
> Yes, you can indicate the bibliography in a YAML metadata block. 
>
> Note, however, that you need to tell pandoc explicitly to 
> use the pandoc-citeproc filter 
>
>     --filter pandoc-citeproc 
>
> For backwards compatibility, it does this automatically when 
> you specify --bibliography on the command line. But not when 
> you have this in YAML metadata. 
>
> Stephen Mildenhall <stephen.j....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>
> > My understanding is I can specify variables in yaml and use the 
> > yaml_metadata_block extension to pass them as metadata key value pairs 
> to 
> > pandoc. Thus if my input file is: 
> > 
> > --- 
> > bibliography: somefile.bib 
> > --- 
> > 
> > Content and @references 
> > 
> > 
> > and I run 
> > 
> >>> pandoc -f markdown+yaml_metadata_block [other options] 
> > 
> > I should get the same result as 
> > 
> >>> pandoc -f markdown -M bibliography=somefile.bib [...] 
> > 
> > and the same as 
> > 
> >>> pandoc -f markdown -bibliography=somefile.bib. 
> > 
> > The last two versions, where I pass the biblio filename explicitly, work 
> as 
> > expected. But going through the yaml block and using the extension does 
> > not. The csl= options is also ignored. But link-citations: true works 
> from 
> > yaml when I use the explicit version. 
> > 
> > What am I missing? 
> > 
> > Being able to control everything from the yaml would be fantastically 
> > helpful....so I hope there is a solution. 
> > 
> > Thanks! 
> > 
> > Steve 
> > 
> > -- 
> > 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 <javascript:>. 
> > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/856c6edc-e70f-4e0c-9387-29c399679b28%40googlegroups.com. 
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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/fbea6c6e-f31b-4047-9c96-82f30bfeef2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: yaml_metadata_block and bibliography
       [not found]         ` <fbea6c6e-f31b-4047-9c96-82f30bfeef2e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-05-02 19:07           ` John MacFarlane
  2018-05-02 22:50           ` msprevak
  1 sibling, 0 replies; 9+ messages in thread
From: John MacFarlane @ 2018-05-02 19:07 UTC (permalink / raw)
  To: Stephen Mildenhall, pandoc-discuss


Metadata sets variables.  But it doesn't affect command-line
options in general.  There are a number of issues on the tracker
requesting some general way to do this.

Stephen Mildenhall <stephen.j.mildenhall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Thanks. But you can't specify to run citeproc in the yaml with filter: 
> pandoc-citeproc. Is there some reason that option doesn't pass through? 
>
>
> On Wednesday, May 2, 2018 at 1:48:01 PM UTC-4, John MacFarlane wrote:
>>
>>
>> Yes, you can indicate the bibliography in a YAML metadata block. 
>>
>> Note, however, that you need to tell pandoc explicitly to 
>> use the pandoc-citeproc filter 
>>
>>     --filter pandoc-citeproc 
>>
>> For backwards compatibility, it does this automatically when 
>> you specify --bibliography on the command line. But not when 
>> you have this in YAML metadata. 
>>
>> Stephen Mildenhall <stephen.j....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>>
>> > My understanding is I can specify variables in yaml and use the 
>> > yaml_metadata_block extension to pass them as metadata key value pairs 
>> to 
>> > pandoc. Thus if my input file is: 
>> > 
>> > --- 
>> > bibliography: somefile.bib 
>> > --- 
>> > 
>> > Content and @references 
>> > 
>> > 
>> > and I run 
>> > 
>> >>> pandoc -f markdown+yaml_metadata_block [other options] 
>> > 
>> > I should get the same result as 
>> > 
>> >>> pandoc -f markdown -M bibliography=somefile.bib [...] 
>> > 
>> > and the same as 
>> > 
>> >>> pandoc -f markdown -bibliography=somefile.bib. 
>> > 
>> > The last two versions, where I pass the biblio filename explicitly, work 
>> as 
>> > expected. But going through the yaml block and using the extension does 
>> > not. The csl= options is also ignored. But link-citations: true works 
>> from 
>> > yaml when I use the explicit version. 
>> > 
>> > What am I missing? 
>> > 
>> > Being able to control everything from the yaml would be fantastically 
>> > helpful....so I hope there is a solution. 
>> > 
>> > Thanks! 
>> > 
>> > Steve 
>> > 
>> > -- 
>> > 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 <javascript:>. 
>> > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>. 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/856c6edc-e70f-4e0c-9387-29c399679b28%40googlegroups.com. 
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>
> -- 
> 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/fbea6c6e-f31b-4047-9c96-82f30bfeef2e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: yaml_metadata_block and bibliography
       [not found] ` <856c6edc-e70f-4e0c-9387-29c399679b28-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2018-05-02 17:47   ` John MacFarlane
@ 2018-05-02 19:08   ` John MacFarlane
       [not found]     ` <yh480kefityiy5.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2018-05-02 19:08 UTC (permalink / raw)
  To: Stephen Mildenhall, pandoc-discuss


My own approach is to use a Makefile which specifies the options
I need for each case.  Then I just type 'make' to build my
documents, and I don't have to remember the options in the future.


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

* Re: yaml_metadata_block and bibliography
       [not found]     ` <yh480kefityiy5.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2018-05-02 19:40       ` Stephen Mildenhall
  2018-05-04  8:17       ` J
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Mildenhall @ 2018-05-02 19:40 UTC (permalink / raw)
  To: pandoc-discuss


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

Yes, that's what I do. But I'm always looking for ways to move 
functionality into the yaml, where it is clear and explicit, vs. hidden in 
the makefile. I see now I read the manual wrong: 

--bibliography=*FILE*

Set the bibliography field in the document’s metadata to *FILE*, overriding 
any value set in the metadata, and process citations using pandoc-citeproc. 
(This is equivalent to --metadata bibliography=FILE --filter pandoc-citeproc
.) 

is saying define a variable and then set the file option, NOT define two 
variables in YAML. Got it.

Thanks for your help and all your work on pandoc. I find it extremely 
valuable. 

Steve

On Wednesday, May 2, 2018 at 3:08:16 PM UTC-4, John MacFarlane wrote:
>
>
> My own approach is to use a Makefile which specifies the options 
> I need for each case.  Then I just type 'make' to build my 
> documents, and I don't have to remember the options in the future. 
>
>

-- 
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/3381c6d1-c4e1-4d5e-ad74-c42207d70de4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: yaml_metadata_block and bibliography
       [not found]         ` <fbea6c6e-f31b-4047-9c96-82f30bfeef2e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2018-05-02 19:07           ` John MacFarlane
@ 2018-05-02 22:50           ` msprevak
  1 sibling, 0 replies; 9+ messages in thread
From: msprevak @ 2018-05-02 22:50 UTC (permalink / raw)
  To: pandoc-discuss


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

panzer provides the behaviour you are looking 
for: https://github.com/msprev/panzer

On Wednesday, May 2, 2018 at 7:28:32 PM UTC+1, Stephen Mildenhall wrote:
>
> Thanks. But you can't specify to run citeproc in the yaml with filter: 
> pandoc-citeproc. Is there some reason that option doesn't pass through? 
>

-- 
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/5f91212e-62a2-4a12-b5e3-bfb0165eca88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: yaml_metadata_block and bibliography
       [not found]     ` <yh480kefityiy5.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  2018-05-02 19:40       ` Stephen Mildenhall
@ 2018-05-04  8:17       ` J
       [not found]         ` <90202344-2943-4d7d-942c-4b6726153b46-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: J @ 2018-05-04  8:17 UTC (permalink / raw)
  To: pandoc-discuss


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

Would you please extract a set of your standard procedures and share as an 
example ? :D

On Thursday, May 3, 2018 at 3:08:16 AM UTC+8, John MacFarlane wrote:
>
>
> My own approach is to use a Makefile which specifies the options 
> I need for each case.  Then I just type 'make' to build my 
> documents, and I don't have to remember the options in the future. 
>
>

-- 
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/90202344-2943-4d7d-942c-4b6726153b46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: yaml_metadata_block and bibliography
       [not found]         ` <90202344-2943-4d7d-942c-4b6726153b46-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-05-05 16:55           ` John MacFarlane
  0 siblings, 0 replies; 9+ messages in thread
From: John MacFarlane @ 2018-05-05 16:55 UTC (permalink / raw)
  To: J, pandoc-discuss

J <lixichen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Would you please extract a set of your standard procedures and share as an 
> example ? :D

Sure.  Here's a Makefile I used for a seminar I just taught.
I put all my handouts in the handouts/ directory. syllabus.md
was in the root directory.  Typing 'make' would rebuild the
syllabus and all handouts that had been modified.

Important note: the indents in each rule must be TAB characters;
they have been converted in this forum to spaces.

```
HANDOUTS=$(patsubst %.md, %.pdf, $(wildcard handouts/*.md))
ALL=$(HANDOUTS) syllabus.pdf

all: $(ALL)

handouts/%.pdf: handouts/%.md
        pandoc $< -o $@ -Vdocumentclass=tufte-handout -Vclassoption=sfsidenotes -Vclassoption=notoc -H header-includes.tex --bibliography seminar.bib -F pandoc-citeproc --lua-filter wrap-bibliography.lua -Vsubparagraph

syllabus.pdf: syllabus.md
        pandoc $< -o $@ -Vdocumentclass=tufte-handout -Vclassoption=sfsidenotes -Vclassoption=notoc -H header-includes.tex --bibliography seminar.bib -F pandoc-citeproc --lua-filter remove-bibliography.lua -Vsubparagraph --csl mhra-intext.csl


clean:
        rm $(ALL)

.PHONY: all clean
```

For a simple, one-off project, I could have something as simple as:

```
article.pdf: article.md
        pandoc $< -o $@ --filter pandoc-citeproc --bibliography bib.bib
```


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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 14:57 yaml_metadata_block and bibliography Stephen Mildenhall
     [not found] ` <856c6edc-e70f-4e0c-9387-29c399679b28-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-05-02 17:47   ` John MacFarlane
     [not found]     ` <yh480kfu3aymot.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-05-02 18:28       ` Stephen Mildenhall
     [not found]         ` <fbea6c6e-f31b-4047-9c96-82f30bfeef2e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-05-02 19:07           ` John MacFarlane
2018-05-02 22:50           ` msprevak
2018-05-02 19:08   ` John MacFarlane
     [not found]     ` <yh480kefityiy5.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-05-02 19:40       ` Stephen Mildenhall
2018-05-04  8:17       ` J
     [not found]         ` <90202344-2943-4d7d-942c-4b6726153b46-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-05-05 16:55           ` John MacFarlane

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