| Line 15... |
Line 15... |
| 15 |
intended for internal use, their interfaces are subject to change.
|
15 |
intended for internal use, their interfaces are subject to change.
|
| 16 |
}
|
16 |
}
|
| 17 |
\usage{
|
17 |
\usage{
|
| 18 |
Rd2HTML(Rd, out = "", package = "", defines = .Platform$OS.type,
|
18 |
Rd2HTML(Rd, out = "", package = "", defines = .Platform$OS.type,
|
| 19 |
Links = NULL, Links2 = NULL,
|
19 |
Links = NULL, Links2 = NULL,
|
| 20 |
stages = "render", outputEncoding = "UTF-8",
|
20 |
stages = "render", outputEncoding = "UTF-8",
|
| 21 |
dynamic = FALSE, no_links = FALSE, fragment = FALSE,
|
21 |
dynamic = FALSE, no_links = FALSE, fragment = FALSE,
|
| 22 |
stylesheet = "R.css", ...)
|
22 |
stylesheet = "R.css", ...)
|
| 23 |
|
23 |
|
| 24 |
Rd2txt(Rd, out = "", package = "", defines = .Platform$OS.type,
|
24 |
Rd2txt(Rd, out = "", package = "", defines = .Platform$OS.type,
|
| 25 |
stages = "render", outputEncoding = "",
|
25 |
stages = "render", outputEncoding = "",
|
| Line 65... |
Line 65... |
| 65 |
\code{\link{example}} and \R utilities.
|
65 |
\code{\link{example}} and \R utilities.
|
| 66 |
|
66 |
|
| 67 |
Each of the functions accepts a filename for an Rd file, and
|
67 |
Each of the functions accepts a filename for an Rd file, and
|
| 68 |
will use \code{\link{parse_Rd}} to parse it before applying the
|
68 |
will use \code{\link{parse_Rd}} to parse it before applying the
|
| 69 |
conversions or checks.
|
69 |
conversions or checks.
|
| 70 |
|
70 |
|
| 71 |
The difference between arguments \code{Link} and \code{Link2} is that
|
71 |
The difference between arguments \code{Link} and \code{Link2} is that
|
| 72 |
links are looked in them in turn, so lazy-evaluation can be used to
|
72 |
links are looked in them in turn, so lazy-evaluation can be used to
|
| 73 |
only do a second-level search for links if required.
|
73 |
only do a second-level search for links if required.
|
| 74 |
|
74 |
|
| 75 |
Note that the default for \code{Rd2latex} is to output ASCII,
|
75 |
Note that the default for \code{Rd2latex} is to output ASCII,
|
| 76 |
including using the second option of \verb{\enc} markup. This was
|
76 |
including using the second option of \verb{\enc} markup. This was
|
| 77 |
chosen because use of UTF-8 in LaTeX requires version
|
77 |
chosen because use of UTF-8 in LaTeX requires version
|
| 78 |
\sQuote{2005/12/01} or later, and even with that version the coverage
|
78 |
\sQuote{2005/12/01} or later, and even with that version the coverage
|
| 79 |
of UTF-8 glyphs is not extensive (and not even as complete as
|
79 |
of UTF-8 glyphs is not extensive (and not even as complete as
|
| 80 |
Latin-1).
|
80 |
Latin-1).
|
| 81 |
|
81 |
|
| 82 |
\code{Rd2txt} will format text paragraphs to a width determined by
|
82 |
\code{Rd2txt} will format text paragraphs to a width determined by
|
| 83 |
\code{width}, with appropriate margins. The default is to be close to
|
83 |
\code{width}, with appropriate margins. The default is to be close to
|
| 84 |
the rendering in versions of \R < 2.10.0.
|
84 |
the rendering in versions of \R < 2.10.0.
|
| 85 |
|
85 |
|
| 86 |
\code{Rd2txt} will use directional quotes (see \code{\link{sQuote}})
|
86 |
\code{Rd2txt} will use directional quotes (see \code{\link{sQuote}})
|
| 87 |
if option \code{"useFancyQuotes"} is true (the default) and
|
87 |
if option \code{"useFancyQuotes"} is true (the default) and
|
| 88 |
#ifdef unix
|
88 |
#ifdef unix
|
| 89 |
the current encoding is UTF-8.
|
89 |
the current encoding is UTF-8.
|
| 90 |
#endif
|
90 |
#endif
|
| Line 96... |
Line 96... |
| 96 |
|
96 |
|
| 97 |
Various aspects of formatting by \code{Rd2txt} are controlled by the
|
97 |
Various aspects of formatting by \code{Rd2txt} are controlled by the
|
| 98 |
\code{options} argument, documented with the \code{\link{Rd2txt_options}}
|
98 |
\code{options} argument, documented with the \code{\link{Rd2txt_options}}
|
| 99 |
function. Changes made using \code{options} are temporary, those
|
99 |
function. Changes made using \code{options} are temporary, those
|
| 100 |
made with \code{\link{Rd2txt_options}} are persistent.
|
100 |
made with \code{\link{Rd2txt_options}} are persistent.
|
| 101 |
|
101 |
|
| 102 |
When \code{fragment = TRUE}, the \code{Rd} file will be rendered
|
102 |
When \code{fragment = TRUE}, the \code{Rd} file will be rendered
|
| 103 |
with no processing of \verb{\Sexpr} elements or conditional defines
|
103 |
with no processing of \verb{\Sexpr} elements or conditional defines
|
| 104 |
using \verb{#ifdef} or \verb{#ifndef}. Normally a fragment represents
|
104 |
using \verb{#ifdef} or \verb{#ifndef}. Normally a fragment represents
|
| 105 |
text within a section, but if the first element of the fragment
|
105 |
text within a section, but if the first element of the fragment
|
| 106 |
is a section macro, the whole fragment will be rendered as
|
106 |
is a section macro, the whole fragment will be rendered as
|
| 107 |
a series of sections, without the usual sorting.
|
107 |
a series of sections, without the usual sorting.
|
| 108 |
}
|
108 |
}
|
| 109 |
\section{Encodings}{
|
109 |
\section{Encodings}{
|
| 110 |
Rd files are normally intended to be rendered on a wide variety of
|
110 |
Rd files are normally intended to be rendered on a wide variety of
|
| 111 |
systems, so care must be taken in the encoding of non-ASCII
|
111 |
systems, so care must be taken in the encoding of non-ASCII
|
| Line 117... |
Line 117... |
| 117 |
\code{outputEncoding = ""} will choose the native encoding for the
|
117 |
\code{outputEncoding = ""} will choose the native encoding for the
|
| 118 |
current system.
|
118 |
current system.
|
| 119 |
|
119 |
|
| 120 |
If the text cannot be converted to the \code{outputEncoding}, byte
|
120 |
If the text cannot be converted to the \code{outputEncoding}, byte
|
| 121 |
substitution will be used (see \code{\link{iconv}}): \code{Rd2latex}
|
121 |
substitution will be used (see \code{\link{iconv}}): \code{Rd2latex}
|
| 122 |
and \code{Rd2ex} give a warning.
|
122 |
and \code{Rd2ex} give a warning.
|
| 123 |
}
|
123 |
}
|
| 124 |
|
124 |
|
| 125 |
\note{
|
125 |
\note{
|
| 126 |
The \verb{\Sexpr} macro is a new addition to Rd files. It includes
|
126 |
The \verb{\Sexpr} macro is a new addition to Rd files. It includes
|
| 127 |
\R code that will be executed at one of three times: \emph{build} time
|
127 |
\R code that will be executed at one of three times: \emph{build} time
|
| 128 |
(when a package's source code is built into a tarball),
|
128 |
(when a package's source code is built into a tarball),
|
| 129 |
\emph{install} time (when the package is installed or
|
129 |
\emph{install} time (when the package is installed or
|
| 130 |
built into a binary package), and \emph{render} time (when the man
|
130 |
built into a binary package), and \emph{render} time (when the man
|
| 131 |
page is converted to a readable format).
|
131 |
page is converted to a readable format).
|
| 132 |
|
132 |
|
| 133 |
For example, this man page was:
|
133 |
For example, this man page was:
|