Miscellaneous utilities
Usage
drop_items(items, which)
select_items(items, which)
drop_whitespace(items)
include_whitespace(items, which)
split_list(items, splits)
split_latex(items, splits)
new_block(items)
Arguments
- items
A LaTeX2 object or list of items.
- which
Which items to operate on.
- splits
Which items divide the parts?
Value
drop_items()
returns the list of items with specific items removed.
select_items()
returns the list of subsetted items.
drop_whitespace()
returns the items with
whitespace (blanks, tabs, newlines) removed.
include_whitespace()
returns which
with
following whitespace (blanks, tabs, newlines) included.
split_list()
returns a list of pieces
separated at the splits.
split_latex()
returns a list of pieces
separated at the splits. Each piece is marked as
a LaTeX2 object.
A BLOCK item containing the items.
Note
drop_whitespace()
will drop the whitespace that separates text items, so deparsing will merge
them into a single item.
See also
drop_whitespace()
does not act recursively; use reduce_whitespace for that.
Examples
new_block(parseLatex("abc"))
#> BLOCK: {abc}