thule
January 30, 2024, 11:49am
1
Since RStudio version 2022.12.0 Build 353: The upper navigation bar covers the title of the page.
The html is shown correctly in the window which opens after knitting but not online: See matstat.org (https://matstat.org/index.html ).
cderv
March 5, 2024, 1:37pm
2
As this is showing inside you website, outside of the IDE, I would think this is an issue R Markdown directly.
I believe this issue has been fixed:
opened 06:23PM - 13 Jun 22 UTC
closed 10:59AM - 16 Jun 22 UTC
theme: bootstrap
next
**The problem:** When there is a navbar in an html_document, the <style> element… added via javascript to adjust the navbar is not added for the index page in bootstrap 5. This causes the header to hide under the navbar. Also, the active navbar is never highlighted when page is index.
**_site.yml**
```
name: "my-website"
navbar:
title: "My Website"
left:
- text: "Home"
href: index.html
- text: "About"
href: about.html
output:
html_document:
theme:
version: 5
```
**index.Rmd**
```
---
title: "Index"
---
index here
```
**about.Rmd**
```
---
title: "About"
---
about here
```
The index page's header hides under the nav bar
<img width="285" alt="Screen Shot 2022-06-13 at 1 07 06 PM" src="https://user-images.githubusercontent.com/972487/173416982-9f3f1b62-a2c5-47b2-9f95-316f6076e084.png">
The about page displays correctly. The html outputs of the two pages look identical, but when comparing the pages through the browser's inspector, you see that a `<style>` element is missing in the index page. This element is produced by the javascript chunk with comment `// manage active state of menu based on current page`
Looking at the [default.html](https://github.com/rstudio/rmarkdown/tree/main/inst/rmd/h/default.html) document, it seems the problem is the javascript section between lines 269-298. There is a problem with menuAnchor, but I don't know what it is. I just know that the style element the JS adds is not added when in index.html, and that causes problems. When in index, the `document.head.appendChild(style)` does not add anything because `style` is empty.
```
> xfun::session_info('rmarkdown')
R version 4.2.0 (2022-04-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7, RStudio 2022.2.3.492
Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
Package version:
base64enc_0.1.3 bslib_0.3.1 digest_0.6.29 evaluate_0.15 fastmap_1.1.0
fs_1.5.2 glue_1.6.2 graphics_4.2.0 grDevices_4.2.0 highr_0.9
htmltools_0.5.2 jquerylib_0.1.4 jsonlite_1.8.0 knitr_1.39 magrittr_2.0.3
methods_4.2.0 R6_2.5.1 rappdirs_0.3.3 rlang_1.0.2 rmarkdown_2.14
sass_0.4.1 stats_4.2.0 stringi_1.7.6 stringr_1.4.0 tinytex_0.39
tools_4.2.0 utils_4.2.0 xfun_0.31 yaml_2.3.5
Pandoc version: 2.17.1.1
```
<!--
Welcome to the rmarkdown GitHub repo!
We are always happy to hear feedback from our users.
To file a _bug report_, please follow these instructions carefully: <https://yihui.org/issue/#bug-reports>
Also, please complete and keep the checklist below in your issue. This helps you know what to check for opening a good issue report. It also helps know that you've have done the common steps that can solve your potential issue.
At last, if you have posted the same issue elsewhere, please mentioned it (with a link to the other issue).
-->
## Checklist
When filing a _bug report_, please check the boxes below to confirm that you have provided us with the information we need. Have you:
- [x] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [x] included a minimal, self-contained, and reproducible example?
- [x] pasted the output from `xfun::session_info('rmarkdown')` in your issue?
- [x] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
- [ ] installed and tested your bug with the development version of the rmarkdown package using `remotes::install_github("rstudio/rmarkdown")`?
It is available in v2.15 .
Can you check rmarkdown version you are using in your project ?
If this is still happening with latest versions of tools, can you open a new issue in R Markdown repo ?
Thank you
system
Closed
April 19, 2024, 1:38pm
3
This topic was automatically closed 45 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.