Skip to contents

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

Usage

DivideFile(x)

Arguments

x

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

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

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

file <- system.file(
    "extdata",
    "ExampleTexDocuments",
    "exam_testing_jsonparser.tex",
    package = "TexExamRandomizer"
)
x <- readLines(file)
DivideFile(x)
#> $preamble
#>  [1] "% Studentds question collection"                                                                                                                                
#>  [2] "%# Author Alejandro Gonzalez Recuenco and SKR students"                                                                                                         
#>  [3] "%# e-mail <alejandrogonzalezrecuenco@gmail.com>"                                                                                                                
#>  [4] ""                                                                                                                                                               
#>  [5] "\\documentclass{exam}"                                                                                                                                          
#>  [6] "%SET-UP:"                                                                                                                                                       
#>  [7] "\\usepackage{amsmath, physics, tikz, tcolorbox, graphicx}"                                                                                                      
#>  [8] ""                                                                                                                                                               
#>  [9] ""                                                                                                                                                               
#> [10] "%! TexExamRandomizer = {\"noutput\":3, \"nquestions\": 13}"                                                                                                     
#> [11] "%! TexExamRandomizer = {\"table\":\"../ExampleTables/TestClass.csv\"}"                                                                                          
#> [12] "%! TexExamRandomizer = {\"randominfo\": {\"switchnumber\":[\"even\", \"odd\"]}}"                                                                                
#> [13] "%! TexExamRandomizer = {\"extrainfo\":{\"class\":\"Class\"}}"                                                                                                   
#> [14] "%! TexExamRandomizer = {\"randominfo\": {\"randomnumber\":100000000}, \"extrainfo\":{\"rollnumber\":\"Roll Number\",\"nickname\":\"Nickname\"}, \"seed\":69504}"
#> [15] ""                                                                                                                                                               
#> [16] "\\newcommand{\\randomnumber}{3}"                                                                                                                                
#> [17] "\\newcommand{\\switchnumber}{hi}"                                                                                                                               
#> [18] "\\newcommand{\\class}{class}"                                                                                                                                   
#> [19] "\\newcommand{\\rollnumber}{rollnumber}"                                                                                                                         
#> [20] "\\newcommand{\\nickname}{nickname}"                                                                                                                             
#> [21] "\\newcommand\\myversion{0}"                                                                                                                                     
#> [22] "\\newcommand\\rseed{seed}"                                                                                                                                      
#> [23] ""                                                                                                                                                               
#> [24] ""                                                                                                                                                               
#> [25] "% DOCUMENT STARTS HERE"                                                                                                                                         
#> 
#> $document
#>   [1] "\\begin{document}"                                                                                                                              
#>   [2] ""                                                                                                                                               
#>   [3] "\\author{\\class\\ --- \\nickname --- \\rollnumber}"                                                                                            
#>   [4] "\\title{\\textsc{Exam collection} --- mini-exam, random \\randomnumber, switch \\switchnumber }"                                                
#>   [5] ""                                                                                                                                               
#>   [6] "\\date{seed:\\rseed, version:\\myversion}"                                                                                                      
#>   [7] "\\maketitle"                                                                                                                                    
#>   [8] ""                                                                                                                                               
#>   [9] ""                                                                                                                                               
#>  [10] "\\begin{questions}"                                                                                                                             
#>  [11] ""                                                                                                                                               
#>  [12] "\\section{Word problems}"                                                                                                                       
#>  [13] ""                                                                                                                                               
#>  [14] "\t\\question What is the mathematical definition of derivative."                                                                                
#>  [15] ""                                                                                                                                               
#>  [16] "\t\\begin{choices}"                                                                                                                             
#>  [17] "\t\t\\choice $f'(x) = \\lim_{h\\to 0}$ $\\frac{f(x)-f(x)}{h+x}$"                                                                                
#>  [18] "\t\t\\choice $f'(x) = \\lim_{h\\to 0}$ $\\frac{f(x)-f(h)}{x}$"                                                                                  
#>  [19] "\t\t\\choice $f'(x) = \\lim_{h\\to 0}$ $\\frac{f(x+h)+f(h)}{x}$"                                                                                
#>  [20] "\t\t\\CorrectChoice $f'(x) = \\lim_{h\\to 0}$ $\\frac{f(x+h)-f(x)}{h}$"                                                                         
#>  [21] "\t\\end{choices}"                                                                                                                               
#>  [22] "\t\\question What is the derivative of the function $h(x) = \\frac{f(x)}{g(x)}$,"                                                               
#>  [23] ""                                                                                                                                               
#>  [24] "\t\\begin{choices}"                                                                                                                             
#>  [25] "\t\t\\choice $h'(x) = f'(g(x)) \\cdot g'(x).$"                                                                                                  
#>  [26] "\t\t\\choice $h'(x) = f'(x)g(x)-f(x)g'(x).$"                                                                                                    
#>  [27] "\t\t\\choice $h'(x) = f'(x)g(x)+f(x)g'(x).$"                                                                                                    
#>  [28] "\t\t\\CorrectChoice $h'(x) = \\frac{f(x)g'(x)-f'(x)g(x)}{(g(x))^2}.$"                                                                           
#>  [29] "\t\\end{choices}"                                                                                                                               
#>  [30] ""                                                                                                                                               
#>  [31] "\t\\question Which one is the correct form of the chain rule ?"                                                                                 
#>  [32] ""                                                                                                                                               
#>  [33] "\t\\begin{choices}"                                                                                                                             
#>  [34] "\t\t\\choice $(f(g'))(x)=f'(g(x'))g'(x)$"                                                                                                       
#>  [35] "\t\t\\choice $(f(g'))'(x)=f'(g(x'))g'(x)$"                                                                                                      
#>  [36] "\t\t\\choice $(f(g))'(x)=f'(g'(x'))g'(x')$"                                                                                                     
#>  [37] "\t\t\\CorrectChoice $(f(g))'(x)=f'(g(x))g'(x)$"                                                                                                 
#>  [38] "\t\\end{choices}"                                                                                                                               
#>  [39] ""                                                                                                                                               
#>  [40] "\t\\question Which of the following is NOT a type of discontinuity?"                                                                            
#>  [41] ""                                                                                                                                               
#>  [42] "\t\\begin{choices}"                                                                                                                             
#>  [43] "\t\t\\choice Removable."                                                                                                                        
#>  [44] "\t\t\\choice Infinite jump."                                                                                                                    
#>  [45] "\t\t\\choice Finite jump."                                                                                                                      
#>  [46] "\t\t\\CorrectChoice Endpoint."                                                                                                                  
#>  [47] "\t\\end{choices}"                                                                                                                               
#>  [48] ""                                                                                                                                               
#>  [49] "\t\\question What does a `Derivative' describe?"                                                                                                
#>  [50] "\t\\begin{choices}"                                                                                                                             
#>  [51] "\t\t\\choice It describes the instantaneous change of rate of the functions at $x$ axis."                                                       
#>  [52] "\t\t\\choice It describes the instantaneous change of rate of the functions at $y$ axis."                                                       
#>  [53] "\t\t\\choice It describes the instantaneous change of rate of the functions at some point."                                                     
#>  [54] "\t\t\\CorrectChoice It describes the instantaneous change of rate of the functions at every point."                                             
#>  [55] "\t\\end{choices}"                                                                                                                               
#>  [56] "\t\\question What is a tangent line to a curve at a point $x = a$?"                                                                             
#>  [57] ""                                                                                                                                               
#>  [58] "\t\\begin{choices}"                                                                                                                             
#>  [59] "\t\t\\choice A line that crosses a  curve once."                                                                                                
#>  [60] "\t\t\\choice None of the other choices are correct."                                                                                            
#>  [61] "\t\t\\choice A line that crosses a curve in two points."                                                                                        
#>  [62] "\t\t\\CorrectChoice A line that has the same slope as the curve at the point $x = a$."                                                          
#>  [63] "\t\\end{choices}"                                                                                                                               
#>  [64] "\t\\question What type of graph is the derivative of $f(x)= 5x^3+6x^2+5x-1$ graph?"                                                             
#>  [65] ""                                                                                                                                               
#>  [66] "\t\\begin{choices}"                                                                                                                             
#>  [67] "\t\t\\choice Line."                                                                                                                             
#>  [68] "\t\t\\choice Circle."                                                                                                                           
#>  [69] "\t\t\\choice Hyperbola."                                                                                                                        
#>  [70] "\t\t\\CorrectChoice Parabola."                                                                                                                  
#>  [71] "\t\\end{choices}"                                                                                                                               
#>  [72] "\t\\question The derivative of a function at a point $x = a$ tells us \\ldots"                                                                  
#>  [73] ""                                                                                                                                               
#>  [74] "\t\\begin{choices}"                                                                                                                             
#>  [75] "\t\t\\choice The limit of the function"                                                                                                         
#>  [76] "\t\t\\choice The integral of the function."                                                                                                     
#>  [77] "\t\t\\choice The average rate of change."                                                                                                       
#>  [78] "\t\t\\CorrectChoice The slope of a tangent line of the graph at $x = a$."                                                                       
#>  [79] "\t\\end{choices}"                                                                                                                               
#>  [80] ""                                                                                                                                               
#>  [81] "\\end{questions}"                                                                                                                               
#>  [82] ""                                                                                                                                               
#>  [83] "\\begin{questions}"                                                                                                                             
#>  [84] ""                                                                                                                                               
#>  [85] "\\section{Easy}"                                                                                                                                
#>  [86] "\t\\question If $y=\\cos5x$ find $\\dv{y}{x}$."                                                                                                 
#>  [87] ""                                                                                                                                               
#>  [88] "\t\\begin{choices}"                                                                                                                             
#>  [89] "\t\t\\choice $\\dv{y}{x} = 5\\cos5x$."                                                                                                          
#>  [90] "\t\t\\choice $\\dv{y}{x} = -2\\sin5x$."                                                                                                         
#>  [91] "\t\t\\choice $\\dv{y}{x} = 5\\cos2x$."                                                                                                          
#>  [92] "\t\t\\CorrectChoice $\\dv{y}{x} = -5\\sin5x$."                                                                                                  
#>  [93] "\t\\end{choices}"                                                                                                                               
#>  [94] "\t\\question Given $y=2x^2-3x+5$, What is $\\dv[2]{y}{x}$"                                                                                      
#>  [95] ""                                                                                                                                               
#>  [96] "\t\\begin{choices}"                                                                                                                             
#>  [97] "\t\t\\choice $\\dv[2]{y}{x}=4x-3$"                                                                                                              
#>  [98] "\t\t\\choice $\\dv[2]{y}{x}=16x-12$"                                                                                                            
#>  [99] "\t\t\\choice $\\dv[2]{y}{x}=0$"                                                                                                                 
#> [100] "\t\t\\CorrectChoice $\\dv[2]{y}{x}=4$"                                                                                                          
#> [101] "\t\\end{choices}"                                                                                                                               
#> [102] "\t\\question What is the derivative of $y=\\sin (2x + 5)$"                                                                                      
#> [103] ""                                                                                                                                               
#> [104] "\t\\begin{choices}"                                                                                                                             
#> [105] "\t\t\\choice $ \\cos(2x+5)$"                                                                                                                    
#> [106] "\t\t\\CorrectChoice $ 2\\cos(2x+5)$"                                                                                                            
#> [107] "\t\t\\choice $ 2\\cos(2x)+5$"                                                                                                                   
#> [108] "\t\t\\choice $ -2\\cos(2x-5)$"                                                                                                                  
#> [109] "\t\\end{choices}"                                                                                                                               
#> [110] ""                                                                                                                                               
#> [111] ""                                                                                                                                               
#> [112] "\t\\question If the functions $f(x)$ and $g(x)$ are continuous everywhere then, what can we say about the function $h(x) = \\frac{f(x)}{g(x)}$:"
#> [113] ""                                                                                                                                               
#> [114] "\t\\begin{choices}"                                                                                                                             
#> [115] "\t\t\\CorrectChoice $\\frac{f(x)}{g(x)}$ is also continuous everywhere except at the zeros of $g(x)$."                                          
#> [116] "\t\t\\choice $h(x) = \\frac{f(x)}{g(x)}$ is also continuous everywhere."                                                                        
#> [117] "\t\t\\choice $h(x)$ will never cross the x axis."                                                                                               
#> [118] "\t\t\\choice More information is needed to answer this question."                                                                               
#> [119] "\t\\end{choices}"                                                                                                                               
#> [120] ""                                                                                                                                               
#> [121] ""                                                                                                                                               
#> [122] "\t\\question Find the value of $\\lim_{x\\to 2}\\frac{x-1}{x^2-x-1}$"                                                                           
#> [123] ""                                                                                                                                               
#> [124] "\t\\begin{choices}"                                                                                                                             
#> [125] "\t\t\\choice $0$."                                                                                                                              
#> [126] "\t\t\\CorrectChoice $1$."                                                                                                                       
#> [127] "\t\t\\choice $\\infty$."                                                                                                                        
#> [128] "\t\t\\choice Not possible."                                                                                                                     
#> [129] "\t\\end{choices}"                                                                                                                               
#> [130] ""                                                                                                                                               
#> [131] "\t\\question What is the derivative of $f(x)= 3x^4+2x^3-3x-2$"                                                                                  
#> [132] "\t\\begin{choices}"                                                                                                                             
#> [133] "\t\t\\choice $f'(x)= 3x^7+2x^6-3x^3-2$."                                                                                                        
#> [134] "\t\t\\choice $f'(x)= 12x^3+6x^2-5$."                                                                                                            
#> [135] "\t\t\\choice $f'(x)= 7x^4+5x^3-4x-2$."                                                                                                          
#> [136] "\t\t\\CorrectChoice $f'(x)= 12x^3+6x^2-3$."                                                                                                     
#> [137] "\t\\end{choices}"                                                                                                                               
#> [138] "\t\\question What is the derivative of $(x^{2} + 3)(5 x + 2)$ ?"                                                                                
#> [139] ""                                                                                                                                               
#> [140] "\t\\begin{choices}"                                                                                                                             
#> [141] "\t\t\\choice $15 x^{2} + 19 x$"                                                                                                                 
#> [142] "\t\t\\choice $50 x^{2} + 60 x$"                                                                                                                 
#> [143] "\t\t\\choice $2 x + 5$"                                                                                                                         
#> [144] "\t\t\\CorrectChoice $15 x^{2} + 4 x + 15$"                                                                                                      
#> [145] "\t\\end{choices}"                                                                                                                               
#> [146] "\t\\question When $f'(x) = 0$ what happens?"                                                                                                    
#> [147] ""                                                                                                                                               
#> [148] "\t\\begin{choices}"                                                                                                                             
#> [149] "\t\t\\choice $f''(x) = 1$"                                                                                                                      
#> [150] "\t\t\\choice $f''(x) = 0 $"                                                                                                                     
#> [151] "\t\t\\CorrectChoice The point is a critical  point"                                                                                             
#> [152] "\t\t\\choice Local maximum or minimum or an inflection point."                                                                                  
#> [153] "\t\\end{choices}"                                                                                                                               
#> [154] "\t\\question What is the derivative of $f(x) = (2x+8)^2$"                                                                                       
#> [155] ""                                                                                                                                               
#> [156] "\t\\begin{choices}"                                                                                                                             
#> [157] "\t\t\\choice $32$"                                                                                                                              
#> [158] "\t\t\\choice $3x+32$"                                                                                                                           
#> [159] "\t\t\\choice $4x+32$"                                                                                                                           
#> [160] "\t\t\\CorrectChoice $8x+32$"                                                                                                                    
#> [161] "\t\\end{choices}"                                                                                                                               
#> [162] ""                                                                                                                                               
#> [163] "\t\\question If $f(x) =\\sqrt{x^3 - 4x}$, calculate when $f(x)=0 $"                                                                             
#> [164] ""                                                                                                                                               
#> [165] "\t\\begin{choices}"                                                                                                                             
#> [166] "\t\t\\choice $x = 0,\\,1,\\,{-1}$"                                                                                                              
#> [167] "\t\t\\choice $x= 0, $"                                                                                                                          
#> [168] "\t\t\\choice $x= 0,\\,2 $"                                                                                                                      
#> [169] "\t\t\\CorrectChoice$ x= 0,\\,2,\\,{-2} $"                                                                                                       
#> [170] "\t\\end{choices}"                                                                                                                               
#> [171] "\t\\question Given $f(x) = \\frac{x^3-4}{2x+2}$, then $\\lim_{x\\to 4} f(x) = \\ldots$"                                                         
#> [172] ""                                                                                                                                               
#> [173] "\t\\begin{choices}"                                                                                                                             
#> [174] "\t\t\\choice $\\ldots3.$"                                                                                                                       
#> [175] "\t\t\\choice $\\ldots4.$"                                                                                                                       
#> [176] "\t\t\\choice $\\ldots5.$"                                                                                                                       
#> [177] "\t\t\\CorrectChoice $\\ldots6.$"                                                                                                                
#> [178] "\t\\end{choices}"                                                                                                                               
#> [179] "\t\\question  Suppose $f(x) = x^2 + 3$  and $g(x) = x - 2$. Which of the following is  $(f-g)(x)$?"                                             
#> [180] ""                                                                                                                                               
#> [181] "\t\\begin{choices}"                                                                                                                             
#> [182] "\t\t\\choice  $(f-g)(x)=x^2 - x +1$"                                                                                                            
#> [183] "     \t\\choice  $(f-g)(x)=x^3 + 2x^2 + 3x -2$"                                                                                                 
#> [184] "\t\t\\choice  $(f-g)(x)=x^2 - 4x + 7$"                                                                                                          
#> [185] "\t\t\\CorrectChoice   $(f-g)(x)=x^2 - x + 5$"                                                                                                   
#> [186] "\t\\end{choices}"                                                                                                                               
#> [187] ""                                                                                                                                               
#> [188] "\t\\question Given the functions $f(x) = x^4+3$ and $g(x) = \\sqrt{x}$, find the value of $(f\\circ g)'(x)\\ldots$"                             
#> [189] ""                                                                                                                                               
#> [190] "\t\\begin{choices}"                                                                                                                             
#> [191] "\t\t\\choice $(f\\circ g)'(x) = x$"                                                                                                             
#> [192] "\t\t\\CorrectChoice $(f\\circ g)'(x) = 2x$"                                                                                                     
#> [193] "\t\t\\choice $(f\\circ g)'(x) = 3x$"                                                                                                            
#> [194] "\t\t\\choice $(f\\circ g)'(x) = 4x$"                                                                                                            
#> [195] "\t\\end{choices}"                                                                                                                               
#> [196] "\t\\question Which one is the correct form of the product rule?"                                                                                
#> [197] ""                                                                                                                                               
#> [198] "\t\\begin{choices}"                                                                                                                             
#> [199] "\t\t\\choice $(f(x)\\cdot g(x))' = f'(x)g'(x)+f'(x)g'(x)$"                                                                                      
#> [200] "\t\t\\choice $(f(x)\\cdot g(x))' = f'(x)g'(x)+f(x)g(x)$"                                                                                        
#> [201] "\t\t\\choice $(f(x)\\cdot g(x))' = f(x)g'(x)+f(x)g'(x)$"                                                                                        
#> [202] "\t\t\\CorrectChoice $(f(x)\\cdot g(x))' = f'(x)g(x) + f(x)g'(x)$"                                                                               
#> [203] "\t\\end{choices}"                                                                                                                               
#> [204] ""                                                                                                                                               
#> [205] "\t\\question What is the derivative of $f(x) = \\sqrt{4x+5}$"                                                                                   
#> [206] ""                                                                                                                                               
#> [207] "\t\\begin{choices}"                                                                                                                             
#> [208] "\t\t\\choice $2\\sqrt{x+5}$."                                                                                                                   
#> [209] "\t\t\\choice $8$."                                                                                                                              
#> [210] "\t\t\\choice $\\frac{\\sqrt{4x+5}}{2}$."                                                                                                        
#> [211] "\t\t\\CorrectChoice $\\frac{2}{\\sqrt{4x+5}}$."                                                                                                 
#> [212] "\t\\end{choices}"                                                                                                                               
#> [213] "\t\\question Calculate the derivative of $f(x) = 2x^2+3$"                                                                                       
#> [214] ""                                                                                                                                               
#> [215] "\t\\begin{choices}"                                                                                                                             
#> [216] "\t\t\\CorrectChoice $f'(x) = 4x$"                                                                                                               
#> [217] "\t\t\\choice $f'(x) = 2x$"                                                                                                                      
#> [218] "\t\t\\choice $f'(x) = 5x$"                                                                                                                      
#> [219] "\t\t\\choice $f'(x) = 6x$"                                                                                                                      
#> [220] "\t\\end{choices}"                                                                                                                               
#> [221] "\t\\question Calculate the derivative  of $y=\\sin(3x{^2}+1)$"                                                                                  
#> [222] ""                                                                                                                                               
#> [223] "\t\\begin{choices}"                                                                                                                             
#> [224] "\t\t\\choice $\\dv{y}{x} = \\sin(3x{^2}+1)$"                                                                                                    
#> [225] "\t\t\\choice $\\dv{y}{x} = \\cos(3x{^2}+1)$"                                                                                                    
#> [226] "        \\choice $\\dv{y}{x} = 6x\\sin(3x{^2}+1)$"                                                                                              
#> [227] "\t\t\\CorrectChoice $\\dv{y}{x} = 6x \\cos(3x{^2}+1)$"                                                                                          
#> [228] "\t\\end{choices}"                                                                                                                               
#> [229] "\t\\question Find the derivative of $f(x) = \\sqrt[6]{4x+4}$"                                                                                   
#> [230] ""                                                                                                                                               
#> [231] "\t\\begin{choices}"                                                                                                                             
#> [232] "\t\t\\choice $f'(x) = 4 (4x+4)^{-1/3} $"                                                                                                        
#> [233] "\t\t\\choice $f'(x) = \\frac{4x }{6 \\sqrt[3]{4x+4}}$"                                                                                          
#> [234] "\t\t\\choice $f'(x) = \\frac{4 x + 4}{6 \\sqrt[6]{(4x + 4)^{5}}} $"                                                                             
#> [235] "\t\t\\CorrectChoice $f'(x) = \\frac{4}{6 \\sqrt[6]{(4x + 4)^{5}}}$"                                                                             
#> [236] "\t\\end{choices}"                                                                                                                               
#> [237] ""                                                                                                                                               
#> [238] "\\end{questions}"                                                                                                                               
#> [239] ""                                                                                                                                               
#> [240] ""                                                                                                                                               
#> [241] ""                                                                                                                                               
#> [242] ""                                                                                                                                               
#> [243] "\\begin{questions}"                                                                                                                             
#> [244] ""                                                                                                                                               
#> [245] "\\section{Medium}"                                                                                                                              
#> [246] "\t\\question What is the derivative of f(x)=$(1-6x^2)^4$"                                                                                       
#> [247] "\t\\begin{choices}"                                                                                                                             
#> [248] "\t\t\\choice $4(1-6x^2)^3$"                                                                                                                     
#> [249] "\t\t\\choice $4x(1-6x^2)^3$"                                                                                                                    
#> [250] "\t\t\\choice $48x(1-6x^2)^3$"                                                                                                                   
#> [251] "\t\t\\CorrectChoice $-48x(1-6x^2)^3 y$"                                                                                                         
#> [252] "\t\\end{choices}"                                                                                                                               
#> [253] ""                                                                                                                                               
#> [254] "\t\\question Find the slope of the tangent line of the curve $y = \\frac{1}{x}$ at the point $(3,\\frac13)$"                                    
#> [255] ""                                                                                                                                               
#> [256] "\t\\begin{choices}"                                                                                                                             
#> [257] "\t\t\\choice $\\frac{1}{3}$"                                                                                                                    
#> [258] "\t\t\\choice $\\frac{-1}{3}$"                                                                                                                   
#> [259] "\t\t\\choice $\\frac{1}{9}$"                                                                                                                    
#> [260] "\t\t\\CorrectChoice $\\frac{-1}{9}$"                                                                                                            
#> [261] "\t\\end{choices}"                                                                                                                               
#> [262] ""                                                                                                                                               
#> [263] "\t\\question Calculate the following limit: $\\lim_{x \\to -2} = \\frac{x^3+8}{x+2}\\ $"                                                        
#> [264] ""                                                                                                                                               
#> [265] "\t\\begin{choices}"                                                                                                                             
#> [266] "\t\t\\choice $\\infty$."                                                                                                                        
#> [267] "\t\t\\choice $4$."                                                                                                                              
#> [268] "\t\t\\choice $1$."                                                                                                                              
#> [269] "\t\t\\CorrectChoice $12$."                                                                                                                      
#> [270] "\t\\end{choices}"                                                                                                                               
#> [271] "\t\\question  Is this function continuous or discontinuous? $f(x) = \\frac{x+8}{x-4}$"                                                          
#> [272] ""                                                                                                                                               
#> [273] "\t\\begin{choices}"                                                                                                                             
#> [274] "\t\t\\choice  Continuous."                                                                                                                      
#> [275] "\t\t\\choice Discontinuous, contains a removable discontinuities."                                                                              
#> [276] "\t\t\\choice No other answer is correct."                                                                                                       
#> [277] "\t\t\\CorrectChoice Discontinuous, contains a jump discontinuities."                                                                            
#> [278] "\t\\end{choices}"                                                                                                                               
#> [279] ""                                                                                                                                               
#> [280] "\t\\question $\\displaystyle \\lim_{x\\to 4}{x^{2} + 2 x - 4}$ ?"                                                                               
#> [281] ""                                                                                                                                               
#> [282] "\t\\begin{choices}"                                                                                                                             
#> [283] "\t\t\\choice 14"                                                                                                                                
#> [284] "\t\t\\choice 16"                                                                                                                                
#> [285] "\t\t\\choice 18"                                                                                                                                
#> [286] "\t\t\\CorrectChoice 20"                                                                                                                         
#> [287] "\t\\end{choices}"                                                                                                                               
#> [288] ""                                                                                                                                               
#> [289] "\t\\question What is the name of the functions $\\frac1{\\cos x}$ ?"                                                                            
#> [290] "\t\\begin{choices}"                                                                                                                             
#> [291] "\t\t\\choice $\\csc x$"                                                                                                                         
#> [292] "\t\t\\choice $\\cot x$"                                                                                                                         
#> [293] "\t\t\\choice $\\tan x$"                                                                                                                         
#> [294] "\t\t\\CorrectChoice $\\sec x$"                                                                                                                  
#> [295] "\t\\end{choices}"                                                                                                                               
#> [296] ""                                                                                                                                               
#> [297] "\t\\question Find the value of $\\displaystyle \\lim_{x \\to 6} \\frac{x^2 -36}{x^3 -216}$"                                                     
#> [298] ""                                                                                                                                               
#> [299] "\t\\begin{choices}"                                                                                                                             
#> [300] "\t\t\\choice $\\frac{1}{6}$"                                                                                                                    
#> [301] "\t\t\\CorrectChoice $\\frac{1}{9}$"                                                                                                             
#> [302] "\t\t\\choice $\\frac{1}{12}$"                                                                                                                   
#> [303] "\t\t\\choice $\\frac{1}{15}$"                                                                                                                   
#> [304] "\t\\end{choices}"                                                                                                                               
#> [305] "\t\\question What is the function $f$ whose derivative is $f'(x)=x^5 +30$"                                                                      
#> [306] ""                                                                                                                                               
#> [307] "    \\begin{choices}"                                                                                                                           
#> [308] "\t\t\\choice $f(x) = 5x^4 +30x$"                                                                                                                
#> [309] "\t\t\\choice $f(x) = 5x^4$"                                                                                                                     
#> [310] "\t\t\\choice $f(x) = x^6 +30x$"                                                                                                                 
#> [311] "\t\t\\CorrectChoice $f(x) = \\frac{x^6}{6} +30x$"                                                                                               
#> [312] "\t\\end{choices}"                                                                                                                               
#> [313] "\t\\question Find the derivative of $f(x) = \\frac{x-1}{x+1}$"                                                                                  
#> [314] ""                                                                                                                                               
#> [315] "\t\\begin{choices}"                                                                                                                             
#> [316] "\t\t\\choice $f'(x) = \\frac{-2}{(x+1)^2}$"                                                                                                     
#> [317] "\t\t\\choice $f'(x) = \\frac{2}{(x-1)^2}$"                                                                                                      
#> [318] "\t\t\\choice $f'(x) = \\frac{-2}{(x-1)^2}$"                                                                                                     
#> [319] "\t\t\\CorrectChoice $f'(x) = \\frac{2}{(x+1)^2}$"                                                                                               
#> [320] "\t\\end{choices}"                                                                                                                               
#> [321] ""                                                                                                                                               
#> [322] "\\end{questions}"                                                                                                                               
#> [323] ""                                                                                                                                               
#> [324] ""                                                                                                                                               
#> [325] ""                                                                                                                                               
#> [326] ""                                                                                                                                               
#> [327] "\\begin{questions}"                                                                                                                             
#> [328] ""                                                                                                                                               
#> [329] "\\section{Hard}"                                                                                                                                
#> [330] "\t\\question  Calculate $\\lim_{x\\to 1}\\frac{\\sin (2x^2-2)}{x^2-1}$. (Hint: L'H\\^opital rule)"                                              
#> [331] ""                                                                                                                                               
#> [332] "\t\\begin{choices}"                                                                                                                             
#> [333] "\t\t\\choice   $1$"                                                                                                                             
#> [334] "\t\t\\choice  $-1$"                                                                                                                             
#> [335] "\t\t\\choice  The limit does not exist."                                                                                                        
#> [336] "\t\t\\CorrectChoice  $2$"                                                                                                                       
#> [337] "\t\\end{choices}"                                                                                                                               
#> [338] "\t\\question What is the local minimum of $x^3-2x^2$ in the range where $-1<x<1$?"                                                              
#> [339] ""                                                                                                                                               
#> [340] "\t\\begin{choices}"                                                                                                                             
#> [341] "\t\t\\choice  $x=0$"                                                                                                                            
#> [342] "\t\t\\choice  $x=-1$"                                                                                                                           
#> [343] "\t\t\\choice There is no local minimum in that range."                                                                                          
#> [344] "\t\t\\CorrectChoice  $x=\\frac43$"                                                                                                              
#> [345] "\t\\end{choices}"                                                                                                                               
#> [346] "\t\\question What is the derivative of $f(x) = 2x \\sin x + 2 \\cos x - x^{2}\\cos x.$"                                                         
#> [347] ""                                                                                                                                               
#> [348] "\t\\begin{choices}"                                                                                                                             
#> [349] "\t\t\\choice $f'(x) = x^{2} \\sin x + 2 x \\cos x -2\\sin x$."                                                                                  
#> [350] "\t\t\\choice $f'(x) = x^{2}\\cos x$."                                                                                                           
#> [351] "\t\t\\choice $f'(x) = 2x\\cos x$."                                                                                                              
#> [352] "\t\t\\CorrectChoice $f'(x) = x^{2}\\sin x$."                                                                                                    
#> [353] "\t\\end{choices}"                                                                                                                               
#> [354] ""                                                                                                                                               
#> [355] "\t\\question What is value of the $\\displaystyle \\lim_{h \\to 0} \\frac{f(x+h) -f(x)}{h}$ tells about the function?"                          
#> [356] ""                                                                                                                                               
#> [357] "\t\\begin{choices}"                                                                                                                             
#> [358] "\t\t\\choice\\label{choice:der1} The Slope of the graph."                                                                                       
#> [359] "\t\t\\choice\\label{choice:der2} The critical point of the function , when the value of the limit is 0."                                        
#> [360] "\t\t\\CorrectChoice Both options, \\ref{choice:der1} and \\ref{choice:der2}, are correct."                                                      
#> [361] "\t\t\\choice None of the above."                                                                                                                
#> [362] "\t\\end{choices}"                                                                                                                               
#> [363] ""                                                                                                                                               
#> [364] "\t\\question What is the derivative of $f(x) = \\arctan(2x)$ ?"                                                                                 
#> [365] ""                                                                                                                                               
#> [366] "\t\\begin{choices}"                                                                                                                             
#> [367] "\t\t\\choice $\\frac{2}{1 + x^{2}}$"                                                                                                            
#> [368] "\t\t\\choice $\\frac{2}{2 + x^{2}}$"                                                                                                            
#> [369] "\t\t\\choice $\\frac{2}{2 + 4x^{2}}$"                                                                                                           
#> [370] "\t\t\\CorrectChoice $\\frac{2}{1 + 4x^{2}}$"                                                                                                    
#> [371] "\t\\end{choices}"                                                                                                                               
#> [372] "\t\\question Find the derivatives of f(x) = $\\sin^6(x^4)$"                                                                                     
#> [373] ""                                                                                                                                               
#> [374] "\t\\begin{choices}"                                                                                                                             
#> [375] "\t\t\\choice $6\\sin^{5}(x^4)$"                                                                                                                 
#> [376] "\t\t\\choice $24 x^{3}\\sin(x^3) \\sin(x^4)$"                                                                                                   
#> [377] "\t\t\\choice $24\\sin(x^4)  \\cos(x^3)$"                                                                                                        
#> [378] "\t\t\\CorrectChoice $24 x^{3} \\sin^{5}(x^4)  \\cos(x^4) $"                                                                                     
#> [379] "\t\\end{choices}"                                                                                                                               
#> [380] "\t\\question Find the derivative of $f(x)$ = $\\sqrt{x^2+3x}$."                                                                                 
#> [381] ""                                                                                                                                               
#> [382] "\t\\begin{choices}"                                                                                                                             
#> [383] "\t\t\\choice $f'(x) = \\frac{1}{2}\\sqrt{2x+3}$."                                                                                               
#> [384] "\t\t\\choice $f'(x) = \\frac{1}{x^2+3x}(2x+3)$."                                                                                                
#> [385] "\t\t\\choice $f'(x) = \\frac{-1}{2 \\sqrt{2x + 3}}$."                                                                                           
#> [386] "\t\t\\CorrectChoice $f'(x) = \\frac{2x + 3}{2 \\sqrt{2x + 3}}$."                                                                                
#> [387] "\t\\end{choices}"                                                                                                                               
#> [388] ""                                                                                                                                               
#> [389] ""                                                                                                                                               
#> [390] "\\end{questions}"                                                                                                                               
#> [391] ""                                                                                                                                               
#> [392] ""                                                                                                                                               
#> [393] "\\begin{questions}"                                                                                                                             
#> [394] "\\section{Graphic problems}"                                                                                                                    
#> [395] "\t\\question"                                                                                                                                   
#> [396] "\tFrom the following graph find $\\lim_{x \\to -2 } f(x)$"                                                                                      
#> [397] "\t\\par\\nopagebreak"                                                                                                                           
#> [398] "\t\\includegraphics[width = 6cm]{limgraph.jpg}"                                                                                                 
#> [399] ""                                                                                                                                               
#> [400] "\t\\begin{choices}"                                                                                                                             
#> [401] "\t\t\\choice $0$."                                                                                                                              
#> [402] "\t\t\\choice $5$."                                                                                                                              
#> [403] "\t\t\\choice $4$."                                                                                                                              
#> [404] "\t\t\\CorrectChoice undefined."                                                                                                                 
#> [405] "\t\\end{choices}"                                                                                                                               
#> [406] ""                                                                                                                                               
#> [407] "\\end{questions}"                                                                                                                               
#> [408] ""                                                                                                                                               
#> [409] ""                                                                                                                                               
#> [410] "\\begin{questions}"                                                                                                                             
#> [411] "\\section{Bonus, integration}"                                                                                                                  
#> [412] "\t\\question Find the area of the graph between f(x) = $x^4$ and f(x) = $(x-6)^4$"                                                              
#> [413] ""                                                                                                                                               
#> [414] "\t\\begin{choices}"                                                                                                                             
#> [415] "\t\t\\choice $\\frac{243}{5}$"                                                                                                                  
#> [416] "\t\t\\choice $\\frac{243}{10}$"                                                                                                                 
#> [417] "\t\t\\choice $\\frac{486}{10}$"                                                                                                                 
#> [418] "\t\t\\CorrectChoice $\\frac{486}{5}$"                                                                                                           
#> [419] "\t\\end{choices}"                                                                                                                               
#> [420] "\t\\question Find the integral of $ 4x^3+3x^2 $"                                                                                                
#> [421] ""                                                                                                                                               
#> [422] "\t\\begin{choices}"                                                                                                                             
#> [423] "\t\t\\choice $12x^2 + 6x$"                                                                                                                      
#> [424] "\t\t\\choice $4x^2 + 3x$"                                                                                                                       
#> [425] "\t\t\\choice $4x^4 + 3x^3 + c$"                                                                                                                 
#> [426] "\t\t\\CorrectChoice $x^4 + x^3 +c$"                                                                                                             
#> [427] "\t\\end{choices}"                                                                                                                               
#> [428] "\t\\question What is the area under the graph $y = x^3$, the line $y = 0$ and the lines $x=0$ and $x=2$?"                                       
#> [429] ""                                                                                                                                               
#> [430] "\t\\begin{choices}"                                                                                                                             
#> [431] "\t\t\\choice 8"                                                                                                                                 
#> [432] "\t\t\\choice 16"                                                                                                                                
#> [433] "\t\t\\choice 24"                                                                                                                                
#> [434] "\t\t\\CorrectChoice 4"                                                                                                                          
#> [435] "\t\\end{choices}"                                                                                                                               
#> [436] "\t\\question Which of these processes are used to calculate the area under a curve?"                                                            
#> [437] "\t\\begin{choices}"                                                                                                                             
#> [438] "\t\t\\choice First derivative"                                                                                                                  
#> [439] "\t\t\\choice Product rule"                                                                                                                      
#> [440] "\t\t\\choice Second derivative"                                                                                                                 
#> [441] "\t\t\\CorrectChoice Integral"                                                                                                                   
#> [442] "\t\\end{choices}"                                                                                                                               
#> [443] ""                                                                                                                                               
#> [444] ""                                                                                                                                               
#> [445] ""                                                                                                                                               
#> [446] ""                                                                                                                                               
#> [447] "\\end{questions}"                                                                                                                               
#> [448] ""                                                                                                                                               
#> [449] "\\end{document}"                                                                                                                                
#>