table.cross.ref: Create the cross-reference string, and the caption of a table...

table.cross.refR Documentation

Create the cross-reference string, and the caption of a table with cross-reference

Description

tRef creates the cross-reference string, and tCap creates the caption.

Usage

tRef(label, isDocx)
tCap(cap, label, isDocx)

Arguments

cap

(character) the original caption string

label

(character) the label of the table in the knitr code chunk

isDocx

(boolean) is the output format of the Rmd file word_document2?

Details

Because the current version of flextablev0.5.5 does not work with bookdownv0.12 in automatically producing table cross-reference, these functions are a workaround.

Value

(character) If isDocx is FALSE, tRef returns Table \@ref(tab:label) and tCap simply returns cap; otherwise, tRef returns Table. x and tCap returns Table. x cap, where x is the ordered index of the table.

Examples

library(wfr)
tCap("first table","tab1",FALSE)
tCap("first table","tab1",TRUE)
tCap("second table","tab2",TRUE)
tCap("first table","tab1",TRUE)

tRef("tab2",TRUE)
tRef("tab1",TRUE)


blueskypie/wfr documentation built on Feb. 6, 2024, 4:38 p.m.