Skip to content

Commit ed85ecc

Browse files
author
smeyer
committed
process Rd \bib notes as raw strings
git-svn-id: https://svn.r-project.org/R/trunk@89404 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 6998d85 commit ed85ecc

File tree

20 files changed

+37
-39
lines changed

20 files changed

+37
-39
lines changed

doc/manual/R-exts.texi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8708,9 +8708,7 @@ argument, where a @var{citespec} can be a @var{keyspec} or of the form
87088708
@code{@var{before}|@var{keyspec}|@var{after}} with both @samp{|}
87098709
mandatory and @var{before} and @var{after} possibly empty text to be
87108710
inserted before and after the citation if not empty. If these texts
8711-
contain commas, these can be backslash-escaped: due to the way Rd macros
8712-
are processed, this needs 6 (!) backslashes, see the examples below.
8713-
(This is clearly inconvenient, but most likely too late to change.)
8711+
contain commas, these can be backslash-escaped: see the examples below.
87148712

87158713
A @var{keyspec} is either a simple @var{key} or of the form
87168714
@code{@var{pkg}::@var{key}}. In the former case, @var{key} is taken as
@@ -8747,7 +8745,7 @@ For example,
87478745
gives a textual citation of the ``@emph{Blue Book}''
87488746
(`@I{Becker, Chambers, and Wilks (1988)}' when first encountered),
87498747
@example
8750-
\bibcitep@{e.g.\\\\\\,|R:Chambers+Hastie:1992|page 123@}
8748+
\bibcitep@{e.g.\,|R:Chambers+Hastie:1992|page 123@}
87518749
@end example
87528750
@noindent
87538751
gives a parenthetical citation of a page in the ``@emph{White Book}''

share/Rd/macros/system.Rd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
\newcommand{\manual}{\Sexpr[results=rd]{tools:::Rd_expr_manual("#1", "#2")}}
6161

6262
% To cite from installed bibentries (R_bibentries() or package-specific REFERENCES)
63-
\newcommand{\bibcitep}{\Sexpr[results=rd,stage=build]{tools:::Rd_expr_bibcite("#1", FALSE)}}
64-
\newcommand{\bibcitet}{\Sexpr[results=rd,stage=build]{tools:::Rd_expr_bibcite("#1", TRUE)}}
63+
\newcommand{\bibcitep}{\Sexpr[results=rd,stage=build]{tools:::Rd_expr_bibcite(r"(#1)", FALSE)}}
64+
\newcommand{\bibcitet}{\Sexpr[results=rd,stage=build]{tools:::Rd_expr_bibcite(r"(#1)", TRUE)}}
6565
\newcommand{\bibshow}{\Sexpr[results=rd,stage=build]{tools:::Rd_expr_bibshow("#1")}}
66-
\newcommand{\bibinfo}{\Sexpr[stage=build]{tools:::Rd_expr_bibinfo("#1", "#2", "#3")}}
66+
\newcommand{\bibinfo}{\Sexpr[stage=build]{tools:::Rd_expr_bibinfo("#1", "#2", r"(#3)")}}

src/library/base/man/Arithmetic.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ x \%/\% y
174174
}
175175
\references{
176176
\bibinfo{R:Goldberg:1991}{footer}{Also available at
177-
\\\\\\url{https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html}.}
177+
\url{https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html}.}
178178

179179
\bibshow{R:Becker+Chambers+Wilks:1988,
180180
R:Goldberg:1991}

src/library/base/man/Hyperbolic.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ atanh(x)
3535

3636
Branch cuts are consistent with the inverse trigonometric functions
3737
\code{asin} \emph{et seq}, and agree with those defined in
38-
\bibcitet{|R:Abramowitz+Stegun:1972|figure 4.7\\\\\\, page 86}.
38+
\bibcitet{|R:Abramowitz+Stegun:1972|figure 4.7\, page 86}.
3939
The behaviour actually on the cuts
4040
follows the C99 standard which requires continuity coming round the
4141
endpoint in a counter-clockwise direction.

src/library/base/man/Random.Rd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,19 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
256256
}
257257
\references{
258258
\bibinfo{R:Becker+Chambers+Wilks:1988}{footer}{
259-
(\\\\\\code{set.seed}, storing in \\\\\\code{.Random.seed}.)}
259+
(\code{set.seed}, storing in \code{.Random.seed}.)}
260260
\bibinfo{R:Knuth:1997:v2}{footer}{
261-
Source code at \\\\\\url{https://www-cs-faculty.stanford.edu/~knuth/taocp.html}.}
261+
Source code at \url{https://www-cs-faculty.stanford.edu/~knuth/taocp.html}.}
262262
\bibinfo{R:L_Ecuyer+Simard:2007}{footer}{
263-
The \\\\\\I{TestU01} C library is available from
264-
\\\\\\url{https://simul.iro.umontreal.ca/testu01/tu01.html} or also
265-
\\\\\\url{https://github.com/umontreal-simul/TestU01-2009}.
263+
The \I{TestU01} C library is available from
264+
\url{https://simul.iro.umontreal.ca/testu01/tu01.html} or also
265+
\url{https://github.com/umontreal-simul/TestU01-2009}.
266266
}
267267
\bibinfo{R:Matsumoto+Nishimura:1998}{footer}{
268-
Source code formerly at \\\\\\code{http://www.math.keio.ac.jp/~matumoto/emt.html}.
269-
Now see \\\\\\url{https://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/c-lang.html}.}
268+
Source code formerly at \code{http://www.math.keio.ac.jp/~matumoto/emt.html}.
269+
Now see \url{https://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/c-lang.html}.}
270270
\bibinfo{R:Wichmann+Hill:1982}{note}{Remarks:
271-
\\\\\\bold{34}, 198 and \\\\\\bold{35}, 89.}
271+
\bold{34}, 198 and \bold{35}, 89.}
272272
273273
\bibshow{*,
274274
R:Ahrens+Dieter:1973,

src/library/base/man/Special.Rd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@ lfactorial(x)
5252
\deqn{B(a,b) = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}.}{B(a,b) = \Gamma(a)\Gamma(b)/\Gamma(a+b).}
5353
The formal definition is
5454
\deqn{B(a, b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}{integral_0^1 t^(a-1) (1-t)^(b-1) dt}
55-
\bibcitep{|R:Abramowitz+Stegun:1972|section 6.2.1\\\\\\, page 258}.
55+
\bibcitep{|R:Abramowitz+Stegun:1972|section 6.2.1\, page 258}.
5656
Note that it is only
5757
defined in \R for non-negative \code{a} and \code{b}, and is infinite
5858
if either is zero.
5959

6060
The functions \code{gamma} and \code{lgamma} return the gamma function
6161
\eqn{\Gamma(x)} and the natural logarithm of \emph{the absolute value of} the
6262
gamma function. The gamma function is defined by
63-
\bibcitep{|R:Abramowitz+Stegun:1972|section 6.1.1\\\\\\, page 255}
63+
\bibcitep{|R:Abramowitz+Stegun:1972|section 6.1.1\, page 255}
6464
\deqn{\Gamma(x) = \int_0^\infty t^{x-1} e^{-t} dt}{\Gamma(x) = integral_0^Inf t^(x-1) exp(-t) dt}
6565
for all \eqn{x > 0}, from which the recursions \eqn{\Gamma(x+1) =
6666
x\Gamma(x)} and then \eqn{\Gamma(x+n) = (x+n-1)(x+n-2)\cdots x \Gamma(x)}
6767
for all non-negative integers \eqn{n}. Solving for \eqn{\Gamma(x)} and
6868
analytic continuation leads to the expression for non-integer negative real numbers,
6969
\deqn{\Gamma(x) = \frac{\Gamma(x + n)}{(x + n -1) \cdots (x + 1)x}, \ n \in \mathbb{Z}^{+}, -n < x < 0,%
7070
}{\Gamma(x) = \Gamma(x + n)/((x + n -1) ... (x + 1)x), n in N, -n < x < 0,}
71-
see \bibcitet{|R:Abramowitz+Stegun:1972|6.1.16 or 6.1.22\\\\\\, page 256}.
71+
see \bibcitet{|R:Abramowitz+Stegun:1972|6.1.16 or 6.1.22\, page 256}.
7272
%
7373
The gamma function is not defined for zero and negative integers (when
7474
\code{NaN} is returned). There will be a warning on possible loss of
@@ -87,7 +87,7 @@ lfactorial(x)
8787
\frac{\Gamma'(x)}{\Gamma(x)}}{digamma(x) = \psi(x) = d/dx{ln \Gamma(x)} = \Gamma'(x) / \Gamma(x)}
8888
\eqn{\psi} and its derivatives, the \code{psigamma()} functions, are
8989
often called the \sQuote{\I{polygamma}} functions, e.g.\sspace{}in
90-
\bibcitet{|R:Abramowitz+Stegun:1972|section 6.4.1\\\\\\, page 260}; and higher
90+
\bibcitet{|R:Abramowitz+Stegun:1972|section 6.4.1\, page 260}; and higher
9191
derivatives (\code{deriv = 2:4}) have occasionally been called
9292
\sQuote{\I{tetragamma}}, \sQuote{\I{pentagamma}}, and \sQuote{\I{hexagamma}}.
9393

@@ -120,10 +120,10 @@ lfactorial(x)
120120
}
121121
\references{
122122
\bibinfo{R:Abramowitz+Stegun:1972}{footer}{
123-
\\\\\\url{https://en.wikipedia.org/wiki/Abramowitz_and_Stegun} provides
124-
links to the full text which is in public domain.\\\\\\cr
123+
\url{https://en.wikipedia.org/wiki/Abramowitz_and_Stegun} provides
124+
links to the full text which is in public domain.\cr
125125
Chapter 6: Gamma and Related Functions.}
126-
\bibinfo{R:Becker+Chambers+Wilks:1988}{footer}{(For \\\\\\code{gamma} and \\\\\\code{lgamma}.)}
126+
\bibinfo{R:Becker+Chambers+Wilks:1988}{footer}{(For \code{gamma} and \code{lgamma}.)}
127127
\bibshow{*, R:Becker+Chambers+Wilks:1988}
128128
}
129129
\seealso{

src/library/base/man/Trig.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ tanpi(x)
7272

7373
\section{Complex values}{
7474
For the inverse trigonometric functions, branch cuts are defined as in
75-
\bibcitet{|R:Abramowitz+Stegun:1972|figure 4.4\\\\\\, page 79}.
75+
\bibcitet{|R:Abramowitz+Stegun:1972|figure 4.4\, page 79}.
7676

7777
For \code{asin} and \code{acos}, there are two cuts, both along
7878
the real axis: \eqn{\left(-\infty, -1\right]}{(-Inf, -1]} and

src/library/base/man/rapply.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ rapply(object, f, classes = "ANY", deflt = NULL,
5757
\code{\link{lapply}}, \code{\link{dendrapply}}.
5858
}
5959
\references{
60-
\bibinfo{R:Chambers:1998}{footer}{(\\\\\\code{rapply} is only
60+
\bibinfo{R:Chambers:1998}{footer}{(\code{rapply} is only
6161
described briefly there.)}
6262
\bibshow{R:Chambers:1998}
6363
}

src/library/base/man/sort.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ sort.int(x, partial = NULL, na.last = NA, decreasing = FALSE,
149149
\code{\link{order}} if you want the original element numbers.
150150

151151
All attributes are removed from the return value
152-
\bibcitep{|R:Becker+Chambers+Wilks:1988|p.\\\\\\sspace{}146}
152+
\bibcitep{|R:Becker+Chambers+Wilks:1988|p.\sspace{}146}
153153
except names, which are sorted. (If
154154
\code{partial} is specified even the names are removed.) Note that
155155
this means that the returned value has no class, except for factors

src/library/datasets/man/BJsales.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BJsales
1818
BJsales.lead
1919
}
2020
\source{
21-
The data are given in \bibcitet{|R:Box+Jenkins:1976|p.\\\\\\sspace{}537}.
21+
The data are given in \bibcitet{|R:Box+Jenkins:1976|p.\sspace{}537}.
2222
Obtained from the Time Series Data Library at
2323
\url{https://robjhyndman.com/TSDL/}
2424
}

0 commit comments

Comments
 (0)