Skip to content
Snippets Groups Projects
Commit a448cfb9 authored by Gjalt-Jorn Peters's avatar Gjalt-Jorn Peters
Browse files

minor bug in automatic caption;

parent 28dbcf72
No related branches found
No related tags found
1 merge request!17Pushed 0.5.0 to CRAN
Pipeline #408303551 failed
......@@ -46,11 +46,21 @@ insertNumberedCaption <- function(captionText = "",
if (!is.numeric(counter)) counter <- 1;
if (is.numeric(resetCounterTo)) counter <- resetCounterTo;
### Compose caption text
if ((!is.null(prefix)) && (!(is.na(prefix))) && (nchar(prefix > 0))) {
formattedPrefix <- sprintf(prefix, counter);
} else {
formattedPrefix <- "";
}
if ((!is.null(suffix)) && (!(is.na(suffix))) && (nchar(suffix > 0))) {
formattedSuffix <- sprintf(suffix, counter);
} else {
formattedSuffix <- "";
}
res <-
paste0(
sprintf(prefix, counter),
formattedPrefix,
captionText,
sprintf(suffix, counter)
formattedSuffix
);
### Update counter in options
do.call(options,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment