| rpic_svg | R Documentation |
Render pic source to an SVG string
rpic_svg(src, circuits = FALSE, texlabels = FALSE)
src |
pic source code. |
circuits |
load the native circuit-element library (or write
|
texlabels |
typeset fully |
an SVG string.
Compile errors are raised as a classed rpic_error condition whose
info field holds the structured diagnostic (message, line, col,
end_col, file, kind, found, expected, hint; absent values are
NA, and file names a copy include — NA means your own input).
Positions are relative to your own source, even with circuits = TRUE:
tryCatch(
rpic_svg("bxo", circuits = TRUE),
rpic_error = function(e) e$info$hint # "did you mean `box`?"
)
rpic_svg('box "hi"; arrow; circle "x"')
tryCatch(rpic_svg("bxo"), rpic_error = function(e) e$info$line)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.