You can use snippets in rmarkdown outside a chunk, but the snippet needs to be defined in the "Markdown" snippets page (rather than the "R" snippets page) in order for this to work.
If you click on "edit snippets" in Global Options, the snippets file will open. What you see by default are the "R" snippets. However, in the left column of the window, you can see other languages listed, including "Markdown." Click on "Markdown" and you'll see the Markdown snippets page, where you can add your snippet.
For example, I added the following snippet:
snippet yy
\$`r yac_str(x)`\$
This snippet assumes that the object we're turning into a string will always be named x
(you can change the snippet to allow a user-provided name, if desired).
To use the snippet, type yy
and then shift+tab
and it will replace yy
with the text string of the equation. If x
doesn't exist, the replacement output will be $$
.