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

No bs4_book chunk line numbering #1486

Open
moondog1969 opened this issue Jan 22, 2025 · 2 comments
Open

No bs4_book chunk line numbering #1486

moondog1969 opened this issue Jan 22, 2025 · 2 comments

Comments

@moondog1969
Copy link

moondog1969 commented Jan 22, 2025

I am unable to obtain chunk line numbers in bs4_book. When using:

# Test 1

```{r, attr.source='.numberLines'}
1 + 1
```

I get:

Image

Note the lack of line numbers in the chunk input. My YAML header is:

---
title: "Test"
author: "Author"
date: "2025-01-22"
output:
  bookdown::bs4_book:
---

Session specifics:

Running under: Windows 10 x64 (build 17134), RStudio 2024.9.1.394

Locale:
  LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
  LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
  LC_TIME=English_United States.1252    

Package version:
  base64enc_0.1.3   bookdown_0.39     bslib_0.8.0       cachem_1.1.0     
  cli_3.6.2         digest_0.6.35     evaluate_1.0.3    fastmap_1.2.0    
  fontawesome_0.5.3 fs_1.6.5          glue_1.7.0        graphics_4.4.2   
  grDevices_4.4.2   highr_0.11        htmltools_0.5.8.1 jquerylib_0.1.4  
  jsonlite_1.8.8    knitr_1.49        lifecycle_1.0.4   memoise_2.0.1    
  methods_4.4.2     mime_0.12         R6_2.5.1          rappdirs_0.3.3   
  rlang_1.1.3       rmarkdown_2.29    sass_0.4.9        stats_4.4.2      
  tinytex_0.54      tools_4.4.2       utils_4.4.2       xfun_0.43        
  yaml_2.3.8       
@cderv
Copy link
Collaborator

cderv commented Jan 23, 2025

bs4_book() is leveraging R package downlit to highlight R chunk as mentioned in the documentation
https://bookdown.org/yihui/bookdown/html.html#bs4-book

and there is an issue with numberline support

So this needs to be fixed upstream so that it can work in bookdown

@moondog1969
Copy link
Author

moondog1969 commented Jan 23, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants