R Markdown is working properly on the headers of my document, but not the body, as spanish characters look different. When I use pure Latex (Overleaf) it works in both the body and header.
If I copy-paste spanish characters (eg. á, é, ñ, ó) they are preserved as such, but if I use the backslash-hyphen method (\'a, \'e, \~n, \'o) they only translate properly in the headers of the document but not the body.
I already checked if i was using utf8 (I was), and the headers-include and \usepackage functions didn't help either.
\section{Secci\'on \~n}
Hola, esta es mi primera edici\'on de texto
\subsection{Subsecci\'on}
Esto deber\'ia ser una subsecci\'on.
Ahora, anotaré una f\'ormula, tal que $\lim_{x \rightarrow y} x = y$
This is how it currently knits:
As you can see, the headers display said characters properly, while the body only renders spanish characters correctly if It type them directly (the e), which I can't do because my keyboard doesn't have them. Using unicode is a not an ideal solution.
