Skip to content

Commit

Permalink
Fixes #2311
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeMendelowitz committed Dec 11, 2023
1 parent b037a31 commit f4adf9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/table.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ kable_caption = function(label, caption, format) {
# create a label for bookdown if applicable
if (is.null(label)) label = opts_current$get('label')
if (is.null(label)) label = NA
if (!is.null(caption) && !is.na(caption) && !is.na(label)) caption = paste0(
is_na = function(v) {
length(v) == 0 || (length(v) == 1 && is.na(v))
}
if (!is.null(caption) && !is_na(caption) && !is_na(label)) caption = paste0(
create_label(
opts_knit$get('label.prefix')[['table']],
label, latex = (format == 'latex')
Expand Down

0 comments on commit f4adf9d

Please sign in to comment.