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

Appendix cross-references are broken only in html-based outputs #845

Closed
jooyoungseo opened this issue Dec 25, 2019 · 5 comments
Closed

Appendix cross-references are broken only in html-based outputs #845

jooyoungseo opened this issue Dec 25, 2019 · 5 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@jooyoungseo
Copy link

jooyoungseo commented Dec 25, 2019

The latest bookdown version fails to support cross-references for Appendix section in html-based outputs; there is no issue found in any output based on bookdown::pdf_document2. This might have to do with the recent development on Appendix numbering customization.

Please refer to the following reproducible code and results.

Reproducible Code

test.Rmd:

---
output: bookdown::html_document2
---

Appendix \@ref(appA)

# (APPENDIX) Appendix {-}

# Test {#appA}

Rendering Results

Appendix ??

(APPENDIX) Appendix

Test

Standard output and standard error `C:/test/reprex/reprex_std_out_err.txt`
Session info
sessioninfo::session_info()
#;-) - Session info ---------------------------------------------------------------
#;-)  setting  value                       
#;-)  version  R version 3.6.1 (2019-07-05)
#;-)  os       Windows 10 x64              
#;-)  system   x86_64, mingw32             
#;-)  ui       RTerm                       
#;-)  language (EN)                        
#;-)  collate  English_United States.1252  
#;-)  ctype    English_United States.1252  
#;-)  tz       America/New_York            
#;-)  date     2019-12-25                  
#;-) 
#;-) - Packages -------------------------------------------------------------------
#;-)  package     * version    date       lib source                            
#;-)  assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.6.1)                    
#;-)  backports     1.1.5      2019-10-02 [1] CRAN (R 3.6.1)                    
#;-)  cli           2.0.0      2019-12-09 [1] CRAN (R 3.6.1)                    
#;-)  crayon        1.3.4      2017-09-16 [1] CRAN (R 3.6.1)                    
#;-)  digest        0.6.23     2019-11-23 [1] CRAN (R 3.6.1)                    
#;-)  evaluate      0.14       2019-05-28 [1] CRAN (R 3.6.1)                    
#;-)  fansi         0.4.0      2018-10-05 [1] CRAN (R 3.6.1)                    
#;-)  fs            1.3.1      2019-05-06 [1] CRAN (R 3.6.1)                    
#;-)  glue          1.3.1.9000 2019-12-19 [1] Github (tidyverse/glue@b9ffe6c)   
#;-)  htmltools     0.4.0      2019-10-04 [1] CRAN (R 3.6.1)                    
#;-)  knitr         1.26.1     2019-12-05 [1] Github (yihui/knitr@33d69c3)      
#;-)  magrittr      1.5        2014-11-22 [1] CRAN (R 3.6.1)                    
#;-)  pillar        1.4.3      2019-12-20 [1] CRAN (R 3.6.2)                    
#;-)  pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 3.6.1)                    
#;-)  purrr         0.3.3      2019-10-18 [1] CRAN (R 3.6.1)                    
#;-)  Rcpp          1.0.3      2019-11-08 [1] CRAN (R 3.6.1)                    
#;-)  reprex        0.3.0.9001 2019-11-13 [1] Github (tidyverse/reprex@27aa69a) 
#;-)  rlang         0.4.2.9000 2019-12-12 [1] Github (r-lib/rlang@ec7c1ed)      
#;-)  rmarkdown     2.0.5      2019-12-20 [1] Github (rstudio/rmarkdown@7f51e23)
#;-)  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.6.1)                    
#;-)  stringi       1.4.3      2019-03-12 [1] CRAN (R 3.6.0)                    
#;-)  stringr       1.4.0.9000 2019-11-11 [1] Github (hadley/stringr@80aaaac)   
#;-)  styler        1.2.0.9000 2019-11-13 [1] Github (r-lib/styler@a8acde5)     
#;-)  tibble        2.1.3      2019-06-06 [1] CRAN (R 3.6.1)                    
#;-)  withr         2.1.2      2018-03-15 [1] CRAN (R 3.6.1)                    
#;-)  xfun          0.11.3     2019-11-22 [1] Github (yihui/xfun@4fcd6ff)       
#;-)  yaml          2.2.0      2018-07-25 [1] CRAN (R 3.6.0)                    
#;-) 
#;-) [1] C:/Program Files/R/R-3.6.1/library
Session info
sessioninfo::session_info()
#;-) - Session info ---------------------------------------------------------------
#;-)  setting  value                       
#;-)  version  R version 3.6.1 (2019-07-05)
#;-)  os       Windows 10 x64              
#;-)  system   x86_64, mingw32             
#;-)  ui       RTerm                       
#;-)  language (EN)                        
#;-)  collate  English_United States.1252  
#;-)  ctype    English_United States.1252  
#;-)  tz       America/New_York            
#;-)  date     2019-12-25                  
#;-) 
#;-) - Packages -------------------------------------------------------------------
#;-)  package     * version    date       lib source                            
#;-)  assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.6.1)                    
#;-)  backports     1.1.5      2019-10-02 [1] CRAN (R 3.6.1)                    
#;-)  cli           2.0.0      2019-12-09 [1] CRAN (R 3.6.1)                    
#;-)  crayon        1.3.4      2017-09-16 [1] CRAN (R 3.6.1)                    
#;-)  digest        0.6.23     2019-11-23 [1] CRAN (R 3.6.1)                    
#;-)  evaluate      0.14       2019-05-28 [1] CRAN (R 3.6.1)                    
#;-)  fansi         0.4.0      2018-10-05 [1] CRAN (R 3.6.1)                    
#;-)  fs            1.3.1      2019-05-06 [1] CRAN (R 3.6.1)                    
#;-)  glue          1.3.1.9000 2019-12-19 [1] Github (tidyverse/glue@b9ffe6c)   
#;-)  htmltools     0.4.0      2019-10-04 [1] CRAN (R 3.6.1)                    
#;-)  knitr         1.26.1     2019-12-05 [1] Github (yihui/knitr@33d69c3)      
#;-)  magrittr      1.5        2014-11-22 [1] CRAN (R 3.6.1)                    
#;-)  pillar        1.4.3      2019-12-20 [1] CRAN (R 3.6.2)                    
#;-)  pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 3.6.1)                    
#;-)  purrr         0.3.3      2019-10-18 [1] CRAN (R 3.6.1)                    
#;-)  Rcpp          1.0.3      2019-11-08 [1] CRAN (R 3.6.1)                    
#;-)  reprex        0.3.0.9001 2019-11-13 [1] Github (tidyverse/reprex@27aa69a) 
#;-)  rlang         0.4.2.9000 2019-12-12 [1] Github (r-lib/rlang@ec7c1ed)      
#;-)  rmarkdown     2.0.5      2019-12-20 [1] Github (rstudio/rmarkdown@7f51e23)
#;-)  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.6.1)                    
#;-)  stringi       1.4.3      2019-03-12 [1] CRAN (R 3.6.0)                    
#;-)  stringr       1.4.0.9000 2019-11-11 [1] Github (hadley/stringr@80aaaac)   
#;-)  styler        1.2.0.9000 2019-11-13 [1] Github (r-lib/styler@a8acde5)     
#;-)  tibble        2.1.3      2019-06-06 [1] CRAN (R 3.6.1)                    
#;-)  withr         2.1.2      2018-03-15 [1] CRAN (R 3.6.1)                    
#;-)  xfun          0.11.3     2019-11-22 [1] Github (yihui/xfun@4fcd6ff)       
#;-)  yaml          2.2.0      2018-07-25 [1] CRAN (R 3.6.0)                    
#;-) 
#;-) [1] C:/Program Files/R/R-3.6.1/library
@cderv
Copy link
Collaborator

