jimhester / knitrBootstrap

A framework to create bootstrap styled HTML reports from knitr Rmarkdown.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

incompatibility with pandoc citations

stevepowell99 opened this issue · comments

With the minimal .Rmd file below, the div in which the references are placed floats off below the final knitrBookstrap credit at the bottom. (Note that to reproduce the problem, you have to actually have @kellogg_logic_2004 in the .bib file for the reference to be produced.)


---
output:
  knitrBootstrap::bootstrap_document

bibliography: "mybib.bib"

---

# a heading
# Bibliography

[@kellogg_logic_2004]

The bottom of the resulting html file looks like this:

<div class="references">
<p>Kellogg, W. K. 2004. “Logic Model Development Guide.”</p>
</div>
</body>
</html>

Yes this will be an issue due to the way that knirBootstrap adds the wrapping divs. I know a way to fix this by using a rmarkdown template, just haven't had the time to actually do so. Thanks for reporting the bug!

I would also really appreciate this fix. Thanks for starting it!

I've managed to bypass this issue by injecting a bit of javascript into the document using the custom.header option as a temporary fix.

<script> window.onload = function() { x = document.getElementsByClassName('references') document.getElementById('References').parentNode.insertBefore(x[x.length-1], document.getElementById('References').nextSibling); } </script>

Note this should be fixed in pull request #68 if you wanted to try it out with that. (Note it is not quite ready for release)

Thank you very much!

That version actually fixed the problem I was originally searching for in
the issues; knitrBootstrap didn't work with the latest RStudio preview
release (I'm guessing the actual issue was pandoc/rmarkdown, but I didn't
get all that far in tracking it down).

It seems as if the TOC is gone, though - is that something that's been
removed for the time being?

On Thu, Oct 9, 2014 at 11:51 AM, Jim Hester notifications@github.com
wrote:

Note this should be fixed in pull request #68
#68 if you wanted to
try it out with that. (Note it is not quite ready for release)


Reply to this email directly or view it on GitHub
#53 (comment)
.

Ah no it's not gone, it is just not on by default (just like the default
html_document). You can put it back with toc: true in your YAML block

On Thu, Oct 9, 2014 at 12:56 PM, Susan VanderPlas notifications@github.com
wrote:

Thank you very much!

That version actually fixed the problem I was originally searching for in
the issues; knitrBootstrap didn't work with the latest RStudio preview
release (I'm guessing the actual issue was pandoc/rmarkdown, but I didn't
get all that far in tracking it down).

It seems as if the TOC is gone, though - is that something that's been
removed for the time being?

On Thu, Oct 9, 2014 at 11:51 AM, Jim Hester notifications@github.com
wrote:

Note this should be fixed in pull request #68
#68 if you wanted to
try it out with that. (Note it is not quite ready for release)


Reply to this email directly or view it on GitHub
<
https://github.com/jimhester/knitrBootstrap/issues/53#issuecomment-58540044>

.


Reply to this email directly or view it on GitHub
#53 (comment)
.

Ok, I figured that part out. Twas a bit harder to find the documentation
when not creating something from scratch.

It does seem like some of the previous highlighting has disappeared,
though. I've attached pictures to demonstrate; I'm totally fine with the
depth of the TOC changing, but I'm curious as to what's messing with the
css styling of the TOC panel.

Thanks for the help, btw. knitrBootstrap is awesome.

On Thu, Oct 9, 2014 at 12:06 PM, Jim Hester notifications@github.com
wrote:

Ah no it's not gone, it is just not on by default (just like the default
html_document). You can put it back with toc: true in your YAML block

On Thu, Oct 9, 2014 at 12:56 PM, Susan VanderPlas <
notifications@github.com>
wrote:

Thank you very much!

That version actually fixed the problem I was originally searching for
in
the issues; knitrBootstrap didn't work with the latest RStudio preview
release (I'm guessing the actual issue was pandoc/rmarkdown, but I
didn't
get all that far in tracking it down).

It seems as if the TOC is gone, though - is that something that's been
removed for the time being?

On Thu, Oct 9, 2014 at 11:51 AM, Jim Hester notifications@github.com
wrote:

Note this should be fixed in pull request #68
#68 if you wanted
to
try it out with that. (Note it is not quite ready for release)


Reply to this email directly or view it on GitHub
<

https://github.com/jimhester/knitrBootstrap/issues/53#issuecomment-58540044>

.


Reply to this email directly or view it on GitHub
<
https://github.com/jimhester/knitrBootstrap/issues/53#issuecomment-58540936>

.


Reply to this email directly or view it on GitHub
#53 (comment)
.

@srvanderplas There were two bugs with the bootstrap_document. The TOC as you noted was not working as planned, and the highlighting was commented out. Please try installing from the latest version of #68. Also if you could please try out the simple_document format, as I am aiming to replace bootstrap_document with that by default.

has this issue been fixed maybe? I just tried out knitr bootstrap. Very nice! But I won't write citations by hand from now again. Would be cool if citations will be supported!