# basic character row:
vec = c("hello", "world")
TexRow(vec)
# character row with LaTeX formatting:
vec = c('Hello','\\textbf{World}','$\\alpha$','$\\frac{1}{2}$')
TexRow(vec)
# basic numeric row:
vec <- c(1.0, 1.01, 1.001)
TexRow(vec)
TexRow(vec, dec = 2) # round to second decimal place
# custom formatting of numbers using surround argument:
vec = c(5.081, 2.345, 6.789)
TexRow(vec, dec = 1, surround = "{\\color{red} %s}")
# use cspan argument to merge the second and third rows:
vec = c("hello", "world")
TexRow(vec, cspan = c(1,2))
TexRow(vec, cspan = c(1,2), position = "c") # center merged columns
# concatenate blocks vertically or horizontally:
block1 = TexRow(c("hello","world","block"))
block2 = TexRow(c(5.081, 2.345, 6.789), dec=1)
block1 / block2 # horizontal
block1 + block2 # vertical
# add 3pt of vertical space between two rows using the space argument:
TexRow(c("hello", "world"), space=3) + TexRow(c('$\\alpha$','$\\frac{1}{2}$'))
Run the code above in your browser using DataLab