Displaying 20 results from an estimated 200 matches similar to: "How to nicely display R code with the LaTeX package 'listings'?"
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
2006 Sep 25
3
Best use of LaTeX listings package for pretty printing R code
This is what I have been using. Does anyone have a better way? In
particular I would like to see letters in comment strings not stretched
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,%
2011 Nov 23
1
R-latex syntax highlighting?
Hello,
Can anyone provide or point me to a good setup for the listings latex package that would produce nice R-syntax highlighting?
I am using an example I found in internet for setting up listings like this:
\lstset{
language=R,
basicstyle=\scriptsize\ttfamily,
commentstyle=\ttfamily\color{gray},
numbers=left,
numberstyle=\ttfamily\color{red}\footnotesize,
stepnumber=1,
numbersep=5pt,
2009 Sep 03
1
Sweavelistingutil: Encoding problems
Hello,
I am not sure whether this is a bug or lack of R experience.
However, I am using your Sweavelistingutil package, which is very
nice. Obviously I use it to create LaTeX files. These are encoded in
utf8.
However, when I use the Sweavelistingutil is uses some funky
character for "`" and "'" that is not recognized.
Here is an example from my tex-file:
,----
|
2008 Oct 17
1
R-code in Latex --- $ sign causes error
hi,
here's what i have:
\lstset{
basicstyle=\ttfamily,
keywordstyle=\bfseries,
showstringspaces=false,
columns = fullflexible,
mathescape = true,
language=R
}
\begin{lstlisting}
lst$val<-val
\end{lstlisting}
./software.tex:16:Extra }, or forgotten \endgroup. lst$
the culprit here is the $ sign.
thanks.
ps:
i'm posting here rather than Latex is bec i guess an R user is
2004 Oct 04
4
Off-Topic: LaTeX package listings
Hola!
I ask here since I learnt from this list that the LaTeX package listings
should be good
for typesetting R code. I encountered one problem:
\begin{lstlisting}
X %*% V
\end{lstlisting}
in the output the * in %*% disappears! same with %/%, etc, the /
disappears.
Any ideas?
Kjetil
--
Kjetil Halvorsen.
Peace is the most effective weapon of mass construction.
--
2009 Jul 13
3
SweaveListingUtils question
Hello,
recently I read about the SweaveListingUtils package and now I want to try
it out. However, I can not make it work...
Below a minimal example. The problem seems to be the following line
(generated by SweaveListingPreparations()?):
\ifthenelse{\boolean{Sweave@gin}}{\setkeys{Gin}{width=0.6\textwidth}}{}%
If I comment out this line, it works.
What can I do about this?
I am using the
2001 Jan 27
1
Off-topic: Pretty-printing R (or S) code with GNU a2ps
--oP8mQFO4PT
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
GNU a2ps is a fairly versatile text-to-anything processor. It is useful for
typsetting source code from a wide variety of programming languages. As R
(ie S) wasn't supported yet, I quickly cobbled a style sheet for the S
language together. Stylesheets are
2006 Sep 17
2
Insert R code in LaTeX document
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20060917/27772bd9/attachment.pl
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
2009 Jun 26
0
Modifying Sweave.sty to allow escapes with fancyvrb package in LaTeX
Dear Colleagues:
In an attempt to have things like # See page \pageref{this} inside
comments in R code chunks I have modified Sweave.sty as below. I have
followed fancyvrb's manual with regard to the use of the commandchars
argument. But when compiling with LaTeX (using attached test file) I
get a LaTeX error
(/usr/share/texmf-texlive/tex/latex/ae/t1aett.fd)
! Missing \endcsname
2006 Apr 26
2
Rich text editing
Hi people, i just finished my first weblog, with comments, auth and
admin zone(yay!) so i was looking for a way to make a rich text editor
zone for the posts, right now im using textilize() and <br> html tags to
format the text and breaklines so hope some one can give a reference in
how to achieve that.
Already told you that this rails stuff its amazing :)
--
Posted via
2009 Mar 17
1
Combining Sweave and fancyvrb
I find Sweave very useful and I was trying to combine it with the
latex package fancyvrb. I was trying to get line numbering and labels
in order to reference the lines where particular commands occur.
Unfortunately, I haven't been able to figure out how to do it. Maybe
somebody can help me.
The following is a sample Rnw file: the first part shows what I would
like to get, the second what I
2019 Nov 22
0
[RFC virtio 12/13] virtio-iommu: Add built-in topology description
Add a lightweight method to describe the IOMMU topology in the config
space, guarded by a new feature bit. A list of capabilities in the
config space describes the devices managed by the IOMMU and their
endpoint IDs.
Signed-off-by: Jean-Philippe Brucker <jean-philippe at linaro.org>
---
virtio-iommu.tex | 88 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
2012 Jun 02
0
[LLVMdev] LLVM markup for LaTeX lstlisting
Dear colleagues,
Yesterday a question regarding existence of <subj> was raised on IRC.
FWIW, attached are TeX source with \lstdefinelanguage{llvm}, based on
the vim syntax file and a sample PDF output. You can include it to
your LaTeX articles or beamer slides.
Also, it would be great, if someone could highlight types or improve
it in any other way!
Best,
- Dima.
-------------- next part
2001 May 02
2
rcode and latex
I have discovered the listings package for including code in your latex
documents. The default languages do not include 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},%
2009 Apr 16
2
there are fontencoding problem in Sweave
I want write article by russian language using Sweave. For cyrillic text
LaTeX use T2A encoding
\usepackage[T2A]{fontenc}
But in Sweave.sty we find:
\RequirePackage[T1]{fontenc}
It is source of critical problem.
For example Rnw file
$ cat estimation.Rnw
\documentclass[A4paper]{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
2015 Aug 16
5
[PATCH v2 0/2] virtio-net: default_mtu - new conf. field
This set of two patches adds a new field called default_mtu to
the configuration area of network devices. The motivation is to
allow libvirt to set initial MTU different from 1500 on guests
virtual NICs. We also propose to use this new field to report
MTU changes by the guest OS to the device to facilitate
debugging and mtu tunning.
The first patch just clarify the definition of existing fields
2015 Aug 16
5
[PATCH v2 0/2] virtio-net: default_mtu - new conf. field
This set of two patches adds a new field called default_mtu to
the configuration area of network devices. The motivation is to
allow libvirt to set initial MTU different from 1500 on guests
virtual NICs. We also propose to use this new field to report
MTU changes by the guest OS to the device to facilitate
debugging and mtu tunning.
The first patch just clarify the definition of existing fields
2015 Aug 17
0
[PATCH v2 1/2] virtio-net: rephrase devconf fields description
On 08/16/2015 09:42 PM, Victor Kaplansky wrote:
> Clarify general description of the mac, status and
> max_virtqueue_pairs fields. Specifically, the old description is
> vague about configuration layout and fields offsets when some of
> the fields are non valid.
>
> Also clarify that validity of two status bits depends on two
> different feature flags.
>
> Signed-off-by: