Skip to contents

Test objects

Usage

is_env(item, envtypes = NULL)

is_macro(item, macros = NULL)

is_block(item)

is_bracket(item, bracket)

is_whitespace(item)

Arguments

item

An object of class LaTeX2item to test.

envtypes

Types of Latex environment to check for, e.g. "table".

macros

Which macros to match, e.g. "\\\\caption".

bracket

Which bracket are we looking for?

Value

is_env() returns a boolean if the item matches.

is_macro() returns a boolean indicating the match.

is_block() returns a boolean indicating whether the item is a block wrapped in curly braces.

is_bracket() returns a boolean indicating that the item is a bracket of the specified type.

is_whitespace() returns a boolean indicating if the item is a space, tab or newline.

Examples

is_bracket(parseLatex("[]")[[1]], "[")
#> [1] TRUE