knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Overview

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.

Load a Lexa database

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

Include interlinear glosses

There are two ways of including an interlinear gloss in an Rmarkdown file.

Inline R code

One is by using inline R code (see the source of this vignette for the code).

r include_gloss(eleryon, "tx_000001", "st_000001")

R code chunk

Alternatively, one can use an R code chunk and set results='asis'.

include_gloss(eleryon, "tx_000001", "st_000002")

Original writing system and transcription/transliteration

bromi_path <- system.file("extdata/bromi_lexadb", package = "lexa")

bromi <- load_lexadb(bromi_path)

r include_gloss(bromi, "tx_000001", "st_000001")



stefanocoretta/lexa documentation built on Feb. 4, 2024, 6:49 p.m.