add_whitespaces_to_seperate_chunks: Add whitespace after single tex chunk.

View source: R/texcode.r

add_whitespaces_to_seperate_chunksR Documentation

Add whitespace after single tex chunk.

Description

The LaTeX commands need to be seperated by whitespaces or linebreaks. But after the $ evironment delimiter they are not allowed. The function: - adds a whitespace at the end of every chunk except after chunks beginning or ending with $ - adds no whitespace at the end of chunks followed by a chunk onyl containing $

Usage

add_whitespaces_to_seperate_chunks(x)

Arguments

x

texcode object.

Details

A cleaner approach would use objects that come along with the space to insert but that would mean reprogramming everything.

Value

A textcode object with whitespace added where needed.

Examples

x <- "$" + lex(10) + lex("a") + "$\\n"

markheckmann/mat2tex documentation built on July 29, 2023, 7:45 p.m.