Skip to content

Commit d581b7e

Browse files
author
smeyer
committed
tweaks
git-svn-id: https://svn.r-project.org/R/trunk@88477 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent f9529fe commit d581b7e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/library/tools/R/Rd2latex.R

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,10 @@ Rd2latex <- function(Rd, out = "", defines = .Platform$OS.type,
123123
sectionLevel <- 0
124124
hasFigures <- FALSE
125125

126-
startByte <- function(x) {
127-
srcref <- attr(x, "srcref")
128-
if (is.null(srcref)) -1L
129-
else srcref[2L]
130-
}
131-
132-
addParaBreaks <- function(x, tag) {
133-
if (isBlankLineRd(x)) "\n"
134-
else if (startByte(x) == 1L) psub("^\\s+", "", x)
126+
startByte <- utils:::getSrcByte
127+
addParaBreaks <- function(x) {
128+
## this only removes indentation (for cleaner/smaller output)
129+
if (startByte(x) == 1L) psub1("^[[:blank:]]+", "", x)
135130
else x
136131
}
137132

@@ -367,7 +362,7 @@ Rd2latex <- function(Rd, out = "", defines = .Platform$OS.type,
367362
UNKNOWN =,
368363
VERB = of1(texify(block, TRUE)),
369364
RCODE = of1(texify(block, TRUE)),
370-
TEXT = of1(addParaBreaks(texify(block), blocktag)),
365+
TEXT = of1(addParaBreaks(texify(block))),
371366
USERMACRO =,
372367
"\\newcommand" =,
373368
"\\renewcommand" = {},

0 commit comments

Comments
 (0)