Skip to content

[Bioc-devel] S4 Methods Documentation Convention Triggers Warnings

3 messages · Deepayan Sarkar, Hervé Pagès, Henrik Bengtsson

#
On Wed, Nov 30, 2022 at 9:51 PM Martin Morgan <mtmorgan.bioc at gmail.com>
wrote:
This should ideally use \preformatted{}, but R-exts says that "Due to
limitations in LaTeX as of this writing, this macro may not be nested
within other markup macros other than \dQuote and \sQuote, as errors or bad
formatting may result."

Still, in this particular case, and possibly others like it, free-format
text (instead of itemizing) might work better:

\section{Constructor}{

    \preformatted{SnowParam(workers = snowWorkers(), type=c("SOCK", "MPI"),
          tasks = 0L, stop.on.error = FALSE,
          progressbar = FALSE, RNGseed = NULL,
          timeout = Inf, exportglobals = TRUE,
          exportvariables = TRUE,
          log = FALSE, threshold = "INFO", logdir = NA_character_,
          resultdir = NA_character_, jobname = "BPJOB",
          manager.hostname = NA_character_,
          manager.port = NA_integer_,
          ...)}
    Returns an object representing a SNOW cluster. The cluster is not
    created until \code{bpstart} is called. Named arguments in \code{...}
    are passed to \code{makeCluster}.

}

Even if we retain the status quo, the \item{}{\code{...}{}} version of this
(as in the release branch) is by no means nice-looking.

Best,
-Deepayan

The shorter items in the ?Accessors: Logging and results? section look

  
  
1 day later
#
Itemizing brings semantics and structure. Plus, the \preformatted 
solution doesn't look good either IMO. FWIW I mostly care about what I 
see when I open the man page in a terminal with ?<foo>. I don't care so 
much about the PDF manual, never look at it.

So I'm going to switch from

   \item{}{\code{show(x)}:
     ...
   }

to

   \item{\code{show(x)}:}{
     ...
   }

as suggested by Henrik.

I actually tried the latter many years ago and compared with the former 
and for some reason decided to go for the former. But now I like the 
rendering of the latter better. Don't know if it has changed or if my 
taste has changed ;-)

Anyways, that's hundreds of \items that I need to fix in a dozen of 
packages. Not fun! Also the thing with the exact location of the colon 
is very error prone. As Michael said, it would be nice to be able to 
achieve this with a simpler/more natural syntax.

H.
On 30/11/2022 10:47, Deepayan Sarkar wrote:

  
    
#
A great opportunity to freshen up your 'sed' skills. (I think it's
possible to use 'sed' here, but 100% sure)

/Henrik
On Thu, Dec 1, 2022 at 12:27 PM Herv? Pag?s <hpages.on.github at gmail.com> wrote: