Skip to content

Commit

Permalink
Tweaks.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@85872 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Feb 7, 2024
1 parent 3b87d0a commit 5d95d5c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 22 deletions.
4 changes: 3 additions & 1 deletion src/library/tools/man/buildVignette.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Copyright 1995-2019 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{buildVignette}
\alias{buildVignette}
\title{Build One Vignette}
Expand Down Expand Up @@ -65,7 +67,7 @@ buildVignette(file, dir = ".", weave = TRUE, latex = TRUE, tangle = TRUE,
A character vector naming the files that have been produced.
}
\author{
Henrik Bengtsson and Duncan Murdoch
\I{Henrik Bengtsson} and Duncan Murdoch
}
\seealso{
\code{\link{buildVignettes}} for building all vignettes in a package.
Expand Down
22 changes: 12 additions & 10 deletions src/library/tools/man/compactPDF.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Copyright 2011-2023 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{compactPDF}
\alias{compactPDF}
\alias{format.compactPDF}
Expand All @@ -29,17 +31,17 @@ compactPDF(paths,
that directory will be used.}
\item{qpdf}{Character string giving the path to the \command{qpdf}
command. If empty, \command{qpdf} will not be used.}
\item{gs_cmd}{Character string giving the path to the GhostScript
\item{gs_cmd}{Character string giving the path to the \I{GhostScript}
executable, if that is to be used. On Windows this is the path to
\file{gswin32c.exe} or \file{gswin64c.exe}. If \code{""} (the
default), the function will try to find a platform-specific path to
GhostScript where required.}
\I{GhostScript} where required.}
\item{gs_quality}{A character string indicating the quality required:
the options are \code{"none"} (so GhostScript is not used),
the options are \code{"none"} (so \I{GhostScript} is not used),
\code{"printer"} (300dpi), \code{"ebook"} (150dpi) and
\code{"screen"} (72dpi). Can be abbreviated.}
\item{gs_extras}{An optional character vector of further options to be
passed to GhostScript.}
passed to \I{GhostScript}.}
\item{verbose}{\code{\link{logical}} or non-negative integer indicating if
and how much of the compression utilities' output should be shown.}
%--> format(*):
Expand All @@ -53,17 +55,17 @@ compactPDF(paths,
This by default makes use of \command{qpdf}, available from
\url{https://qpdf.sourceforge.io/} (including as a Windows binary) and
included with the CRAN macOS distribution of \R. If \code{gs_cmd}
is non-empty and \code{gs_quality != "none"}, GhostScript will used
is non-empty and \code{gs_quality != "none"}, \I{GhostScript} will used
first, then \command{qpdf} if it is available. If
\code{gs_quality != "none"} and \code{gs_cmd} is \code{""}, an attempt
will be made to find a GhostScript executable.
will be made to find a \I{GhostScript} executable.
\command{qpdf} and/or \command{gs_cmd} are run on all PDF files found,
and those which are reduced in size by at least 10\% and 10Kb are
replaced.
The strategy of our use of \command{qpdf} is to (losslessly) compress
both PDF streams and objects. GhostScript compresses streams and more
both PDF streams and objects. \I{GhostScript} compresses streams and more
(including downsampling and compressing embedded images) and
consequently is much slower and may lose quality (but can also produce
much smaller PDF files). However, quality \code{"ebook"} is perfectly
Expand All @@ -76,11 +78,11 @@ compactPDF(paths,
Stream compression is what most often has large gains. Most PDF
documents are generated with object compression, but this does not
seem to be the default for MiKTeX's \command{pdflatex}. For some PDF
files (and especially package vignettes), using GhostScript can
files (and especially package vignettes), using \I{GhostScript} can
dramatically reduce the space taken by embedded images (often
screenshots).

Where both GhostScript and \command{qpdf} are selected (when
Where both \I{GhostScript} and \command{qpdf} are selected (when
\code{gs_quality != "none"} and both executables are found), they are
run in that order and the size reductions apply to the total
compression achieved.
Expand All @@ -99,7 +101,7 @@ compactPDF(paths,
\note{
The external tools used may change in future releases.

Frequently, updates to GhostScript have produced better compression (up
Frequently, updates to \I{GhostScript} have produced better compression (up
to several times better), so if possible use the latest version available.
}

Expand Down
14 changes: 8 additions & 6 deletions src/library/tools/man/find_gs_cmd.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@
% Copyright 2008-2014 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{find_gs_cmd}
\alias{find_gs_cmd}

\alias{R_GSCMD}
\alias{GSC}

\title{
Find a GhostScript Executable
Find a \I{GhostScript} Executable
}
\description{
Find a GhostScript executable in a cross-platform way.
Find a \I{GhostScript} executable in a cross-platform way.
}
\usage{
find_gs_cmd(gs_cmd = "")
}
\arguments{
\item{gs_cmd}{The name, full or partial path of a GhostScript executable.}
\item{gs_cmd}{The name, full or partial path of a \I{GhostScript} executable.}
}
\details{
The details differ by platform.

On a Unix-alike, the GhostScript executable is usually called
On a Unix-alike, the \I{GhostScript} executable is usually called
\command{gs}. The name (and possibly path) of the command is taken
first from argument \code{gs_cmd} then from the environment variable
\env{R_GSCMD} and default \code{gs}. This is then looked for on the
Expand All @@ -37,11 +39,11 @@ find_gs_cmd(gs_cmd = "")
cases the command is looked for on the system \env{PATH}.

Note that on Windows (and some other OSes) there are separate
GhostScript executables to display Postscript/PDF files and to
\I{GhostScript} executables to display Postscript/PDF files and to
manipulate them: this function looks for the latter.
}
\value{
A character string giving the full path to a GhostScript executable if
A character string giving the full path to a \I{GhostScript} executable if
one was found, otherwise an empty string.
}
\examples{\dontrun{
Expand Down
4 changes: 3 additions & 1 deletion src/library/tools/man/md5sum.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Copyright 1995-2014 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{md5sum}
\alias{md5sum}
\title{Compute MD5 Checksums}
Expand Down Expand Up @@ -36,7 +38,7 @@ md5sum(files)
32-character string of hexadecimal digits.
}
\source{
The underlying C code was written by Ulrich Drepper and extracted from
The underlying C code was written by \I{Ulrich Drepper} and extracted from
a 2001 release of \code{glibc}.
}
\seealso{
Expand Down
4 changes: 3 additions & 1 deletion src/library/tools/man/texi2dvi.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Copyright 1995-2016 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{texi2dvi}
\alias{texi2dvi}
\alias{texi2pdf}
Expand Down Expand Up @@ -123,6 +125,6 @@ texi2pdf(file, clean = FALSE, quiet = TRUE,
especially if \code{clean = FALSE}).
}
\author{
Originally Achim Zeileis but largely rewritten by R-core.
Originally \I{Achim Zeileis} but largely rewritten by R-core.
}
\keyword{utilities}
4 changes: 3 additions & 1 deletion src/library/tools/man/tools-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Copyright 1995-2007 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{tools-package}
\alias{tools-package}
\alias{tools}
Expand All @@ -19,7 +21,7 @@

}
\author{
Kurt Hornik and Friedrich Leisch
\I{Kurt Hornik} and \I{Friedrich Leisch}

Maintainer: R Core Team \email{R-core@r-project.org}
}
Expand Down
4 changes: 3 additions & 1 deletion src/library/tools/man/vignetteEngine.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Copyright 2013-2019 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{vignetteEngine}
\alias{vignetteEngine}
\title{Set or Get a Vignette Processing Engine}
Expand Down Expand Up @@ -72,7 +74,7 @@ is used.
\item{tangle}{The tangle function}
}
\author{
Duncan Murdoch and Henrik Bengtsson.
Duncan Murdoch and \I{Henrik Bengtsson}.
}
\seealso{
\code{\link{Sweave}} and the \sQuote{Writing R Extensions} manual.
Expand Down
4 changes: 3 additions & 1 deletion src/library/tools/man/writePACKAGES.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Copyright 1995-2017 R Core Team
% Distributed under GPL 2 or later

\newcommand{\I}{#1}

\name{write_PACKAGES}
\alias{write_PACKAGES}
\title{Generate PACKAGES Files}
Expand Down Expand Up @@ -111,7 +113,7 @@ write_PACKAGES(dir = ".", fields = NULL,
work on all OSes.
}
\author{
Uwe Ligges and R-core.
\I{Uwe Ligges} and R-core.
}
\seealso{
See \code{\link{read.dcf}} and \code{\link{write.dcf}} for reading
Expand Down

0 comments on commit 5d95d5c

Please sign in to comment.