I am using overleaf to write a LaTeX document. I want to include some R code blocks with minted, but minted displays my arrows in the code "<-" like this: "¡-". How can I fix this? I encoded both the code and my LaTeX document in utf8. It also omits underscore symbols "_" and brackets "{}.
It does not work if I include the code directly
\begin{minted}[linenos,breaklines,bgcolor=myLightGray]{r}
check_create_dir <- function(path) {
print("using existing folder")
}
\end{minted}
And if I load a file:
\inputminted[linenos,breaklines,bgcolor=myLightGray]{R}{code/test.R}

\usepckage[T1]{fontenc}in the LaTeX preamble help? – Rmano Apr 26 '21 at 14:48<<eval=F>>=and other line with@and save the file with the.Rtexextension (in Overleaf) or .Rnw (using Rstudio). – Fran Apr 28 '21 at 02:57