rstudio / bookdown

Authoring Books and Technical Documents with R Markdown
https://pkgs.rstudio.com/bookdown/
GNU General Public License v3.0
3.8k stars 1.27k forks source link

bookdown::tufte_html_book with csl fails to place citation in margin #860

Closed ssp3nc3r closed 4 years ago

ssp3nc3r commented 4 years ago

bookdown::tufte_html_book does not place citation in margin for csl with note. For example:

bookdown::render_book(input = "index.rmd", 
                      output_format = "bookdown::tufte_html_book")

with csl from: https://raw.githubusercontent.com/citation-style-language/styles/master/chicago-fullnote-bibliography-short-title-subsequent.csl

For file index.rmd:

---
title: "Test title"
output:
  bookdown::tufte_html_book
link-citations: yes
bibliography: [test.bib]
csl: chicago-fullnote-bibliography-short-title-subsequent.csl
---

# First section

The citation for this[@edwinabbottFlatlandRomanceMany2018] should show up in the margin.

and bibliography test.bib:

@book{edwinabbottFlatlandRomanceMany2018,
  title = {Flatland: {{A Romance}} of {{Many Dimensions}}},
  shorttitle = {Flatland},
  author = {{Edwin Abbott}},
  year = {2018},
  publisher = {{CreateSpace Independent Publishing Platform}},
  file = {/Users/ssp3nc3r/Zotero/storage/NZBIJ84R/Edwin Abbott - 2018 - Flatland A Romance of Many Dimensions.pdf},
  isbn = {978-1-5239-6216-7}
}

results in this html:

<!DOCTYPE html>
<html lang="" xml:lang="">
<head>

<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="Test title" />
<meta property="og:type" content="book" />

<meta name="description" content="Test title">

<title>Test title</title>

<link href="libs/tufte-css-2015.12.29/tufte-fonts.css" rel="stylesheet" />
<link href="libs/tufte-css-2015.12.29/tufte-background.css" rel="stylesheet" />
<link href="libs/tufte-css-2015.12.29/tufte-italics.css" rel="stylesheet" />
<link href="libs/tufte-css-2015.12.29/tufte.css" rel="stylesheet" />

</head>

<body>

<div class="row">
<div class="col-sm-12">
<div id="TOC">
<ul>
<li><a href="#first-section"><span class="toc-section-number">1</span> First section</a></li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div id="header">
<h1 class="title">Test title</h1>
</div>
<div id="first-section" class="section level1">
<h1><span class="header-section-number">1</span> First section</h1>
<p>The citation for this<span class="citation"><a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></span> should show up in the margin.</p>

<div id="refs" class="references">
<div>
<p>Edwin Abbott. <em>Flatland: A Romance of Many Dimensions</em>. CreateSpace Independent Publishing Platform, 2018.</p>
</div>
</div>
</div>
<p style="text-align: center;">
</p>
</div>
</div>

</body>
</html>

I posted the issue on stackoverflow a couple days ago:

https://stackoverflow.com/questions/60120797/bookdowntufte-html-book-with-csl-fails-to-place-citation-in-margin


By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

yihui commented 4 years ago

Duplicate of https://github.com/rstudio/tufte/issues/78.

Please install the latest version of the tufte package from CRAN. Thanks!

github-actions[bot] commented 4 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.