From Friedrich.Leisch at tuwien.ac.at  Fri Oct 29 13:16:05 2004
From: Friedrich.Leisch at tuwien.ac.at (Friedrich.Leisch@tuwien.ac.at)
Date: Fri Oct 29 13:17:02 2004
Subject: [Rd] R-exts.texi: suggestion for small change to Vignette section
	(PR#7323)
In-Reply-To: <20041029104746.3E41711345@slim.kubism.ku.dk>
References: <20041029104746.3E41711345@slim.kubism.ku.dk>
Message-ID: <16770.9845.663096.869757@celebrian.ci.tuwien.ac.at>

>>>>> On Fri, 29 Oct 2004 12:47:46 +0200 (CEST),
>>>>> S J Eglen (SJE) wrote:

  > 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!


That's a bug in getVigInfo(), not a bug in the R documentation (I also
use %% for the same reason).

Jeff: the regexp should certainly be ^%+[[:space:]]*\\\\Vignette", but
there is now also code in package tools which can be used to extract
the info directly.

Best,
Fritz


[Rd] R-exts.texi: suggestion for small change to Vignette section (PR#7323)
Friedrich.Leisch@tuwien.ac.at