ParsePreambleForOptions: ParsePreambleForOptions

View source: R/jsonparser.R

ParsePreambleForOptionsR Documentation

ParsePreambleForOptions

Description

This function parses a preamble of a document trying to read options handed to the package TexExamRandomizer to be used in compiling.

Usage

ParsePreambleForOptions(preamble)

Arguments

preamble

character vector identifying the preamble from which to pass the JSON readon through

Details

It find all %!TexExamRandomizer = {} lines. It then uses the function fromJSON to parse them, and it concatenates all those options.

If more than one option with the same name is given, it tries to concatenate those. However, it doesn't do that recursively, only if the names of the outer layer are the same... therefore, in nested structure you might end up with a list that have twice the same name. Keep in mind that in those cases, the default behaviour of R is to select the first one.

Value

Returns a list, that concatenates all the lists of options described on the file.

See Also

Other jsoncompiler: compilation_options(), jsonexamparser(), jsonhwparser()


alexrecuenco/TexExamRandomizer documentation built on Jan. 31, 2024, 9:29 p.m.