Skip to contents

Render gloss from a dataframe

Usage

gloss_df(
  df,
  output_format = getOption("glossr.output", "latex"),
  numbering = getOption("glossr.numbering", TRUE)
)

Arguments

df

Dataframe one row per gloss. Columns translation, source and label have special meaning (see as_gloss()); all the others will be interpreted as lines to align in the order given.

output_format

(Optional) Whether it will use latex, word or html format.

numbering

(Optional) Whether the gloss should be numbered (in Word and HTML).

Value

Object of class gloss with the original input as data attribute.

Examples

my_gloss <- data.frame(
  first_line = "my first line",
  second_line = "my second line",
  translation = "Translation of my example",
  label = "label"
)
gloss_df(my_gloss)
#> [1] "\\ex\\label{label} \\begingl \\gla my first line// \\glb my second line// \\glft \"Translation of my example\"// \n \\endgl \\xe \n"
#> attr(,"class")
#> [1] "gloss"     "character"
#> attr(,"data")
#>      first_line    second_line               translation label
#> 1 my first line my second line Translation of my example label