Displaying 1 result from an estimated 1 matches for "otherkeyword".
Did you mean:
otherkeywords
2012 Nov 01
1
How to nicely display R code with the LaTeX package 'listings'?
...texttt{"}}}1{<-}{{$\leftarrow$}}1{<<-}{{$\twoheadleftarrow$}}1
{~}{{$\sim$}}1{<=}{{$\le$}}1{>=}{{$\ge$}}1{!=}{{$\neq$}}1{^}{{$^\wedge$}}1,% item to replace, text, length of chars
alsoletter={.<-},% becomes a letter
alsoother={$},% becomes other
otherkeywords={!=, ~, $, *, \&, \%/\%, \%*\%, \%\%, <-, <<-, /},% other keywords
deletekeywords={c}% remove keywords
}
\begin{document}
\noindent Just some text; see Line \ref{foo}.
\begin{lstlisting}[caption={A first example}, label=list:ex]
x <- c(1, 3, 2)
id <- function(x){
x...