Learn R Programming

TexExamRandomizer (version 1.2.7)

DivideFile: DivideFile

Description

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

Usage

DivideFile(x)

Value

Returns a list with two character vectors:

preamble

A character vector that includes every line of x up the begin document command

document

A character vector that includes every line from the begin document command to the first end document command

Arguments

x

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

Details

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

See Also

Other Structuring Document: CompileDocument(), FindStructure, IsWellSectioned(), StructureDocument()

Examples

Run this code
file <- system.file(
    "extdata",
    "ExampleTexDocuments",
    "exam_testing_jsonparser.tex",
    package = "TexExamRandomizer"
)
x <- readLines(file)
DivideFile(x)

Run the code above in your browser using DataLab