nth_arg_positions(tex_lines, command_name, n = 1L)
Arguments
tex_lines
A character vector of a LaTeX file read in from readLines.
command_name
The command name,
or the pattern of the command, without the initial backslash.
n
The number of mandatory arguments.
replacement
What to replace the nth argument with.
warn
If the nth argument is not present, emit a warning? Set to FALSE for n-ary commands.
.dummy_replacement
An intermediate replacement value.
This value cannot be present in tex_lines.
Details
nth_arg_positions reports the starts and stops of the command for every line.
This includes the braces (in order to accommodate instances where the argument is empty).
# NOT RUN {nth_arg_positions("This is a \\textbf{strong} statement.", "textbf")
replace_nth_LaTeX_argument("This is a \\textbf{strong} statement.", "textbf")
# }