MyNixOS website logo
Description

Use Interlinear Glosses in R Markdown.

Read examples with interlinear glosses from files or from text and print them in a way compatible with both Latex and HTML outputs.

glossr

CRANstatus DOI Release R-CMD-check

The glossr package gives you tools to include interlinear glosses in your R Markdown or Quarto file. If you are writing a linguistics paper and you want some interlinear glosses, this is for you!

Maybe you already use gb4e or expex and you’re happy with your PDF files, good for you! But maybe you want to spice things up, have your examples in one file and read a dataframe to generate them on demand, instead of typing and mistyping and having your examples all over the place. If that’s the case, glossr is for you!

Or maybe you want HTML output to work? If you use gb4e or expex, your examples will disappear from the HTML output! Here glossr can most definitely help. It even offers a helper function for cross-references that work in both formats! In fact, I included two different HTML outputs: one using leipzig.js and a sadder one that might be more accessible, just less pro-looking.

If you also want Word output, glossr can also take care of it, computing the expected width of the words and aligning them accordingly.

But please, don’t take my word for it —you can check the PDF, HTML and MS Word outputs of vignette("glossr_how")stored in the repository.

Installation

Install glossr via CRAN:

install.packages("glossr")

You can also install the development version of glossr from GitHub with:

# install.packages("devtools")
devtools::install_github("montesmariana/glossr")

Example

This is a basic example; check vignette("glossr_how") for more examples and their output.

library(glossr)
use_glossr()

my_gloss <- as_gloss(
  "她 哇的一聲 大 哭起來,",
  "tā wā=de-yì-shēng dà kū-qǐlái,",
  "TSG waa.IDEO-LINK-one-sound big cry-inch",
  translation = "Waaaaa, she began to wail.",
  label = "my-label",
  source = "ASBC (nº 100622)"
)

Acknowledgements

This package is possible thanks to the existence of other packages it has built on, mostly {rmarkdown} and {htmltools}, as well as the expex package for PDF output and leipzig.js for the HTML output. The HexSticker was designed in Krita and rendered with {hexSticker}.

I would also like to acknowledge the input and encouragement of Giulia Mazzola and Thomas Van Hoey, who shared ideas and tested the code as it evolved.

Last but not least, I’d like to acknowledge the source of the examples in the small “dataset” provided by this package, taken from Maria Koptjevskaja-Tamm’s The Linguistics of Temperature (see vignette("glossr")).

Questions and suggestions?

Bring them on to the issues section of the repository!

Metadata

Version

0.8.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows