Miscellaneous low-level finders
find_whitespace(items, ...)find_env(items, envtypes = NULL, ...)
find_macro(items, macros = NULL, ...)
find_catcode(items, codes, ...)
find_tags(items, tags, ...)
find_char(items, char, ...)
find_block(items, ...)
find_general(items, test, ..., all = TRUE, path = FALSE)
find_whitespace()
returns the indices of
whitespace in items
.
find_env()
returns the indices within items
of environments in envtypes
.
find_macro()
returns the index within items
of instances in macros
.
find_catcode()
returns the index within items
.
of specials matching code
.
find_tags()
returns the index within items
.
of items with tags matching tags
.
find_char()
returns the index within items
of characters matching char
. Only characters
marked as SPECIAL by the parser will be found.
find_block()
returns the index within items
of blocks (i.e. sequences in )
find_general()
returns locations of
objects matching the test
.
A list of latex items.
For find_general
, additional arguments
to pass to test
. For the other find_*
functions,
additional arguments to pass to find_general
.
Which types of environment to look for.
Which types of macros to look for.
Which codes to look for.
Which tags to look for.
Which character to look for.
Test function for target.
If FALSE
, return just the first match
If TRUE
, return a path rather than an index. See Details below.
These functions search through items
for individual
objects that match a test. In general they do not
operate recursively, with one exception. If items
contains ITEMLIST
objects, the search will always
recurse into those.
By default the return value is an index or a vector
of indices of the matches. These are the indices as
they would be if any ITEMLIST
objects had been
flattened.
However, if path = TRUE
, the path to the
object will be returned. With all = FALSE
, this will
be a numeric vector such that items[[result]]
is the
matching item. With all = TRUE
it will be a list of
such vectors.
index_to_path()
, path_to_index()