I would like to use the bookdown @ref(fig:example) style cross references in a R vignette. But I'm not sure how to set this up. I'm guessing, I need to add bookdown to the suggests in my package, and then add something to the YAML. I currently have:
---
title: "Dongle: A lightweight interface between EI, EA and AS processes and
the Presentation Process"
author: Russell G. Almond
output: rmarkdown::html_vignette
bibliography: Proc4.bib
link-citations: TRUE
vignette: >
%\VignetteIndexEntry{Proc4 Dongle}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
How do I need to tweak this to add the cross-referencing ability? I still want the html_vignette output format, but I want to add the cross references?
Hopefully, the vignette will stay light and suitable for inclusing in a package. You would for sure need to add bookdown as a dependency of your package same way you did with rmarkdown for the vignette format.
It is still in our project to externalize the reference feature out of bookdown to be used more easily in other format, and especially in a more lightweight way
This generates the figure with the caption, but it is unnumbered. Also \@ref(fig:P4Lamp) does not resolve to a number.
Also, I'm trying to include and number listings:
I include the following:
::: {.example #P4 "Sample Message in P4 format"}
```{json, fig.cap="(ex:P4) Sample message in P4 format", eval=FALSE}
{
app: "ecd://epls.coe.fsu.edu/PP",
uid: "Student 1",
context: "SpiderWeb",
sender: "Evidence Identification",
mess: "Task Observables",
timestamp: "2018-10-22 18:30:43 EDT",
processed: false,
data:{
trophy: "gold",
solved: true,
objects: 10,
agents: ["ramp","ramp","springboard"],
solutionTime: {time:62.25, units:"secs"}
}
}
```
:::
```
But this does not add a caption, and `\@ref(exm:P4)` is not resolved.
So I think I'm missing a switch to turn on the cross reference engine.