DivideFile: DivideFile

Description Usage Arguments Details Value See Also Examples

View source: R/structuringdocument.R

Description

Function that takes a vector of text lines, x, and divides it in preamble and document.

Usage

1

Arguments

x

A character vector, each element represents one line of the latex document

Details

It ignores everything after the first \end{document} and it will throw and error if it finds more than one \begin{document} before that

Value

Returns a list with two character vectors:

preamble

A character vector that includes every line of x up to \begin{document}

document

A character vector that includes every line from \begindocument to the first \end{document}

See Also

Other Structuring Document: CompileDocument, FindStructure, IsWellSectioned, StructureDocument

Examples

1
2
3
4
5
6
7
8
file <- system.file(
    "extdata",
    "ExampleTexDocuments",
    "exam_testing_jsonparser.tex",
    package = "TexExamRandomizer"
)
x <- readLines(file)
DivideFile(x)

TexExamRandomizer documentation built on May 2, 2019, 3:18 a.m.