Skip to contents

Create one (or many) partial midrule(s).

Usage

TexMidrule(rule_list = NULL)

Arguments

rule_list

(list). A list of integer vectors. Each integer vector must contain two integers which indicate the start and end column of the partial midrule. If rule_list = NULL, it returns the full midrule across all columns. The default is rule_list = NULL.

Value

The output is a textab block.

Examples

# set up two textab blocks:
block1 = TexRow(c("hello","world","block"))
block2 = TexRow(c(5.081, 2.345, 6.789), dec=1)

# add a full midrule between the two blocks
block1 + TexMidrule() + block2
#> % created using textab on Wed Apr 26 17:42:42 2023
#> \begin{tabular}{rrr}
#> hello & world & block \\
#> \midrule 
#> 5.1 & 2.3 & 6.8 \\
#> \end{tabular}

# add a partial midrule to the first column and spanning the second-third columns:
block1 + TexMidrule(list(c(1,1), c(2,3))) + block2
#> % created using textab on Wed Apr 26 17:42:42 2023
#> \begin{tabular}{rrr}
#> hello & world & block \\
#>  \cmidrule(lr){1-1} \cmidrule(lr){2-3} 
#> 5.1 & 2.3 & 6.8 \\
#> \end{tabular}