quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.77k stars 309 forks source link

The same footnote in an abstract is displayed three times #6708

Closed lnnrtwttkhn closed 11 months ago

lnnrtwttkhn commented 1 year ago

Bug description

I want to add a footnote to an abstract in an HTML Quarto document. The same footnote appears three times, instead of once. The rendered HTML output of the document can be found here. The source code is here (make sure to switch to the abstract branch).

Steps to reproduce

The rendered HTML output of the document can be found here. The source code is here (make sure to switch to the abstract branch). Of note, when setting up a "minimal, fully reproducible example" I could not reproduce the bug. However, the bug in the repository referenced above occurs consistently when I render locally (macOS 13.5.1 Ventura, Apple M1 Pro) but also in this GitHub Actions workflow which uses Ubuntu. So I assume that the bug must be found in this repo's particular combination of settings.

Expected behavior

The footnote appears once.

Actual behavior

The footnote appears three times.

Your environment

Local

GitHub Actions

Quarto check output

% quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.321
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.11.4
      Path: /opt/homebrew/opt/python@3.11/bin/python3.11
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/wittkuhn/personal/mri-total/renv/library/R-4.3/aarch64-apple-darwin20
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.43
      rmarkdown: 2.23

[✓] Checking Knitr engine render......OK
mcanouil commented 1 year ago

Thanks for the report!

Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks. Also, could you update at least to the latest stable version which is v1.3.450 (or possibly the pre-release version 1.4.346).

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)

The end.

lnnrtwttkhn commented 1 year ago

Minor update: This occurs when setting reference-location: document but not e.g., with reference-location: margin.

lnnrtwttkhn commented 1 year ago

Thanks for the immediate response @mcanouil!

As described, the issue only occurs in a somewhat more complex Quarto project here: https://github.com/lnnrtwttkhn/mri-total/tree/abstract (the example should be reproducible). So far, a more minimal example did not reproduce the bug yet.

I just upgraded to Quarto v1.3.450 but the issue persists.

Thank you for your help!

mcanouil commented 1 year ago

Unfortunately, there is no other way for you to decrease to a small reproducible example. For example start from the following, and add your option one by one from https://github.com/lnnrtwttkhn/mri-total/blob/abstract/_quarto.yml#L58-L114

---
title: "MRI Total"
subtitle: "Towards an automated, standardized, reproducible, version-controlled, transparent, FAIR, quality-assured, privacy-compliant processing pipeline for MRI data"
engine: knitr
abstract: |
  ^[Submit an abstract of 80-120 words describing your poster, emphasizing the computational methodologies used and the application areas covered.]
  Neuroscientists at University of Hamburg (UHH) collect human brain imaging data in over XX studies per year.
  However, this data treasure is not systematically standardized, stored, or controlled for quality.
  We propose an institution-wide processing pipeline for human brain imaging data that connects state-of-the-art open-source neuroinformatics software tools and leverages UHH computational infrastructure, including the object storage and high-performance computing cluster.
  Immediately following collection, data are transformed to the Brain Imaging Data Structure (BIDS) standard and submitted to in-depth automated quality assurance (MRIQC).
  In addition, an interactive dashboard allows browsing metadata of available data sets and MRI quality metrics, fostering transparency and scientific exchange.
  This project promises high-quality reproducible research outputs and boost the efficiency of scientific workflows.
reference-location: document
---

This is a playground for Quarto.
mcanouil commented 1 year ago

I made one:

  1. Create a website
    quarto create project website mywebsite
  2. Modify the index page
    echo -e '---\nabstract: "This is the actual abstract.^[This is the abstract.]"\n---\n' > index.qmd
image
lnnrtwttkhn commented 1 year ago

Thanks @mcanouil, I was also just trying to reduce my project to a MWE. here it is:

  1. Create a .qmd file.
---
title: "Title"
abstract: "^[I am a footnote.]"
format: html
---
  1. Add _quarto.yml
project:
  type: website

Adding the _quarto.yml causes the footnote to appear three times.

mcanouil commented 1 year ago

It's not the presence of the _quarto.yml, it's the project type, namely book or website.

BookWebsite
```yaml project: type: book book: chapters: - index.qmd format: html ``` ```yaml project: type: website format: html ```
echo -e '---\nabstract: "This is the actual abstract.^[This is the abstract.]"\n---\n' > index.qmd
warnes commented 11 months ago

I'm experiencing the same issue with document type html.