parse_tex {TeXCheckR} | R Documentation |
Parse LaTeX lines
Description
Parse LaTeX lines
Usage
parse_tex(tex_lines)
Arguments
tex_lines |
Character vector (as read from a |
Value
A data.table
where each row identifies a unique character in tex_lines
.
line_no
Matches the index of
tex_lines
.char_no
The character within
line_no
.char
The character. A single character.
tex_group
The TeX group by default. Any delimiters can be used.
optional_tex_group
(If any present), the optional TeX group.
tgi
The number of braces opened at the
i
-th current TeX group level.GROUP_IDi
An integer identifying the unique contiguous block at the TeX group at or above the current group level.
GROUP_IDi
The analog for optional groups.
If tex_lines
is zero-length, a null data.table
.
Examples
parse_tex(c("A{}", "B[a]{b{c}{d}}z"))
# The version transposed:
#
#> char : A{}B[a]{b{c}{d}}z
#> tg1 : 011111122......22
#> tg2 : 00000000011122222
#> og1 : 00001111111111111
#> GROUP_ID1 : .11....222222222.
#> GROUP_ID2 : .........111222..
#> OPT_GROUP_ID1 : ....111..........
[Package TeXCheckR version 0.8.1 Index]