find_sequence: Find a code sequence

View source: R/find_sequence.R

find_sequenceR Documentation

Find a code sequence

Description

Find a code sequence

Usage

find_sequence(items, sequence, all = FALSE, ignore_whitespace = TRUE)

items_are_equal(items1, items2)

Arguments

items, sequence

LaTeX2 objects or lists.

all

Whether to return all matches, or just the first.

ignore_whitespace

Whether to ignore whitespace in comparisons.

items1, items2

Two LaTeX2 or LaTeX2item objects.

Details

find_sequence() will only match sequences that are entirely contained within a single list in items. Thus if prepare_table() is called on a table, then find_sequence() will find sequences in the code before or after the rows, or entirely within a single cell, but not crossing alignment markers ("&").

Value

find_sequence() returns a LaTeX2range or list of them where sequence occurs within items.

items_are_equal returns a logical indicator of equality after removing source references.

Examples

find_sequence(parseLatex("a & b & c"), "b & c")

parseLatex documentation built on June 8, 2025, 10:19 a.m.