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

add css for csl in Pandoc's templates #1045

Merged
merged 3 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

- `serve_book()` will refresh correctly now when using subdirectories with `rmd_subdir` (thanks, @shenfei, #834).

- Added the same CSS as in default Pandoc's template for when a CSL is used (#1045).

## MINOR CHANGES

- `anchor_sections = TRUE` becomes the default for `bookdown::gitbook()`.
Expand Down
28 changes: 28 additions & 0 deletions inst/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,34 @@
</style>
$endif$

$if(csl-css)$
<style type="text/css">
/* Used with Pandoc 2.11+ new --citeproc when CSL is used */
div.csl-bib-body { }
div.csl-entry {
clear: both;
$if(csl-entry-spacing)$
margin-bottom: $csl-entry-spacing$;
$endif$
}
.hanging div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}
</style>
$endif$

$for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
$endfor$
Expand Down
28 changes: 28 additions & 0 deletions inst/templates/gitbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,34 @@
</style>
$endif$

$if(csl-css)$
<style type="text/css">
/* Used with Pandoc 2.11+ new --citeproc when CSL is used */
div.csl-bib-body { }
div.csl-entry {
clear: both;
$if(csl-entry-spacing)$
margin-bottom: $csl-entry-spacing$;
$endif$
}
.hanging div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}
</style>
$endif$

$for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
$endfor$
Expand Down