---
title: "About glossr"
author: "Mariana Montes"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{About glossr}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
bibliography: ["../inst/REFERENCES.bib", "../inst/packages.bib"]
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

Interlinear glosses are a way of writing linguistic examples in a language other than the language of the main text (typically English). They first have a couple of lines of vertically aligned bits (however words are split in the original language) with, normally, some morphological information, and finally they might close with a free translation of the example. Most often they follow the Leipzig Glossing Rules.

R Markdown [@R-rmarkdown] is an R package for literate programming, where you can weave together text and code. You can use R Markdown to write your papers, focusing on content rather than formatting, confident that the same source (pretty much) can turn into both a beautiful PDF file or a gorgeous web page with the minimum of effort. Yes, once you're used to it, it's not harder than writing in MS Word. I've [written a bit](https://www.marianamontes.me/post/academic-writing-in-r-markdown-i/) about it in case you're interested.

Mixing R Markdown and interlinear glosses has proved challenging. This package offers you some wrapping functions that call [the `expex`](https://ctan.org/pkg/expex?lang=en) $\LaTeX$ package for PDF output and [leipzig.js](https://github.com/bdchauvette/leipzig.js/) for HTML output and try to compute spaces to align the words in MS Word output. You don't really need to know any Latex or Javascript or HTML to take advantage of these features.

The package also takes care of cross-references, giving you a handy function `gloss()` to sprinkle around your text every time you want to reference one of your examples. Go ahead and check out the articles and [the rendered versions](https://github.com/montesmariana/glossr/tree/main/inst/examples/) of `vignette("glossr_how")`.

I'm sure there is a lot of functionality in both `expex` and leipzig.js that this package doesn't cover... *yet*. Please, go ahead and report any problems, suggestions and tasks for the wishlist in [the issues section of the repository](https://github.com/montesmariana/glossr/issues). Or fork it and contribute if you'd like!

# Acknowledgements

While this is a matter I've wondered about for a while, it was really kicked off by Giulia Mazzola's worries. I'm converting her to the R Markdown crowd and I couldn't let her resolve weaken because of these small matters. Thank you for your encouragement and appreciation!

I also want to thank Thomas Van Hoey for taking a look at the package, giving me suggestions and offering me examples.

Last but not least, I'd like to acknowledge the source of the examples in the small "dataset" provided by this package. These glosses were taken from @shindo_2015 and @pustet_2015. Any mistakes are mine.

# Alternatives

Shortly before^[A few months earlier, but I didn't find out until a few days after.] this package, another R package came out to render glosses in R Markdown with HTML output: [lingglosses](https://agricolamz.github.io/lingglosses/). Unlike glossr, it is tailored for HTML, where it creates a table to render the glosses^[The markup is therefore different than the one given by leipzig.js]. It also allows grammaticality judgements, inline examples and sign language glosses, offers a list of abbreviations and generates a table from your glosses. In short, they have different focuses, so take a look and see what works for you :) 

# References

