reduce_whitespace: Remove excess whitespace recursively

View source: R/reduce_whitespace.R

reduce_whitespaceR Documentation

Remove excess whitespace recursively

Description

Remove excess whitespace recursively

Usage

reduce_whitespace(items, recursive = TRUE, all = FALSE)

Arguments

items

A LaTeX2 object.

recursive

Apply to all lists within items.

all

If TRUE, remove all white space, not just doubles.

Value

items with double spaces or double newlines set to single, and trailing spaces removed (or all whitespace removed, if all is TRUE).

Examples

parsed <- parseLatex("a  {b\n\nc}")
parsed
reduce_whitespace(parsed)

parseLatex documentation built on April 3, 2025, 5:27 p.m.