Skip to content

Figure numbering is broken in HTML output with pandoc 3.x when using Markdown image syntax #1467

@N0rbert

Description

@N0rbert

Below is the minimal reproducible example (index.Rmd file):

---
title: Figure cross-reference issue in HTML
documentclass: book
site: bookdown::bookdown_site
output:
    bookdown::html_document2: default
---

```{r eval=TRUE, include=TRUE}
sessionInfo('bookdown')
rmarkdown::pandoc_version()
xfun::session_info('bookdown')
```

# Zero 1 {-#zero1}

Some text in 1st unnumbered section.

# Practically long header about some theories {#theory}

## Markdown Syntax {#markdown-syntax}

...

### Images {#markdown-syntax-media}

First figure of first section is below, it reference is Fig. \@ref(fig:md-logo).

![(\#fig:md-logo) Markdown logo](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/208px-Markdown-mark.svg.png)

...

While knitting this document using RStudio 2024.04.0 Build 735 with integrated latest pandoc 3.1.11 to HTML I get the wrong rendering

figure-numbering-issue

Here my figure is not numbered. So the cross-reference works as expected, but "Figure 1.1: " is not shown.

It is fresh installation of Ubuntu MATE 24.04 LTS.
Other details:

> xfun::session_info('bookdown')
## R version 4.3.3 (2024-02-29)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 24.04 LTS
## 
## Locale:
##   LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##   LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##   LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##   LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##   LC_ADDRESS=C               LC_TELEPHONE=C            
##   LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## Package version:
##   base64enc_0.1.3   bookdown_0.39.1   bslib_0.7.0       cachem_1.0.8     
##   cli_3.6.2         digest_0.6.35     evaluate_0.23     fastmap_1.1.1    
##   fontawesome_0.5.2 fs_1.6.4          glue_1.7.0        graphics_4.3.3   
##   grDevices_4.3.3   highr_0.10        htmltools_0.5.8.1 jquerylib_0.1.4  
##   jsonlite_1.8.8    knitr_1.46        lifecycle_1.0.4   memoise_2.0.1    
##   methods_4.3.3     mime_0.12         R6_2.5.1          rappdirs_0.3.3   
##   rlang_1.1.3       rmarkdown_2.26    sass_0.4.9        stats_4.3.3      
##   tinytex_0.50      tools_4.3.3       utils_4.3.3       xfun_0.43        
##   yaml_2.3.8

> rmarkdown::pandoc_version()
## [1] '3.1.11'

Running remotes::install_github("rstudio/bookdown") does not help.
Also please note that RStudio 2023.03.2-454 with pandoc 2.19.2 produces correct rendering.

Metadata

Metadata

Assignees

Labels

bugan unexpected problem or unintended behaviornextto consider for next release

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions