Hi, pretty new with R and LaTeX here... I'm trying to use the latex() function from the Hmisc table with Sweave. When I try: pdflatex myfile.tex I get an error that reads: ! Undefined control sequence. l.22 \ctable It seems like this is an optional package for Tex that I haven't installed? My googling skills have neglected to locate instructions for how to install ctable on a Mac, though I've locate the ctable package. I reinstalled MacTex-2009 in hopes of solving the problem, but so far it hasn't helped. Can anybody shed light on this error and how I might fix it? Thanks, Clay
Clay Heaton wrote:> Hi, pretty new with R and LaTeX here... > > I'm trying to use the latex() function from the Hmisc table with Sweave. When I try: > > pdflatex myfile.tex > > I get an error that reads: > > ! Undefined control sequence. > l.22 \ctable > >What does your function call to latex look like? I didn't look this up, but I seem to recall there being a ctable argument, which will use ctable instead of the standard tabular environment. I've never used it before, but if there's no need to use it, don't.
On 23/03/2010, at 12:35 PM, Clay Heaton wrote:> Hi, pretty new with R and LaTeX here... > > I'm trying to use the latex() function from the Hmisc table with Sweave. When I try: > > pdflatex myfile.tex > > I get an error that reads: > > ! Undefined control sequence. > l.22 \ctable > > > It seems like this is an optional package for Tex that I haven't installed? My googling skills have neglected to locate instructions for how to install ctable on a Mac, though I've locate the ctable package. I reinstalled MacTex-2009 in hopes of solving the problem, but so far it hasn't helped. > > Can anybody shed light on this error and how I might fix it?What does locate ctable (typed in a terminal window) give you? I get (a whole load of stuff) and . . . /usr/local/texlive/2008/texmf-dist/doc/latex/easy/doc.dvi/doctable.dvi /usr/local/texlive/2008/texmf-dist/source/latex/ctable /usr/local/texlive/2008/texmf-dist/source/latex/ctable/ctable.dtx /usr/local/texlive/2008/texmf-dist/source/latex/ctable/ctable.ins . . . Also does texdoc ctable give any results? If either of these commands gives a result, then you *have* ctable. The reason that pdflatex isn't finding it may relate to your tex search path (controlled by the environment variable TEXINPUTS) --- but normally you should not need to set this. cheers, Rolf Turner ###################################################################### Attention: This e-mail message is privileged and confidential. If you are not the intended recipient please delete the message and notify the sender. Any views or opinions presented are solely those of the author. This e-mail has been scanned and cleared by MailMarshal www.marshalsoftware.com ######################################################################
Clay Heaton wrote:> > Hi, pretty new with R and LaTeX here... > > I'm trying to use the latex() function from the Hmisc table with Sweave. > When I try: > > pdflatex myfile.tex > > I get an error that reads: > > ! Undefined control sequence. > l.22 \ctable > > > It seems like this is an optional package for Tex that I haven't > installed? My googling skills have neglected to locate instructions for > how to install ctable on a Mac, though I've locate the ctable package. I > reinstalled MacTex-2009 in hopes of solving the problem, but so far it > hasn't helped. > > Can anybody shed light on this error and how I might fix it? > > Thanks, > Clay >The "undefined control sequence" error from LaTeX usually means you haven't loaded a latex package that provides a given command or environment. Just as you have to load a package in R using library() or require() before you can use functions from that package, you have to specify in your LaTeX document that you are going to use a given package before you can use commands for that package. This is indicated by adding: \usepackage{packageName} Somewhere before the \begin{document} statement in your Sweave/LaTeX file. If you don't have the package installed, you will get an error message that looks like: ! LaTeX Error: File `packageName.sty' not found. You can check to see if a given LaTeX package is installed on your system using the kpesewhich command that works similarly to the Unix/Linux command which: kpsewhich packageName.sty If kpsewhich doesn't return a path to a .sty file, then the package you attempted to find is not installed on your LaTeX search path. Since you are using MacTex 2009 which is based on TeXlive 2009, you can use the TeXlive package manager to install missing packages from the command line: tlmgr install packageName Since you are using a Mac, there is a GUI option to perform all this searching and installing without having to use the command line (although it is always a good idea to know how to do something from the command line). Simply download Tex Live Utility from the following website: http://code.google.com/p/mactlmgr/ It provides a nice GUI from which you can install and update TeX based packages and utilities. Hope this helps! -Charlie ----- Charlie Sharpsteen Undergraduate-- Environmental Resources Engineering Humboldt State University -- View this message in context: http://n4.nabble.com/ctable-error-with-Hmisc-and-Sweave-on-a-Mac-tp1678494p1678588.html Sent from the R help mailing list archive at Nabble.com.
Apparently Analagous Threads
- summary in Hmisc and Latex
- While using R CMD check: LaTex error: File `inconsolata.sty' not found
- [Hmisc] latex() with ctable=T inserting unwanted empty line in .tex file when used on summary.formula(method="reverse") object
- Latex and r
- latex{Hmisc} cannot find xdvi on MAC OS X