[R-pkg-devel] Using the amsmath package in a vignette.

Ott Toomet otoomet @end|ng |rom gm@||@com
Thu Mar 4 07:25:59 CET 2021


As I read the docs (a few months ago though), you are supposed to include
the pdf and encouraged to include sources, but the process to get pdf from
source may depend on your private libraries/data/software, and is not
replicated on CRAN checks.  This seemed to work for me as my vignette
includes a less common .bst.  I sort of remember receiving errors about
missing .bst from rhub, but it definitely ran on CRAN with no red flags
raised.

On Wed, Mar 3, 2021 at 9:37 PM Henrik Bengtsson <henrik.bengtsson using gmail.com>
wrote:

> The R.rsp has a vignette engine for plain LaTeX sources. See
>
> https://cran.r-project.org/web/packages/R.rsp/vignettes/R_packages-LaTeX_vignettes.pdf
> for how. It's straightforward. Maybe that helps.
>
> Henrik
>
> On Wed, Mar 3, 2021, 18:51 Rolf Turner <r.turner using auckland.ac.nz> wrote:
>
> >
> > I am trying to create a vignette in a package (basically just using
> > LaTeX code; no R calculations or data are involved).
> >
> > The LaTeX code involves the use of the align* environment from
> > the amsmath package.  When I try to run Sweave() on the *.Rnw file
> > I get a corresponding *.tex file, but then when I run pdflatex on
> > that file I get an error:
> >
> > > ! LaTeX Error: Command \iint already defined.
> > >                Or name \end... illegal, see p.192 of the manual.
> > >
> > > See the LaTeX manual or LaTeX Companion for explanation.
> > > Type  H <return>  for immediate help.
> > >  ...
> > >
> > > l.649 ...d{\iint}{\DOTSI\protect\MultiIntegral{2}}
> >
> > which is completely opaque to me.
> >
> > If I don't have \usepackage{amsmath} in the *.Rnw file, I get
> > (unsurprisingly) an error message to the effect that the align*
> > environment is undefined.
> >
> > Is there any way to make use of amsmath facilities in a vignette?
> >
> > Alternatively, is there any way to simply use the pdf output obtained
> > by processing an ordinary LaTeX file as a vignette?  I have done a
> > bit of web searching on this, but all of the hits that I get seem to be
> > substantially out of date.  They refer to putting vignettes in
> > /inst/doc and I'm pretty sure that this is no longer how it's done.
> > (But I find all of the vignette business rather bewildering and
> > confusing.)
> >
> > Grateful for any advice.
> >
> > cheers,
> >
> > Rolf Turner
> >
> > --
> > Honorary Research Fellow
> > Department of Statistics
> > University of Auckland
> > Phone: +64-9-373-7599 ext. 88276
> >
> > ______________________________________________
> > R-package-devel using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list