Expand description
Strip LaTeX down to the prose inside it, keeping every line where it was.
Line N of the output is line N of the input .tex. Markup lines come back
empty and prose lines come back as prose, so a position reported against
the stripped text is a position in the source: an alert on line 42 is an
alert on line 42 of the .tex.
The output contains no backslashes, no { or }, and no LaTeX commands,
only the human-readable text a linter such as Vale should be checking.
§API
| Function | Responsibility |
|---|---|
strip | Strip a whole document, preserving line numbers |
strip_reader | The same, reading the source from an io::Read |
strip_line | Per-line LaTeX parsing (commands, braces, comments) |
is_remnant | Is this line leftover markup debris, not prose? |
strip is the entry point most callers want. The other two are the
pieces it is built from, exposed for callers assembling their own pipeline.
strip does more than apply them line by line: it also tracks state that
spans lines (blanked environments, multi-line \author/\title blocks), so
it is not simply strip_line in a loop.
Functions§
- is_
remnant - Return
trueif the line is leftover LaTeX debris rather than prose. - strip
- Strip a LaTeX source to plain text, preserving line numbers.
- strip_
line - Strip a single line of LaTeX to plain text.
- strip_
reader - Strip a LaTeX source read from
reader, preserving line numbers.