knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Users can output interlinear glosses in Rmarkdown files from the texts in a Lexa database.
Both PDF and HTML output formats are supported. The LaTeX package expex is used for PDF output, while HTML glosses are rendered with Leipzig.js.
At this time, the functionalities implemented within lexa are limited, but they provide sufficient coverage for basic glossing.
To load a Lexa database, we first attach the lexa package.
library(lexa)
And then load the example database eleryon_lexadb
.
eleryon_path <- system.file("extdata/eleryon_lexadb", package = "lexa") eleryon <- load_lexadb(eleryon_path)
We can now inspect the content of the eleryon
database.
eleryon
There are two ways of including an interlinear gloss in an Rmarkdown file.
One is by using inline R code (see the source of this vignette for the code).
r include_gloss(eleryon, "tx_000001", "st_000001")
Alternatively, one can use an R code chunk and set results='asis'
.
include_gloss(eleryon, "tx_000001", "st_000002")
bromi_path <- system.file("extdata/bromi_lexadb", package = "lexa") bromi <- load_lexadb(bromi_path)
r include_gloss(bromi, "tx_000001", "st_000001")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.