Skip to content

Commit

Permalink
trim aliases in Rd2latex(), too
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87650 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
smeyer committed Jan 27, 2025
1 parent f0f526f commit 24430e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,11 @@
returns \code{srcref} entries correctly. (Note that there
is also a change to the interpretation of \code{skip};
see the C-LEVEL API entry above.)
}
\item \code{tools::Rd2latex()} now removes leading and trailing
spaces from \verb{\alias} entries as documented, fixing indexing
and linking hiccups in some PDF manuals.
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/library/tools/R/Rd2latex.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# File src/library/tools/R/Rd2latex.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2024 The R Core Team
# Copyright (C) 1995-2025 The R Core Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -341,6 +341,7 @@ Rd2latex <- function(Rd, out = "", defines = .Platform$OS.type,
stop("alias:\n",
sQuote(paste(alias, collapse = "\n")),
"\nis not one line")
alias <- trim(alias)
aa <- "\\aliasA{"
## Some versions of hyperref (from 6.79d) have trouble indexing these
## |, || in base, |.bit, %||% in ggplot2 ...
Expand Down

0 comments on commit 24430e7

Please sign in to comment.