5

I've a simple question. How i create a glossary with Rmarkdown / knitr. I work with RStudio.

I try this but without success

\usepackage{glossaries}

in a header.tex and in rmd file

Glossary
--------

\makeglossaries

\newglossaryentry{score_r1_ch1}
{
name=zscore,
description={ description here}
}
\printglossaries

Thanks

Keith Hughitt
  • 4,860
  • 5
  • 49
  • 54
CHK
  • 75
  • 8
  • First of all, there are `{}` brackets missing: `name={zscore}`. Other than that, if you have a look at this [beginners' guide](http://get-software.net/macros/latex/contrib/glossaries/glossariesbegin.pdf), section 4, you'll know that you have to run LaTeX twice in order to make a glossary, which frankly, I don't know how to do. – jmjr Sep 08 '15 at 12:27
  • I have precisely the same issue... As @jmjr points out, you have to run LaTeX twice. I don't know how to do that from `rmarkdown` either. – Bob Sep 15 '16 at 15:16

1 Answers1

5

Late to the party, but the following might interest others on the search for creating a glossary in RMarkdown when rendering to .pdf:

One can use definition lists to create glossaries. This is part of a .rmd file:

# Glossary {-}

Foo

:   description of foo

Bar

:   descirption of bar

This renders to:

enter image description here

symbolrush
  • 7,123
  • 1
  • 39
  • 67
  • Doesn't _require_ blank line before `:`, but does require at least one space between `:` and definition. – Paul Jan 30 '23 at 16:37