pander table.caption - bold text for reactive variables


I am outputting tables to Word using pander in R Markdown within a loop (80+ tables). I build the table caption using 'paste' in each iteration of the loop, but I want all of the table caption to be in bold, which is fine for the fixed text using bold text but doesn't work for dynamic variables which are updated in the loop. I have tried various options (e.g. (dynamic variable) (from shiny) but nothing seems to work.

here is some pseudo code where I would like "i" to be in bold as well as the text :

for (i in 1:10){
table.caption<-paste("**Table no. **", i ,")

Any suggestions?

Might be best to achieve that purpose with a stylesheet instead of markup, but the latter should be possible as well: what if you use the double stars around the pasted content? Eg

for (i in 1:10){
  table.caption <- pandoc.strong.return(paste("Table no.", i))
  pander(data.frame(x = 42), caption = table.caption)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.