Learn R Programming

parseLatex (version 0.4.1)

reduce_whitespace: Remove excess whitespace recursively

Description

Remove excess whitespace recursively

Usage

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

Value

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

Arguments

items

A LaTeX2 object.

recursive

Apply to all lists within items.

all

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

Examples

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

Run the code above in your browser using DataLab