search for: newcommand

Displaying 20 results from an estimated 50 matches for "newcommand".

2013 Aug 28
1
Error when using buildVignettes()
...ALSE); }#if }#xpsQAReport #------------------------------------------------------------------------------# The file "QC.begin.Rnw" is as follows: \documentclass{article} \textwidth=6.2in \textheight=8.5in %\parskip=.3cm \oddsidemargin=.1in \evensidemargin=.1in \headheight=-.3in \newcommand{\Rfunction}[1]{{\texttt{#1}}} \newcommand{\Rmethod}[1]{{\texttt{#1}}} \newcommand{\Rcode}[1]{{\texttt{#1}}} \newcommand{\Robject}[1]{{\texttt{#1}}} \newcommand{\Rpackage}[1]{{\textsf{#1}}} \newcommand{\Rclass}[1]{{\textit{#1}}} \newcommand{\Cclass}[1]{{\textit{#1}}} \newcommand{\Rexten}[1]{{\textit...
2002 Nov 13
1
Package documentation and rd.sty
Hi all, I've got a basic question regarding package documentation and rd.sty. I wrote my first own package, and now I would like to place the documentation into the appendix of another LaTex document. Seemingly I cannot simply \usepackage{Rd}, as this will modify the page-settings of my document. Is there a minimum style file which will just define the environments and commands needed for
2004 Jun 25
2
Sweave: R code in self defined TeX-commands
Hi, I need to produce a standard report for several variables in Sweave and thus would need the possibility to define a TeX-command which includes R-code like \newcommand{\meansd}[1]{The mean is \Sexpr{mean(#1)} and the standard deviation is \Sexpr{sd(#1)} . } and then just write \meansd{age} in the latex code to get the whole sentence. The above does not work, since Sweave ignores the \newcommand and does not expand the \statistics Is...
2008 Mar 07
3
R-Logo in \LaTeX (Mag. Ferri Leberl)
Dear Mag. Ferri Leberl, I'm using something like: ----------------------- tex.tex --------------------------- \documentclass{article} \usepackage{graphicx} \usepackage{fancyvrb} \newcommand{\Rlogo}{\protect\includegraphics[height=1.8ex,keepaspectratio]{Rlogo.pdf}} \newcommand{\myinput}[1] {\begin{scriptsize} \VerbatimInput[frame=single,label=#1]{#1} \end{scriptsize}} \title{The R logo, \Rlogo, in \LaTeX} \author{J.R. Lobry} \begin{document} \maketitle \section{Introduction to \...
2008 Mar 07
3
R-Logo in \LaTeX (Mag. Ferri Leberl)
Dear Mag. Ferri Leberl, I'm using something like: ----------------------- tex.tex --------------------------- \documentclass{article} \usepackage{graphicx} \usepackage{fancyvrb} \newcommand{\Rlogo}{\protect\includegraphics[height=1.8ex,keepaspectratio]{Rlogo.pdf}} \newcommand{\myinput}[1] {\begin{scriptsize} \VerbatimInput[frame=single,label=#1]{#1} \end{scriptsize}} \title{The R logo, \Rlogo, in \LaTeX} \author{J.R. Lobry} \begin{document} \maketitle \section{Introduction to \...
2008 Nov 14
1
Line breaks in mathematical formulae in Rd files (PR#13287)
Hi, This is a problem about writing R documentation (R-exts 2.6). The command "\deqn" defined in "Rd.sty" is: \newcommand{\deqn}[2]{\[#1\]} which will put mathematical formulae in the "displaymath" environment; that means line breaks are not allowed (or will not be shown) in formulae, but sometimes we do need multiple lines of formulae. One solution is to write several equations using "\deqn", but...
2008 Jun 13
4
Sweave: looping over mixed R/LaTeX code
...# I can't simply start a for loop within an R chunk and finish it in another one. whiledo in the ifthen.sty package doesn't like Sweave at all. And of course, it would simply reuse the R chunks if it did work, without changing things between loops. For the same reason, I cannot define a \newcommand{\loopcontent}{...} with the entire loop contents and then simply write \loopcontent \loopcontent ... or \input or \include the loop content from an external file. Of course it would be possible to not use Sweave and just use the output from the R console, but there are a couple of figures I would...
2018 May 25
2
Rd parser throws error for user macros invoked with empty argument
While on the topic of Rd macro arguments, it seems that if a multiline argument is supplied, the lines after the first are silently ignored: f <- tempfile() mac6 <- "\\newcommand{\\mac6}{mac6: #1}" cat(mac6, "\\mac6{2*3 2+2 sin(pi) }\n", file = f) rd <- tools::parse_Rd(f) > rd mac6: 2*3 --- Georgi Boshnakov -----Original Message----- From: Tomas Kalibera [mailto:tomas.kalibera at gmail.com] Sent: 25 May 2018 10:05 To: Georgi Boshnakov; r-devel a...
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,% xleftmargin=4ex,literate={<-}{{$\leftarrow$}}1 {~}{{$\sim$}}1} \lstset{escapeinside={(*}{*)}} % for (*\ref{ }*) inside lstlistings (S code) \begin{lst...
2004 Nov 09
0
Is nesting {} inside \eqn OK?
...ed braces. For reference, particularly in case I've missed something earlier, here is a fuller excerpt from the input file: -------------------------------------------- With \eqn{J} possible outcomes and \eqn{p_j}{p(j)} the probability of the \eqn{j}'th outcome, the formula is \deqn{\newcommand{\B}{{\bf \beta}}\newcommand{\X}{{\bf X}} p_j = \frac{e^{\X\B_j}}{\displaystyle\sum_{k=0}^J e^{\X\B_k}}.}{ p(j) = exp[X*b(j)]/sum{exp[X*b(k)], k=0 to J}.} \eqn{{\bf\beta}_j}{b(j)} is the vector of coefficients for outcome \eqn{j} and \eqn{{\bf X}}{X} are the covariates. ----------------...
2005 Jul 19
1
translation with Rd.sty, Sweave and tex4th (PR#8016)
...I'm using Sweave with tex4th to generate xhtml documents from documents created using Sweave which include \usepackage{Rd} in the preamble However there seems to be a problem with \Link defined in Rd.sty, since this is also defined in tex4ht.sty My workaround was to replace the lines with \newcommand{\Link} by \providecommand{\Link} in Rd.sty I'm therefore wondering whether this is the best solution, if there is any other and, if so, whether this could be modified in the original Rd.sty shipped with R. A possible inconvenient of the suggested above is that \providecommand seems to be spec...
2004 Jul 29
2
expression + paste + arguments + ...
dear R wizards: I would like to write a function that roughly places the equivalent of the following latex text into the current plot: \newcommand{ \placesigma }[4]{ \put(\#1,\#2){ \sigma_{A , #3} = #4 } I cannot figure out how to do this. I know I have to use a function that uses expressions in a text() invoke. But passing arguments and nesting strings and expressions has so far not worked for me. I hope this is an obvious question---...
2018 May 14
3
Rd parser throws error for user macros invoked with empty argument
Bug or feature? I get the following error from parse_Rd() when a user Rd macro (including system ones) is invoked with empty argument {}, eg \mymacro{}: Error in tools::parse_Rd(fn) : Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'NULL' A full example is further below with the system macro \CRANpkg{}. In this example it doesn't make sense to use empty argument but
2016 Sep 09
2
¿Cómo generar tabla apaisada salida PDF con RMarkdown?
...: el entorno que genera es flotante, por lo que se insertar segn las reglas de composicin de LaTeX y no ah mismo donde uno est escribiendo. Un posible header.tex para ver las dos soluciones: |||%para que rote con xtable ||\usepackage{rotating}|| %para girar a piacere ||\usepackage{lscape}|| ||\newcommand{\blandscape}{\begin{landscape}}|| ||\newcommand{\elandscape}{\end{landscape}}| og., 2016.eko iraren 08a 18:36(e)an, Carlos Ortega igorleak idatzi zuen: > Hola, > > Creo que esta referencia de StackOverflow te puede ayudar: > > http://stackoverflow.com/questions/25849814/rstudio-rm...
2007 Nov 28
2
[OT] putting URLs in Latex
Hi R Gurus! This is definitely off topic, but I thought I'd try: what is the way to put in url's into a Latex file, please? I know that you start with a \newcommand statement, with some kind of argument that will change, but I'm not sure how to set it up, please. thanks, Edna Bell
2011 Apr 17
1
sweave options with variable
...weave option by variable, for example I want set some of my selected code chunk with: <<eval=needRun>>= rather than <<eval=TRUE>>=, so I can change the action only in the head by change the variable "needRun" one times. I have tried use "\Def" and "\newcommand", both do not work, so I suppose it is related with R/Sweave its self. thanks for any good suggestion. [[alternative HTML version deleted]]
2012 Apr 04
3
Rgui maintains open file handles after Sweave error
...ve at ae}}{% \RequirePackage[T1]{fontenc} \RequirePackage{ae} }{}% \DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl} \DefineVerbatimEnvironment{Soutput}{Verbatim}{} \DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl} \newenvironment{Schunk}{}{} \newcommand{\Sconcordance}[1]{% \ifx\pdfoutput\undefined% \csname newcount\endcsname\pdfoutput\fi% \ifcase\pdfoutput\special{#1}% \else\immediate\pdfobj{#1}\fi}
2008 Nov 22
1
declaring constants in an Sweave / LaTeX document
List, I would like to set a variable to hold, say, the size of my plots in a Sweave document. i.e. something like the following in my '.Rnw' file: ============================================================================== smallPlotSize = 4 <<fig1, echo=false, results=hide, height=smallPlotSize, width=smallPlotSize, fig=true>>= dat <- read.table("
2018 Jun 01
0
user macros with multi-line arguments in Rd (was Re: Rd parser throws error for user macros invoked with empty argument)
...multi-line arguments to user macros. Best Tomas On 05/25/2018 04:45 PM, Georgi Boshnakov wrote: > While on the topic of Rd macro arguments, it seems that if a multiline argument is supplied, the lines after the first are silently ignored: > > f <- tempfile() > mac6 <- "\\newcommand{\\mac6}{mac6: #1}" > > cat(mac6, "\\mac6{2*3 > 2+2 > sin(pi) > }\n", file = f) > rd <- tools::parse_Rd(f) > >> rd > mac6: 2*3 > > --- > > Georgi Boshnakov > > > -----Original Message----- > From: Tomas Kalibera [mailto:tomas....
2010 Aug 07
0
several figures from one Sweave chunk? [solved]
...stats. This would require to loop over mixed R/LaTeX code, something not allowed by Sweave. Fortunately, I found a way to work around, based on the Sweave FAQ [1]. If you need not only graphs, but some LaTeX markup as well, Dieter Menne proposed a very elegant solution that involved defining a \newcommand containing most LaTeX code and calling it in the R loop via a cat() statement [2]. Another alternative is to put all LaTeX code in cat() statements, but this tends to get messy. The final hurdle was to output some 'verbatim' text from within a <<results=tex>>= @ code chunk,...