Displaying 9 results from an estimated 9 matches for "leftarrow".
2001 May 02
2
rcode and latex
...clude R or Splus, but the
definition is pretty simple, this is what I did for R:
\lst at definelanguage{R}%
{morekeywords={TRUE,FALSE,T,F,NA,NULL,Inf,NaN,library,%
attach,detach,source,while,for,in,%
repeat,switch,break,next,return,stop,function,%
if,else,warning,error},%
literate={<-}{{$\leftarrow$}}1{<<-}{{$\leftarrow \!\!\!\!\leftarrow$}}1 ,%
sensitive=true,%
morecomment=[l]\#,%
morestring=[d]",%
morestring=[d]'%
}[keywords,directives,comments,strings]
This is saved somewhere on your $TEXINPUTS path as lstlang0.sty. Probably
someone has already done this, so I would be ha...
2012 Nov 01
1
How to nicely display R code with the LaTeX package 'listings'?
...low
breaklines=true,% automatic line breaking
escapeinside={(*}{*)},% escaping to LaTeX
fancyvrb=true,% verbatim code is typset by listings
extendedchars=false,% prohibit extended chars (chars of codes 128--255)
literate={"}{{\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={!=, ~, $, *, \&, \...
2006 Sep 25
3
Best use of LaTeX listings package for pretty printing R code
...retched
so much. Thanks -Frank
\documentclass{article}
\usepackage{listings,relsize}
\lstloadlanguages{R}
\newcommand{\lil}[1]{\lstinline|#1|}
\begin{document}
\lstset{language=R,basicstyle=\smaller,commentstyle=\rmfamily\smaller,
showstringspaces=false,%
xleftmargin=4ex,literate={<-}{{$\leftarrow$}}1 {~}{{$\sim$}}1}
\lstset{escapeinside={(*}{*)}} % for (*\ref{ }*) inside lstlistings (S
code)
\begin{lstlisting}
a <- b # this is a test line
if(i==3) { # another line, for y^2
y <- 3^3
z <- 'this string'
qqcat <- y ~ pol(x,2)
} else y <- 4
\end{lstlisting}
Tha...
2024 Mar 04
1
[External] Re: capture "->"
...e it and do the
reverse replacement.
> encode <- function(string)gsub(perl=TRUE, "->", "<<-", x=string)
> decode <- function(string)gsub(perl=TRUE, "<<-", "->", x=string)
> rightArrow <- as.name("<<-")
> leftArrow <- as.name("<-")
> ast1 <- parse(text=encode("x1 + x2 -> a3"))[[1]]
> ast2 <- parse(text=encode("y4 <- b5 + (b6 / b7)"))[[1]]
> identical(ast1[[1]], rightArrow)
[1] TRUE
> identical(ast2[[1]], leftArrow)
[1] TRUE
> ast1[[3]] <- as.na...
2024 Mar 04
1
[External] Re: capture "->"
Dear Barry,
In general, I believe users are already accustomed with the classical
arrows "->" and "<-" which are used as such in quoted expressions.
But I agree that "-.>" is a very neat trick, thanks a lot. A small dot,
what a difference.
All the best,
Dmitri
On Mon, Mar 4, 2024 at 11:40?AM Barry Rowlingson <
b.rowlingson at lancaster.ac.uk> wrote:
2001 Jan 27
1
Off-topic: Pretty-printing R (or S) code with GNU a2ps
..., ie /usr/share/a2ps/sheets/.
Usage then simply becomes
a2ps -Pdisplay foo.R
or
a2ps foo.R -o foo.ps; gv foo.ps
in case the "display" device isn't defined.
A few points / questions:
* content: a2ps uses tricks to use TeX symbols. It works well to typset
<- with \leftarrow (uncomment that in s.ssh to see) but I couldn't tell
it to parse
a<-2
it only finds <- with whitespace, eg
a <- 2
What could be done about <<- ? Is there a matching TeX symbol?
* more content: Is the list of keywords really that short? I couldn't find...
1998 Sep 28
0
adding math(s) symbols to src/main/plotmath.c
...zeta", 122,
+ "therefore", 93,
+ "perp", 95,
+
+ "lteq", 163,
+ "infinity", 165,
+ "clubsuit", 167,
+ "diamondsuit", 168,
+ "heartsuit", 169,
+ "spadesuit", 170,
+ "biarrow", 171,
+ "leftarrow", 172,
+ "uparrow", 173,
+ "rightarrow", 174,
+ "downarrow", 175,
+ "degree", 176,
+ "plusminus", 177,
+ "gteq", 179,
+ "times", 180,
+ "propto", 181,
+ "partial", 182,
+ "bullet",...
2007 Jan 15
4
How to format R code in LaTex documents
Hi,
I am planning on putting some R script in an appendix of a LaTex
document. Can anyone recommend me a way of how to format it? Is there
a way to keep all line breaks without having to insert \\ in every
single line?
Thank you!
Benjamin
2009 Jan 28
2
OT: Adding verbatim R code text into LaTeX documents: texttt; verb or url?
Hi all
I use Sweave extensively to mix R and LaTeX, and often have R code appearing in my LaTeX document.
Just a quick question then: What is the best way to add example of R commands into LaTeX in-line? (That is, not using Sweave.) For example, suppose I wish to place in my document this instruction:
...is done in R using the command \verb|lm( y ~ var.one + var.two )| as follows:
I