path_to_index | R Documentation |
Convert between paths and indices
path_to_index(path, items)
index_to_path(index, items)
paths_to_ranges(path1, path2, items)
get_ranges(items, ranges)
path |
A vector of integers, assumed to be a path through "ITEMLIST" entries in a LaTeX2 or LaTeX2item object. |
items |
The referenced object. |
index |
A scalar integer which would be
the index to an item if |
path1 , path2 |
Paths into the same destination list. |
ranges |
A list of LaTeX2range objects, such as
that produced by |
path_to_index
returns a scalar value
corresponding the the index if items
was flattened.
index_to_path
returns a vector of integers
which would index the specified item.
paths_to_range
returns a list of LaTeX2range objects covering all entries
extending from path1
to path2
.
get_ranges()
extracts the
specified ranges, concatenates them, and returns them as a LaTeX2 object.
flatten_itemlists()
latex <- kableExtra::kbl(mtcars[1:2, 1:2], format = "latex")
parsed <- parseLatex(latex)
tablepath <- path_to(parsed, is_env, envtypes = "tabular")
table <- prepare_table(parsed[[tablepath]])
path_to_index(c(4,1,1), table)
index_to_path(3, table)
ranges <- paths_to_ranges(index_to_path(3, table),
c(4,1,1), table)
lapply(ranges, get_range, items = table)
get_ranges(table, ranges)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.