Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print part of the bibliography #46

Open
trinker opened this issue Sep 16, 2013 · 1 comment
Open

Print part of the bibliography #46

trinker opened this issue Sep 16, 2013 · 1 comment
Milestone

Comments

@trinker
Copy link
Contributor

trinker commented Sep 16, 2013

@cboettig I use knitcitations with slidify. When I print the references I want to print just some of the reverences at a time so that I can stretch multiply slides as the reference list is likely to exceed one slide.

Let's say we have 10 references total being used. If there a way to print the first 5 on one slide and the last 5 on the next slide?

I tried


---

## Ref 2

'''{r, echo=FALSE, results='asis'}
bibliography("html")[1:5]
'''

---

## Ref 1

'''{r, echo=FALSE, results='asis'}
bibliography("html")[6:10]
'''

Note: I replaced the the back ticks in the code chunk with a straight quote as the back ticks won't render on github.

@cboettig
Copy link
Owner

@trinker That makes sense; not currently possible since bibliography is a print method that invisibly returns bibliography while displaying the formatted output with cat(), see https://github.com/cboettig/knitcitations/blob/master/R/bibliography.R

Well, you could probably hack it by doing:

'''{r include=FALSE}
out <- bibliography("html") # displays nothing but captures the output
'''

Followed by

'''{r results="asis"}
cat(out[1:5])
'''

but I realize that's kinda silly. I'd welcome a pull request that adds this as an option to bibliography... (otherwise I'll get around to it eventually...)

@cboettig cboettig added this to the 0.7 milestone May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants