As per this page on the R Markdown website, you can add whatever you want to the preamble via the in-header
option in the YAML header; e.g.,
----
title: "Titre"
date: Fecha
output:
pdf_document:
includes:
in_header: mystyles.sty
----
In mystyles.sty
, located in the same directory as the .Rmd, you could have a whole list of additional things to add to the preamble of document, e.g.:
\usepackage{bbm}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{expex}
Etc. The contents of mystyles.sty
are then pasted into the LaTeX preamble; check out the default LaTeX template used here to see where precisely in the preamble they are included.
As a minimal example I tested an Rmd document with the header from above including the .sty from above and having the following in the body of the document:
$$ y_{ij} = b_{ij} + \beta_{0} + \beta_{1} $$
Test test $\mathbb{1}$ test.
\usepackage{bbm}
belongs to the preamble of the document, not to the document body. Meaning, move this part above\begin{document}
.