rstudio / bookdown

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

Unnumbered didn't work properly #1456

Closed sonv closed 7 months ago

sonv commented 7 months ago

Hi,

I'm not sure what happened but this morning when I rendered the HTML version of my notes, the numbering of the chapters didn't work properly.

Screenshot 2024-02-24 at 16 51 27

Specifically, the chapter counter seems to keep increasing even though I marked the chapter unnumbered (please see picture). Could someone explain this to me?

Here's my xfun::session_info('rmarkdown'):

Screenshot 2024-02-25 at 08 18 52

My _output.yml is:

Screenshot 2024-02-25 at 08 35 21

I attach here my bookdown folder. MATH310.zip

I'm not sure what's going on. A week ago things were still fine. My PDF output has the correct numbering.

Thank you!

yihui commented 7 months ago

Could you read and follow the issue guide to provide all the required information when filing a bug report? Otherwise it is usually hard for us to help you. At a bare minimum, we need to know your package versions: xfun::session_info(c('bookdown', 'rmarkdown')). Thanks!

sonv commented 7 months ago

Hi, I apologize for my mistake. I've updated the bug report according to the issue guide. Thank you very much for your patience.

cderv commented 7 months ago

A week ago things were still fine

🤔 This could be related to Pandoc's update as I see you are using 3.1.12.1 which is quite recent. Did you update Pandoc, or any tools providing pandoc (RStudio IDE ? Quarto ? )

They did some changes on chapter numbering and this possibly messing this up. I still need to assess all the impact

but it could also be another change. I'll try to reproduce and check different pandoc versions with the project you provided as zip

cderv commented 7 months ago

This could be related to Pandoc's update as I see you are using 3.1.12.1 which is quite recent.

I can confirm this:

So as a workaround, you need to use a different Pandoc version with your project for now. We'll definitely fix this for next bookdown version.

To use a different Pandoc version, you can do that with rmarkdown and a version you install yourself (https://bookdown.org/yihui/rmarkdown-cookbook/install-pandoc.html) or you can leverage the pandoc package that I use for debugging (https://cderv.github.io/pandoc/à which has way to install pandoc versions in a dedicated folder and a function (pandoc_activate()) to set up a pandoc version for use with rmarkdown in a R session.

Hope it helps We'll update here soon

sonv commented 7 months ago

This could be related to Pandoc's update as I see you are using 3.1.12.1 which is quite recent.

I can confirm this:

  • Using Pandoc 3.1.11.1 with your project ends up with the expected rendering
  • Using Pandoc 3.1.12 with your project messes up the numbering.

Yes, I updated pandoc recently.

So as a workaround, you need to use a different Pandoc version with your project for now. We'll definitely fix this for next bookdown version.

To use a different Pandoc version, you can do that with rmarkdown and a version you install yourself (https://bookdown.org/yihui/rmarkdown-cookbook/install-pandoc.html) or you can leverage the pandoc package that I use for debugging (https://cderv.github.io/pandoc/à which has way to install pandoc versions in a dedicated folder and a function (pandoc_activate()) to set up a pandoc version for use with rmarkdown in a R session.

Hope it helps We'll update here soon

Thank you very much! You're awesome!

Best regards,

cderv commented 7 months ago

To update here also, this is a bug in Pandoc

So this will be fixed with a new version of Pandoc.

cderv commented 7 months ago

This is fixed in Pandoc development version. Next pandoc version will solve this. I'll close this when it will be out.

cderv commented 7 months ago

Pandoc's new version is out: https://github.com/jgm/pandoc/releases/tag/3.1.12.2

Using the latest version will solve this issue. When building on CI, you can now use r-lib/actions/setup-pandoc@v2 with latest as Pandoc version. This will build your book using the latest pandoc released version.

Locally if you install latest version (with method you want) and put it on PATH, rmarkdown will use the greater version among binaries found including the one found on PATH.

github-actions[bot] commented 1 month 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.