Duncan Murdoch wrote: >>> >> Maybe a clue: we can use >> cat(readLines(as.character(?plot)),sep="\n") >> >> to display the help (here, of plot) directly to the screen. So we could >> use something like: >> >> <<echo=TRUE,print=FALSE,eval=FALSE>>= >> ?plot >> @ >> >> >> <<echo=FALSE,print=TRUE,eval=TRUE>>= >> cat(readLines(as.character(?plot)),sep="\n") >> @ >> >> But this doesn't work (latex compilation error) as weird characters >> appear in the produced tex, at some places (tabulations?), like: >> >> _T_h_e _D_e_f_a_ >> >> (not sure what it will look like in this email, but emacs reads things >> like _^HT_^HH_^He...). >> >> Maybe an encoding problem? I tried specifying different encoding to >> readLines, with no luck (latin1, UTF-8). Otherwise, the help appears >> in the .tex. > > Those are backspaces: it's trying to underline the title. You'd get > a better display if you read the latex version instead. I think you > need to construct the path to it yourself (using system.file() etc.) > > Duncan Murdoch > > > Thanks for the hint ! So, the code below roughly works:
####### \documentclass{article} \usepackage{verbatim} \begin{document} <<echo=TRUE,print=FALSE,eval=FALSE>>= ?plot @ <<echo=FALSE,print=FALSE,results=tex>>= path <- sub("help","latex",as.character(?plot)) path <- paste(path,'tex',sep=".") cat(readLines(path),sep="\n") @ \end{document} ####### The document compiles with pdflatex but still complains about a bunch of unknown latex instructions (like \HeaderA, used at the begining of the included (plot.tex) tex file. The resulting pdf indeed looks a bit nasty. What command shall we include in the header to have it work? Best, Thibaut. -- ###################################### Thibaut JOMBART CNRS UMR 5558 - Laboratoire de Biométrie et Biologie Evolutive Universite Lyon 1 43 bd du 11 novembre 1918 69622 Villeurbanne Cedex Tél. : 04.72.43.29.35 Fax : 04.72.43.13.88 [EMAIL PROTECTED] http://lbbe.univ-lyon1.fr/-Jombart-Thibaut-.html?lang=en http://adegenet.r-forge.r-project.org/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.