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

Underscore does not appear in script #1383

Open harD2 opened 2 years ago

harD2 commented 2 years ago

I am running Ubuntu 22.04, though this has been an ongoing issue since I was running 20.04. The underscore in my scripts does not always show up. It appears as though there is a space there, but when the script it run, you can see the underscore in the terminal. It's mostly a pain for troubleshooting. I tried changing the appearance and font in global options, but it did not solve the problem. Unfortunately, since I can't figure out what prompts the glitch, I cannot provide a reproducible example. It does not seem to be an issue with a certain package, as far as I can tell. If I close and reopen the script, the underscores are still missing.

Here's some potentially relevant info:

RStudio 2022.07.1+554 "Spotted Wakerobin" Release (7872775ebddc40635780ca1ed238934c3345c5de, 2022-07-22) for Ubuntu Jammy Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36


R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8        LC_COLLATE=en_CA.UTF-8     LC_MONETARY=de_DE.UTF-8   
 [6] LC_MESSAGES=en_CA.UTF-8    LC_PAPER=de_DE.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13  magrittr_2.0.3   tidyselect_1.1.2 R6_2.5.1         rlang_1.0.4      rstatix_0.7.0    carData_3.0-5    fansi_1.0.3     
 [9] car_3.1-0        dplyr_1.0.9      tools_4.2.1      broom_1.0.0      utf8_1.2.2       cli_3.3.0        DBI_1.1.3        abind_1.4-5     
[17] assertthat_0.2.1 tibble_3.1.8     lifecycle_1.0.1  purrr_0.3.4      tidyr_1.2.0      vctrs_0.4.1      glue_1.6.2       compiler_4.2.1  
[25] pillar_1.8.0     generics_0.1.3   backports_1.4.1  pkgconfig_2.0.3```
cderv commented 2 years ago

The underscore in my scripts does not always show up. It appears as though there is a space there, but when the script it run, you can see the underscore in the terminal.

Do you mean in your source Rmd file ? Is it when opening in the RStudio IDE ? Another tool ?

Or Do you mean in the resulting document ? The HTML or PDF book ?

How does it relate to bookdown ? Is this happening only with such project ?

Without much information it is hard to see exactly the situation. An example would help. I am just not sure this is something related to bookdown for which this issue tracker is about. But maybe I am missing something...