strip_comments {TeXCheckR}R Documentation

Strip comments from LaTeX lines

Description

Strip comments from LaTeX lines

Usage

strip_comments(lines, retain.percent.symbol = TRUE)

Arguments

lines

Character vector of a LaTeX document.

retain.percent.symbol

(logical, default: TRUE) Should the ⁠%⁠ symbol itself be stripped?

Value

lines but with all text to the right of every unescaped ⁠%⁠ removed

Examples


some_lines <- c("Text. % A comment", "20\\% of comments are % useful")
strip_comments(some_lines)
strip_comments(some_lines, retain.percent.symbol = FALSE)

[Package TeXCheckR version 0.8.1 Index]