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

Citedrive bibliography not rendering in Quarto book html #8814

Closed
loreabad6 opened this issue Feb 21, 2024 · 2 comments · Fixed by #8847
Closed

Citedrive bibliography not rendering in Quarto book html #8814

loreabad6 opened this issue Feb 21, 2024 · 2 comments · Fixed by #8847
Assignees
Labels
bibliography bug Something isn't working
Milestone

Comments

@loreabad6
Copy link

Bug description

CiteDrive generates a URL that can normally be used within Quarto documents. But for HTML books, the reference.qmd section won't render. This works fine with PDF. Also only rendering index.qmd formats the inline citations correctly.

Steps to reproduce

  1. Create a New Project, Quarto Book in RStudio.
  2. Use the following _quarto.yml file:
project:
  type: book

book:
  title: "test"
  author: "Norah Jones"
  date: "21/02/2024"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: 
    - references.bib
    - "https://api.citedrive.com/bib/fe951e8e-8d9a-4b1e-9242-7a5591d4ca2b/references.bib?x=eyJpZCI6ICJmZTk1MWU4ZS04ZDlhLTRiMWUtOTI0Mi03YTU1OTFkNGNhMmIiLCAidXNlciI6ICIyNTY4IiwgInNpZ25hdHVyZSI6ICJkMWUyZWQ5NjE0MDdjOGVmNTIxMzEwMmE5ZTYwM2E5YzI3ZGY1ODc0YWJhNjJkZjU4YzU4ZmZiZjVkYTFjNjg0In0=/bibliography.bib"

format:
  html:
    theme: cosmo
  pdf: default
  1. Contents of index.qmd:
# Preface {.unnumbered}

@Harvey_2006 

[@Goodchild_2019]

Expected behavior

Bibliography from CiteDrives renders normally

Actual behavior

Rendering the HTML book fails with the error:

Could not fetch https:/api.citedrive.com/bib/xxx/bibliography.bib" "URL must be absolute"

Your environment

R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
RStudio 2023.12.1+402 "Ocean Storm" Release (4da58325ffcff29d157d9264087d4b1ab27f7204, 2024-01-28) for windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.12.1+402 Chrome/116.0.5845.190 Electron/26.2.4 Safari/537.36

Quarto check output

Quarto 1.4.550
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.550
      Path: C:\Users\b1066081\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: v2023.04
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\b1066081\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2023

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.11.2
      Path: C:/Users/b1066081/AppData/Local/Programs/Python/Python311/python.exe
      Jupyter: 5.3.1
      Kernels: python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.3.1
      Path: C:/PROGRA~1/R/R-4.3.1
      LibPaths:
        - C:/Users/b1066081/AppData/Local/R/win-library/4.3
        - C:/Program Files/R/R-4.3.1/library
      knitr: 1.45
      rmarkdown: 2.25

[>] Checking Knitr engine render......OK
@loreabad6 loreabad6 added the bug Something isn't working label Feb 21, 2024
@cderv
Copy link
Collaborator

cderv commented Feb 21, 2024

I can reproduce. Here is the stack trace:

ERROR: Error
    at generateBibliography (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/project/types/book/book-bibliography.ts:292:11)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async bookBibliographyPostRender (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/project/types/book/book-bibliography.ts:215:28)
    at async Object.bookPostRender [as postRender] (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/project/types/book/book-render.ts:614:5)
    at async renderProject (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/command/render/project.ts:756:7)
    at async Command.fn (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/command/render/cmd.ts:248:26)
    at async Command.execute (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/vendor/deno.land/x/cliffy@v0.25.4/command/command.ts:1790:7)
    at async quarto (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/quarto.ts:155:3)
    at async file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/quarto.ts:186:5

For HTML book we do a specific processing and I am not sure we handle URL correctly or just have a wrong detection here

const biblioPaths = bibliography.map((biblio) => {
if (isAbsolute(biblio)) {
return relative(context.dir, biblio);
} else {
return biblio;
}
});

bibliography is wrong somethow here for such projects:

0: 'C:\\Users\\chris\\AppData\\Local\\Temp\\quarto\\test-quarto-book\\references.bib'
1: 'C:\\Users\\chris\\AppData\\Local\\Temp\\quarto\\test-quarto-book\\https:\\api.citedrive.com\\bib\\<truncated....>

I'll have a look

Thanks for the report!

@cderv cderv self-assigned this Feb 21, 2024
@cderv cderv added this to the v1.5 milestone Feb 21, 2024
@cderv
Copy link
Collaborator

cderv commented Feb 21, 2024

The issue seems to come from our pandoc conversion of the reference

We do use this markdown

---
bibliography:
  - references.bib
  - >-
    https:/api.citedrive.com/bib/fe951e8e-8d9a-4b1e-9242-7a5591d4ca2b/references.bib?x=eyJpZCI6ICJmZTk1MWU4ZS04ZDlhLTRiMWUtOTI0Mi03YTU1OTFkNGNhMmIiLCAidXNlciI6ICIyNTY4IiwgInNpZ25hdHVyZSI6ICJkMWUyZWQ5NjE0MDdjOGVmNTIxMzEwMmE5ZTYwM2E5YzI3ZGY1ODc0YWJhNjJkZjU4YzU4ZmZiZjVkYTFjNjg0In0=/bibliography.bib
nocite: '@Harvey_2006, @Goodchild_2019, @knuth84'

---

to run on it

pandoc --from markdown --to html --citeproc

And this is what is failing (with bare pandoc to).

There is a missing / at the https:// so we are messing with the URL.

Issue is correct support for url in book project bibliography

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bibliography bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants