Skip to content

Commit

Permalink
write parent filename and line number in concordance for child docume…
Browse files Browse the repository at this point in the history
…nts; should be able to close #225 now
  • Loading branch information
yihui committed Jun 7, 2012
1 parent ace391c commit fe4d23c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/concordance.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ concord_gen = function(infile, outfile) {
concordance = paste(strwrap(paste(vals, collapse = " ")), collapse = " %\n")

# build record
parent = knit_concord$get('parent'); parent.line = knit_concord$get('parent.line')
extra = if (is.null(parent) || is.null(parent.line)) '' else {
str_c(parent, ':', parent.line, ':')
}
output = str_c("\\Sconcordance{concordance:", outfile, ":",
infile, ":", "%\n", concordance,"}\n")

infile, ":", extra, "%\n", concordance,"}\n")
# write to file
confile = str_c(file_path_sans_ext(outfile), '-concordance.tex')
cat(output, file = confile)
Expand Down

0 comments on commit fe4d23c

Please sign in to comment.