[R-pkg-devel] LaTeX packages available for documentation?
I don't know if the LaTeX packages are fully documented, but there is some info in the R Admin manual in section 2.4 "Installation". That might just apply to R, not contributed packages. One way to figure it out is to ask R to convert an Rd file to pdf, and save the .tex file. When I do that, I see that it uses or requires the following packages: Rd makeidx inputenc graphicx (maybe? commented out in the example I ran) and Rd.sty requires these (some conditionally), as seen in R sources share/texmf/tex/latex/Rd.sty: ifthen longtable hyperref bm alltt verbatim url textcomp iftex fontenc times lmodern beramono zi4 inconsolata Since these are gleaned from the source, they are likely subject to change.
On 03/09/2022 4:09 p.m., Ben Bolker wrote:
I'm trying to figure out if the list of LaTeX packages that can be
expected to be available *when building PDF versions of man pages* is
documented/available somewhere.
One of my co-authors is a bit enthusiastic about complex math
expressions in the man pages, e.g. using \dfrac (from the amsmath
package) and \mathscr (from the mathrsfs package). These are OK in HTML
version of the docs (now that LaTeX is allowed), but throw an error when
building the PDF manuals.
I think this will probably turn out to be a case of "'doctor, it
hurts when I do this.' 'Well, then, don't do that.'" (i.e., remove fancy
LaTeX markup from man pages), but I'm curious.
cheers
Ben Bolker
PS
I've looked at these sections of the documentation:
https://cran.r-project.org/doc/manuals/R-exts.html#Writing-portable-packages
https://cran.r-project.org/doc/manuals/R-exts.html#Checking-packages
https://cran.r-project.org/doc/manuals/R-admin.html#Making-the-manuals
and have searched for packages in the R sources:
$ find . -type f -exec grep "^.usepackage" {} \; | sort | uniq
\usepackage{a4wide}
\usepackage{amsmath}
\usepackage[authoryear,round]{natbib}
\usepackage{color}
\usepackage{fullpage}
\usepackage{fullpage}% save trees ;-)
\usepackage{graphicx, Rd}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{myVignette}
\usepackage[pdftex]{graphicx}
\usepackage{Rd}
\usepackage{Rd, parskip, amsmath, enumerate}
\usepackage[round]{natbib}
\usepackage{Sweave}
weirdly, amsmath is included here, but it's only used in vignettes --
seems puzzling but plausible that package availability would be
different for building vignettes vs. man pages ... ??
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel