find_pattern | R Documentation |
Searches a LaTeX2 list for text using grepl()
on deparsed versions of parts of the code.
It attempts to find the narrowest match(es) that lie
within a single container.
find_pattern(items, pattern, ..., all = FALSE)
items |
A list of latex items. |
pattern |
Pattern to use in |
... |
Additional parameters to pass to |
all |
Find all matching, or the first? |
find_pattern()
does a recursive search in the order
items appear in the deparse. If the pattern matches,
it attempts to narrow the match by recursing into
containers and dropping earlier and later items.
It should always return syntactically correct LaTeX
code in which the pattern appears.
find_pattern()
returns a LaTeX2range object
or (if all
is TRUE
) a list of them.
latex <- kableExtra::kbl(mtcars[1:2, 1:2], format = "latex", caption = "Sample table")
parsed <- parseLatex(latex)
parsed
loc <- find_pattern(parsed, "RX4 Wag", fixed = TRUE)
loc
print(loc, source = parsed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.