# knitr: less/greater than sign displayed as (¡) and (¿)

I'm a beginner in using knitr to generate a report. I have a R script (see below for an example; BTW I'm using RStudio for all of this) that runs without error and the output is a data frame. My rnw.file looks like this:

% !Rnw weave = knitr
\documentclass[a4paper]{article}
\begin{document}
<<echo=FALSE,message=FALSE>>=
source("test.R")
kable(test.mat)
@
\end{document}


which displays the table quite nicely. The only problem I have is with the ">" (greater than) sign in the last column which is shown as "¿".

\usepackage[T1]{fontenc}


but this doesn't seem to do the trick here. Having included this, I can start compiling the script but after 10 minutes or so (and w/o it only took me some seconds to compile) I run into an error (exit code: 1).

Also, $>$ will not work for me here, and is displayed as $¿$ in the pdf. I've already asked this question here w/o getting a elegant solution so far.

R.script (saved as "test.R"):

temp <- 12
test.mat <- as.data.frame(matrix(NA,ncol=2,nrow=1))
test.mat$V1 <- 2 test.mat$V2 <- paste(temp,"subjects > 28 days",sep=" ")

• Find out what's the problem with \usepackage[T1]{fontenc} by compiling a small document without some R.script. – Ulrike Fischer Jun 25 '15 at 8:48
• Actually, I can't quite figure it out. It's also not working in an ordinary tex.document (using TeXnicCenter). I tried \usepackage[latin1]{inputenx} and can compile w/o problems, but not solving the initial problem with the ">" symbol being displayed as "¿". – Johanna Jun 25 '15 at 9:43
• Well you will have to figure it out. \usepackage[T1]{fontenc} should work. If it doesn't work in a minimal document your system is broken. Show the log-file. – Ulrike Fischer Jun 25 '15 at 9:51

\usepackage{lmodern}