Search code examples
rquarto

WARNING: Unable to resolve crossref for figure in quarto html file


I have a .qmd file with this contents:

![](images/plt_pay_bame_diff){#fig-pay_bame_diff}

If you look at @fig-pay_bame_diff 

It outputs the image, but can't process the crossref to the figure:

enter image description here

metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  
WARNING: Unable to resolve crossref @fig-pay_bame_diff
Output created: test.html

Solution

  • Its not working because you have not provided a figure caption (i.e. fig-cap).

    For markdown image syntax, figure caption goes within the sqaure brackets [].

    So try with,

    ![some label](images/plt_pay_bame_diff){#fig-pay_bame_diff}
    
    If you look at @fig-pay_bame_diff