Re: [Rd] R-exts.texi: suggestion for small change to Vignette section (PR#7323)

From: Kurt Hornik <>
Date: Fri 29 Oct 2004 - 21:04:43 EST

>>>>> S J Eglen writes:

> I recently wrote a vignette, with the following at the top of the .Rnw
> file:

> %%\VignetteIndexEntry{How to use look up tables for h() functions}
> %%\VignetteDepends{sjedmin, spatstat}

> Using vExplorer() on this function, I got an error from this part of
> getVigInfo():

> lines <- grep("^%[[:space:]]*\\\\Vignette", file)
> if (length(lines) == 0)
> stop("File ", vig, " does not appear to be a vignette file, ",
> "no vignette metadata available.")

> The error occurs here because the grep expects only one % at the start
> of the line, whereas I had %%. (I often use two at the start of a
> line as I'm used to the ESS/Emacs coding habits of putting ## at the
> start of a line.) Changing %% to % solved the problem okay.

> So, my minor suggestion to R-exts.texi, at line 1011:

> @code{\VignetteIndexEntry} statement is best placed in La@TeX{} comment,

> is that maybe it should say either:

> "in a La@TeX{} comment"

> or

> "in a La@TeX{} comment with a single %"

> although admittedly that sounds a bit clunky!

Hmm, why not change the Sweave code to support multiple comment chars?

The code for index computations on vignettes is based on

vignetteMetaRE <- function(tag)

    paste("[[:space:]]*%+[[:space:]]*\\\\Vignette", tag,

          "\{([^}]*)\}", sep = "")

-k mailing list Received on Fri Oct 29 21:17:52 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:26 EST