I notice the CRAN pdf didn't justify correctly long texts inside \code{} even having "," or spaces irrespective of the status of the argument (oneliner or multiliner) in source (.R / .Rd) https://imgur.com/RvjzMDh
I noticed also that it is not a problem in a pkgdown doc: https://imgur.com/LsmuPE1 I ended up splitting the \code{} into several \codes{} with file.R with \code{...} in one line as input. example from: \code{unique(c(dfMarkPos$markName,dfCenMarks$markName) ) } to: \code{unique(c(dfMarkPos$markName,} \code{dfCenMarks$markName) ) } https://imgur.com/Pwhfu0j I used roxygen formatted .R, but could work with .Rd after .R script (below) I produced .Rd with devtools:document(), then, pdf: devtools::build_manual(path=getwd()) gblines<-readLines(file) for (i in 1:length(gblines) ) { if(grepl("^#\'",gblines[i]) & grepl("\\code",gblines[i] ) ) { co <- regmatches(gblines[i], gregexpr('code\\{.*?\\}', gblines[i], perl=T) ) if(length(co[[1]])>0){ co2 <- strsplit(co[[1]],",") withCode <- unlist(lapply(co2, function(x) unlist(regmatches(x, gregexpr('code\\{.*', x, perl=T) ) ) ) ) notWithCode <- (lapply(co2, function(x) unlist(regmatches(x, gregexpr('^(?:(?!code\\{.*).)*$', x, perl=T) ) ) ) ) names(notWithCode)<-1:length(notWithCode) names(withCode)<-1:length(withCode) l_tmp <- c(withCode, notWithCode) keys = unique(names(l_tmp)) l = sapply(keys, function(name) {unlist(l_tmp[grep(name, names(l_tmp))])}, simplify = F) repwith<-list(unlist(lapply(l, function(x) paste(x, collapse=",} \\code{")) ) ) regmatches(gblines[i], gregexpr('code\\{.*?\\}', gblines[i], perl=T) ) <-repwith } } } writeLines(gblines, file) best, -- Fernando Roa [[alternative HTML version deleted]] ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel