In my R Markdown document in R, I want to replace the header labeled "Preface" with grey lines for visual indication. Here's the code snippet I've tried:
:::{#preface}
<p>
Text
</p>
:::
However, there seems to be no margin at the beginning and some at the end. Adding a <br>
is too much, and I'm looking for a solution similar to this document with proper spacing.
I can't use padding because I already have borders applied through CSS:
#preface{
border-top:1px solid #a19c97;
font-size: 16px;
border-bottom:1px solid #a19c97;
}
Any suggestions would be greatly appreciated!
EDIT: One potential solution could involve adding two more CSS IDs – one before and one after the #preface ID – with the borders specified in those IDs and using padding within the preface ID. I'll explore this option if a better solution doesn't arise.