cderv commented Dec 26, 2019

Hi,

could you precise your bookdown version (not included in your session info) and also your pandoc version ?

This is important to try reproduce the issue and fix it. Thank you !

@jooyoungseo
Copy link
Author

I am sorry, @cderv.

Tested bookdown version is ’0.16.5’
with pandoc version 2.9.

Please kindly let me know if there would be anything I have missed for debugging.

@ColinChisholm
Copy link

Writing to confirm this error
In the default example install of bookdown (i.e. Rstudio: New Project >> New Directory >> Book Project Using bookdown)

cross-referencing of sections in html output are displayed as '??' -- the hyperlink works but is displayed as '??'

excerpt from the 01-intro.rmd

# Introduction  {#intro} 

You can label chapter and section titles using `{#label}` after them, 
e.g., we can reference Chapter \@ref(intro). If you do not manually label them,
there will be automatic labels anyway, e.g., Chapter \@ref(methods).

The following warning is produced:

Warning messages:
1: The label(s) intro, methods not found 
2: The label(s) intro, methods not found 
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.6.1  bookdown_0.16   htmltools_0.4.0 tools_3.6.1    
 [5] yaml_2.2.0      Rcpp_1.0.3      rmarkdown_2.0.5 knitr_1.26     
 [9] xfun_0.11       digest_0.6.23   rlang_0.4.2     evaluate_0.14 
> rmarkdown::pandoc_version()
[1] ‘2.9.1.1’

@yihui yihui added the bug an unexpected problem or unintended behavior label Jan 10, 2020
@yihui yihui closed this as completed in 747ea88 Jan 10, 2020
@yihui
Copy link
Member

yihui commented Jan 10, 2020

Should be fixed now. You can install and test the development version via

remotes::install_github('rstudio/bookdown')

Thanks for the report!

yihui added a commit that referenced this issue Jan 12, 2020
@github-actions
Copy link

github-actions bot commented Nov 6, 2020

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants