In rmarkdown I want headings with sans serif font. I can achieve this with \textsf{}
latex command but later in the PDF there's no bookmark text shown. I already tried ## \textsf[Heading 1]{Heading 1}
but with an error as result.
Anybody got an idea how to get both?
MWE:
---
output: pdf_document
---
## \textsf{Heading 1}
Lorem ipsum dolor sit amet, sit id rebum choro euripidis, nam ei ullum tamquam scaevola, est veniam consulatu et. Duo ex utamur atomorum. His ad dicat pericula, solet appetere vel cu.
## \textsf{Heading 2}
Lorem ipsum dolor sit amet, sit id rebum choro euripidis, nam ei ullum tamquam scaevola, est veniam consulatu et. Duo ex utamur atomorum. His ad dicat pericula, solet appetere vel cu.
Output:
Wanted:
Bookmarks (left) with text 'Heading 1', 'Heading 2'.
Don't mix logical markup ("this is a heading") with physical markup ("this is sans serif"). Instead attach physical markup to logical markup, e.g. using the titlesec
package:
---
output: pdf_document
subparagraph: yes
header-includes:
- \usepackage[sf,bf]{titlesec}
---
## Heading 1
Lorem ipsum dolor sit amet, sit id rebum choro euripidis, nam ei ullum tamquam scaevola, est veniam consulatu et. Duo ex utamur atomorum. His ad dicat pericula, solet appetere vel cu.
## Heading 2
Lorem ipsum dolor sit amet, sit id rebum choro euripidis, nam ei ullum tamquam scaevola, est veniam consulatu et. Duo ex utamur atomorum. His ad dicat pericula, solet appetere vel cu.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With