Skip to content

Make placement of bibliography possible with reference-section-title #1108

Open
@cderv

Description

@cderv

This is a documented way in Pandoc: https://pandoc.org/MANUAL.html#placement-of-the-bibliography
To add in index.Rmd

reference-section-title: Awesome biblio

but it does not seems to work.

Error in vapply(idx2, character(1), FUN = function(i) head(nms[idx > i],  : 
  values must be length 1,
 but FUN(X[[7]]) result is length 0

Issue is here:

bookdown/R/html.R

Lines 367 to 373 in b66380e

h1 = grep('^<div (id="[^"]+" )?class="section level1("| )', html_body)
h2 = grep('^<div (id="[^"]+" )?class="section level2("| )', html_body)
idx2 = if (split_level == 1) h1 else if (split_level == 2) sort(c(h1, h2))
n = length(idx2)
nms_chaps = if (length(idx)) {
vapply(idx2, character(1), FUN = function(i) head(nms[idx > i], 1))
}

I believe there will be one more title in HTML not expected by bookdown because not in files as it will be inserted by Pandoc itself

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementnextto consider for next release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions