read_glossary | R Documentation |
Files may be formatted as TeX glossary file or
in yaml format suitable for reading using
yaml_as_df()
(see details).
read_glossary(file, format = guess_glo_fmt(file))
file |
path to the tex or yaml glossary file. |
format |
the glossary file format; could be either |
For the tex format, the glossary file is expected to contain acronym entries with the form
\newacronym{label}{abbreviation}{definition}
or
\newacronym[options]{label}{abbreviation}{definition}
For the yaml format, the glossary file is expected to be able to be
read with yaml_as_df()
; the outer level should be the label
and
columns should be provided with the names def
(definition) and
abb
(abbreviation). See Examples.
A named list of glossary definitions with class tex_glossary
and
glossary
. The list names are acronym entry labels (i.e., what you would
pass to \gls{}
when writing a tex document).
as_glossary()
texfile <- system.file("glo", "glossary.tex", package = "pmtables")
x <- read_glossary(texfile)
head(x)
x$WT
x$SC
yamfile <- system.file("glo", "glossary.yaml", package = "pmtables")
y <- read_glossary(yamfile)
head(y)
# Format of the tex glossary file
head(readLines(texfile))
# Format of the yaml glossary file
head(readLines(yamfile))
yaml_as_df(yamfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.