tests/testthat/_snaps/utils_chunk.md

check get_chunk_range works correctly

  starts ends
1      8   10
2     18   20
3     24   26

get the correct extract_chunk

   language       name                     options starts ends index
1         r      setup             , include=FALSE      8   10     1
2         r       cars                                 18   20     2
3         r   pressure                , echo=FALSE     26   28     3
4         r       <NA> , echo=FALSE, warning=FALSE     32   34     4
5         r       <NA>                , echo=FALSE     36   38     5
6         r chunk_name                                 40   42     6
7       sql       <NA>                , eval=FALSE     44   46     7
8      <NA>       <NA>                 eval = TRUE     48   50     8
9      <NA>       <NA>                                 52   54     9
10     <NA>       <NA>                                 56   58    10
11        r       <NA>                                 62   64    11
                                                                                      chunk_text
1                           ```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```
2                                                                ```{r cars}\nsummary(cars)\n```
3                                              ```{r, pressure, echo=FALSE}\nplot(pressure)\n```
4  ```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```
5                        ```{r echo=FALSE}\n# R chunk with no name but options (not using,)\n```
6                 ```{r, chunk_name}\n# wrong R chunk with , and name is parsed as argument\n```
7                      ```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```
8                                                             ```{eval = TRUE}\nA void code\n```
9                                                                  ```{}\nAnother void code\n```
10                                                             ```\nStill another void code\n```
11                                      ``` {r}\na strange chuck header with space before {\n```
               name_tag
1       [[chunk-setup]]
2        [[chunk-cars]]
3    [[chunk-pressure]]
4           [[chunk-4]]
5           [[chunk-5]]
6  [[chunk-chunk-name]]
7           [[chunk-7]]
8           [[chunk-8]]
9           [[chunk-9]]
10         [[chunk-10]]
11         [[chunk-11]]
  language     name                   options starts ends index
1       NA    setup           , include=FALSE     19   21     1
2       NA     cars                               48   50     2
3       NA pressure              , echo=FALSE     56   58     3
4       NA     <NA> echo=FALSE, warning=FALSE     62   64     4
5       NA     <NA>                echo=FALSE     66   68     5
6       NA      sql              , eval=FALSE     71   73     6
7       NA     <NA>                               75   77     7
                                                                                   chunk_text
1                            <<setup, include=FALSE>>=\nknitr::opts_chunk$set(echo = TRUE)\n@
2                                                                 <<cars>>=\nsummary(cars)\n@
3                                                <<pressure, echo=FALSE>>=\nplot(pressure)\n@
4    <<echo=FALSE, warning=FALSE>>=\n# R chunk with no name but multiple options (using ,)\n@
5 <<echo=FALSE>>= # a really evil comment\n# R chunk with no name but options (not using,)\n@
6              <<sql, eval=FALSE>>=\n/*A  wrong sql chunk chunk with no name but options*/\n@
7                                                               <<>>=\n# A void code block\n@
            name_tag
1    [[chunk-setup]]
2     [[chunk-cars]]
3 [[chunk-pressure]]
4        [[chunk-4]]
5        [[chunk-5]]
6      [[chunk-sql]]
7        [[chunk-7]]
  language  name         options starts ends index
1        r setup , include=FALSE      8   10     1
2     bash  <NA>                     18   20     2
3     bash  <NA>                     24   26     3
                                                            chunk_text
1 ```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```
2                                                 ```bash\npwd #1\n```
3                                               ``` bash \npwd #2\n```
         name_tag
1 [[chunk-setup]]
2     [[chunk-2]]
3     [[chunk-3]]

get the correct extract_chunk with indendted chuncks

  language  name         options starts ends index
1        r setup , include=FALSE      8   10     1
2        r  cars                     15   17     2
3        r  <NA>                     19   21     3
4        r  <NA>                     26   28     4
5        r  <NA>                     30   32     5
6        r  <NA>                     34   36     6
7        r  <NA>                     39   41     7
                                                            chunk_text
1 ```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```
2                              ```{r cars}\n    summary(cars)\n    ```
3                                             ```{r}\n    3+3\n    ```
4                                      ```{r }\n  summary(cars)\n  ```
5                                   ```{r}\n    summary(cars)\n    ```
6                                     ```{r}\n    summary(cars)\n  ```
7                                             ```{r}\n    3+3\n    ```
         name_tag
1 [[chunk-setup]]
2  [[chunk-cars]]
3     [[chunk-3]]
4     [[chunk-4]]
5     [[chunk-5]]
6     [[chunk-6]]
7     [[chunk-7]]
  language name options starts ends index            chunk_text    name_tag
1       NA   NA              7    9     1     <<>>=\n3+4\n    @ [[chunk-1]]
2       NA   NA             13   15     2         <<>>=\n3+4\n@ [[chunk-2]]
3       NA   NA             20   22     3         <<>>=\n3+4\n@ [[chunk-3]]
4       NA   NA             24   26     4     <<>>=\n3+4\n    @ [[chunk-4]]
5       NA   NA             28   30     5       <<>>=\n3+4\n  @ [[chunk-5]]
6       NA   NA             33   35     6       <<>>=\n3+4\n  @ [[chunk-6]]
7       NA   NA             38   40     7     <<>>=\n3+4\n    @ [[chunk-7]]

get the correct extract_header

  starts ends
1      1    6
                                                                                        header_text
1 ---\ntitle: "Reviewdown Test"\nauthor: "reviewdown"\ndate: "2/3/2021"\noutput: html_document\n---
             name_tag
1 [[document-header]]
  starts ends
1      1   29
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          header_text
1 \n%----    Basic packages    ----%\n\\documentclass{article}  \n\\usepackage[T1] {fontenc} \t\t  % Font encoding\n\\usepackage [utf8] {inputenc}\t\t% Encoding for the document\n\\usepackage[a4paper,includeheadfoot,top=2.4cm, bottom=2cm, left=2.4cm, right=2.4cm]{geometry}  % margin settings\n\\usepackage[english]{babel}      \n\n\n%----    Other packages    ----%\n\\usepackage{tikz}       \n\\usepackage{graphicx}   % for including graphics\n\\usepackage{amsmath}    % for math equation\n\\usepackage{hyperref}    % ref between elements\n\n\n%%%%%%%%%%%%%%%%%%%%%%          Settings        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n<<setup, include=FALSE>>=\nknitr::opts_chunk$set(echo = TRUE)\n@\n\n\n\n% Document title info\n\\title{Reviewdown Test}\n\\author{reviewdown}\n% \\date{}\n\\begin{document}
             name_tag
1 [[document-header]]

get the correct hide_code

 [1] "[[document-header]]"                                                                                                                                                                                         
 [2] ""                                                                                                                                                                                                            
 [3] "[[chunk-setup]]"                                                                                                                                                                                             
 [4] ""                                                                                                                                                                                                            
 [5] "## R Markdown"                                                                                                                                                                                               
 [6] ""                                                                                                                                                                                                            
 [7] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."             
 [8] ""                                                                                                                                                                                                            
 [9] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"
[10] ""                                                                                                                                                                                                            
[11] "[[chunk-cars]]"                                                                                                                                                                                              
[12] ""                                                                                                                                                                                                            
[13] "## Including Plots"                                                                                                                                                                                          
[14] ""                                                                                                                                                                                                            
[15] "You can also embed plots, for example:"                                                                                                                                                                      
[16] ""                                                                                                                                                                                                            
[17] "[[chunk-pressure]]"                                                                                                                                                                                          
[18] ""                                                                                                                                                                                                            
[19] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                               
[20] ""                                                                                                                                                                                                            
[21] "[[chunk-4]]"                                                                                                                                                                                                 
[22] ""                                                                                                                                                                                                            
[23] "[[chunk-5]]"                                                                                                                                                                                                 
[24] ""                                                                                                                                                                                                            
[25] "[[chunk-chunk-name]]"                                                                                                                                                                                        
[26] ""                                                                                                                                                                                                            
[27] "[[chunk-7]]"                                                                                                                                                                                                 
[28] ""                                                                                                                                                                                                            
[29] "[[chunk-8]]"                                                                                                                                                                                                 
[30] ""                                                                                                                                                                                                            
[31] "[[chunk-9]]"                                                                                                                                                                                                 
[32] ""                                                                                                                                                                                                            
[33] "[[chunk-10]]"                                                                                                                                                                                                
[34] ""                                                                                                                                                                                                            
[35] "```a really strange inline block ```"                                                                                                                                                                        
[36] ""                                                                                                                                                                                                            
[37] "[[chunk-11]]"                                                                                                                                                                                                
[38] ""                                                                                                                                                                                                            
[39] "End of the document"
 [1] "<!-- A child document -->"                                                                                                                                                                      
 [2] ""                                                                                                                                                                                               
 [3] "## R Markdown"                                                                                                                                                                                  
 [4] ""                                                                                                                                                                                               
 [5] "---"                                                                                                                                                                                            
 [6] ""                                                                                                                                                                                               
 [7] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."
 [8] ""                                                                                                                                                                                               
 [9] "---"                                                                                                                                                                                            
[10] ""                                                                                                                                                                                               
[11] "[[chunk-cars]]"                                                                                                                                                                                 
[12] ""                                                                                                                                                                                               
[13] "## Including Plots"                                                                                                                                                                             
[14] ""                                                                                                                                                                                               
[15] "You can also embed plots, for example:"                                                                                                                                                         
[16] ""                                                                                                                                                                                               
[17] "[[chunk-pressure]]"
[1] "[[document-header]]"                                                                                                                                                                            
[2] ""                                                                                                                                                                                               
[3] "## R Markdown"                                                                                                                                                                                  
[4] ""                                                                                                                                                                                               
[5] "---"                                                                                                                                                                                            
[6] ""                                                                                                                                                                                               
[7] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."
[8] ""                                                                                                                                                                                               
[9] "---"
[1] "<!-- A child document -->"                                                                                                                                                                      
[2] ""                                                                                                                                                                                               
[3] "## R Markdown"                                                                                                                                                                                  
[4] ""                                                                                                                                                                                               
[5] "---"                                                                                                                                                                                            
[6] ""                                                                                                                                                                                               
[7] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."
[8] ""                                                                                                                                                                                               
[9] "---"
 [1] "[[document-header]]"                                                                                                                                                                                         
 [2] ""                                                                                                                                                                                                            
 [3] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                        
 [4] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         Title           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                        
 [5] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                        
 [6] ""                                                                                                                                                                                                            
 [7] "\\maketitle"                                                                                                                                                                                                 
 [8] ""                                                                                                                                                                                                            
 [9] "%----------------------------------------------------------------------------------%"                                                                                                                        
[10] "%--------------------------         Introduction         --------------------------%"                                                                                                                        
[11] "%----------------------------------------------------------------------------------%"                                                                                                                        
[12] ""                                                                                                                                                                                                            
[13] ""                                                                                                                                                                                                            
[14] "\\section{R and \\LaTeX}"                                                                                                                                                                                    
[15] ""                                                                                                                                                                                                            
[16] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."                 
[17] ""                                                                                                                                                                                                            
[18] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"
[19] ""                                                                                                                                                                                                            
[20] "[[chunk-cars]]"                                                                                                                                                                                              
[21] ""                                                                                                                                                                                                            
[22] "\\section{Including Plots}"                                                                                                                                                                                  
[23] ""                                                                                                                                                                                                            
[24] "You can also embed plots, for example:"                                                                                                                                                                      
[25] ""                                                                                                                                                                                                            
[26] "[[chunk-pressure]]"                                                                                                                                                                                          
[27] ""                                                                                                                                                                                                            
[28] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                               
[29] ""                                                                                                                                                                                                            
[30] "[[chunk-3]]"                                                                                                                                                                                                 
[31] ""                                                                                                                                                                                                            
[32] "[[chunk-4]]"                                                                                                                                                                                                 
[33] ""                                                                                                                                                                                                            
[34] ""                                                                                                                                                                                                            
[35] "[[chunk-sql]]"                                                                                                                                                                                               
[36] ""                                                                                                                                                                                                            
[37] "[[chunk-6]]"                                                                                                                                                                                                 
[38] ""                                                                                                                                                                                                            
[39] "End of the document"                                                                                                                                                                                         
[40] ""                                                                                                                                                                                                            
[41] "\\end{document}"
 [1] "% A child document"                                                                                                                                                                         
 [2] ""                                                                                                                                                                                           
 [3] "\\section{R and \\LaTeX}"                                                                                                                                                                   
 [4] ""                                                                                                                                                                                           
 [5] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."
 [6] ""                                                                                                                                                                                           
 [7] "[[chunk-cars]]"                                                                                                                                                                             
 [8] ""                                                                                                                                                                                           
 [9] "\\section{Including Plots}"                                                                                                                                                                 
[10] ""                                                                                                                                                                                           
[11] "You can also embed plots, for example:"                                                                                                                                                     
[12] ""                                                                                                                                                                                           
[13] "[[chunk-pressure]]"
[1] "[[document-header]]"                                                                                                                                                                        
[2] ""                                                                                                                                                                                           
[3] "\\section{R and \\LaTeX}"                                                                                                                                                                   
[4] ""                                                                                                                                                                                           
[5] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."
[6] ""                                                                                                                                                                                           
[7] "\\end{document}"
[1] "% A child document"                                                                                                                                                                         
[2] ""                                                                                                                                                                                           
[3] "\\section{R and \\LaTeX}"                                                                                                                                                                   
[4] ""                                                                                                                                                                                           
[5] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."

check restore_chunk works properly

 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                                  
 [2] "This is not a common Document. The Document includes properly formatted Markdown syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                         
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                        
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                               
 [6] "FILE-NAME: example-1.Rmd"                                                                                                                                                                                                                          
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                   
 [8] "#----End Instructions----#"                                                                                                                                                                                                                        
 [9] "[[document-header]]"                                                                                                                                                                                                                               
[10] ""                                                                                                                                                                                                                                                  
[11] "```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```"                                                                                                                                                                              
[12] ""                                                                                                                                                                                                                                                  
[13] "## R Markdown"                                                                                                                                                                                                                                     
[14] ""                                                                                                                                                                                                                                                  
[15] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."                                                   
[16] ""                                                                                                                                                                                                                                                  
[17] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                      
[18] ""                                                                                                                                                                                                                                                  
[19] "```{r cars}\nsummary(cars)\n```"                                                                                                                                                                                                                   
[20] ""                                                                                                                                                                                                                                                  
[21] "## Including Plots"                                                                                                                                                                                                                                
[22] ""                                                                                                                                                                                                                                                  
[23] "You can also embed plots, for example:"                                                                                                                                                                                                            
[24] ""                                                                                                                                                                                                                                                  
[25] "```{r, pressure, echo=FALSE}\nplot(pressure)\n```"                                                                                                                                                                                                 
[26] ""                                                                                                                                                                                                                                                  
[27] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                     
[28] ""                                                                                                                                                                                                                                                  
[29] "```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```"                                                                                                                                                     
[30] ""                                                                                                                                                                                                                                                  
[31] "```{r echo=FALSE}\n# R chunk with no name but options (not using,)\n```"                                                                                                                                                                           
[32] ""                                                                                                                                                                                                                                                  
[33] "```{r, chunk_name}\n# wrong R chunk with , and name is parsed as argument\n```"                                                                                                                                                                    
[34] ""                                                                                                                                                                                                                                                  
[35] "```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```"                                                                                                                                                                         
[36] ""                                                                                                                                                                                                                                                  
[37] "```{eval = TRUE}\nA void code\n```"                                                                                                                                                                                                                
[38] ""                                                                                                                                                                                                                                                  
[39] "```{}\nAnother void code\n```"                                                                                                                                                                                                                     
[40] ""                                                                                                                                                                                                                                                  
[41] "```\nStill another void code\n```"                                                                                                                                                                                                                 
[42] ""                                                                                                                                                                                                                                                  
[43] "```a really strange inline block ```"                                                                                                                                                                                                              
[44] ""                                                                                                                                                                                                                                                  
[45] "``` {r}\na strange chuck header with space before {\n```"                                                                                                                                                                                          
[46] ""                                                                                                                                                                                                                                                  
[47] "End of the document"                                                                                                                                                                                                                               
[48] ""
 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                                  
 [2] "This is not a common Document. The Document includes properly formatted Markdown syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                         
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                        
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                               
 [6] "FILE-NAME: example-1.Rmd"                                                                                                                                                                                                                          
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                   
 [8] "#----End Instructions----#"                                                                                                                                                                                                                        
 [9] "[[document-header]]"                                                                                                                                                                                                                               
[10] "```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```"                                                                                                                                                                              
[11] ""                                                                                                                                                                                                                                                  
[12] ""                                                                                                                                                                                                                                                  
[13] "## R Markdown"                                                                                                                                                                                                                                     
[14] ""                                                                                                                                                                                                                                                  
[15] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."                                                   
[16] ""                                                                                                                                                                                                                                                  
[17] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                      
[18] ""                                                                                                                                                                                                                                                  
[19] "```{r cars}\nsummary(cars)\n```"                                                                                                                                                                                                                   
[20] ""                                                                                                                                                                                                                                                  
[21] "## Including Plots"                                                                                                                                                                                                                                
[22] ""                                                                                                                                                                                                                                                  
[23] "You can also embed plots, for example:"                                                                                                                                                                                                            
[24] ""                                                                                                                                                                                                                                                  
[25] "```{r, pressure, echo=FALSE}\nplot(pressure)\n```\n\n```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```"                                                                                                
[26] ""                                                                                                                                                                                                                                                  
[27] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                     
[28] ""                                                                                                                                                                                                                                                  
[29] ""                                                                                                                                                                                                                                                  
[30] "```{r echo=FALSE}\n# R chunk with no name but options (not using,)\n```"                                                                                                                                                                           
[31] ""                                                                                                                                                                                                                                                  
[32] "```{r, chunk_name}\n# wrong R chunk with , and name is parsed as argument\n```\n\n```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```\n\n```{eval = TRUE}\nA void code\n```"                                                 
[33] ""                                                                                                                                                                                                                                                  
[34] ""                                                                                                                                                                                                                                                  
[35] ""                                                                                                                                                                                                                                                  
[36] "```{}\nAnother void code\n```"                                                                                                                                                                                                                     
[37] ""                                                                                                                                                                                                                                                  
[38] "```\nStill another void code\n```\n\n``` {r}\na strange chuck header with space before {\n```"                                                                                                                                                     
[39] ""                                                                                                                                                                                                                                                  
[40] "```a really strange inline block ```"                                                                                                                                                                                                              
[41] ""                                                                                                                                                                                                                                                  
[42] ""                                                                                                                                                                                                                                                  
[43] "End of the document"                                                                                                                                                                                                                               
[44] ""
 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                               
 [2] "This is not a common Document. The Document includes properly formatted LaTeX syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                      
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                     
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                            
 [6] "FILE-NAME: example-1.Rnw"                                                                                                                                                                                                                       
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                
 [8] "#----End Instructions----#"                                                                                                                                                                                                                     
 [9] "[[document-header]]"                                                                                                                                                                                                                            
[10] ""                                                                                                                                                                                                                                               
[11] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                           
[12] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         Title           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                           
[13] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                           
[14] ""                                                                                                                                                                                                                                               
[15] "\\maketitle"                                                                                                                                                                                                                                    
[16] ""                                                                                                                                                                                                                                               
[17] "%----------------------------------------------------------------------------------%"                                                                                                                                                           
[18] "%--------------------------         Introduction         --------------------------%"                                                                                                                                                           
[19] "%----------------------------------------------------------------------------------%"                                                                                                                                                           
[20] ""                                                                                                                                                                                                                                               
[21] "\\section{R and \\LaTeX}"                                                                                                                                                                                                                       
[22] ""                                                                                                                                                                                                                                               
[23] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."                                                    
[24] ""                                                                                                                                                                                                                                               
[25] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                   
[26] ""                                                                                                                                                                                                                                               
[27] "<<cars>>=\nsummary(cars)\n@"                                                                                                                                                                                                                    
[28] ""                                                                                                                                                                                                                                               
[29] "\\section{Including Plots}"                                                                                                                                                                                                                     
[30] ""                                                                                                                                                                                                                                               
[31] "You can also embed plots, for example:"                                                                                                                                                                                                         
[32] ""                                                                                                                                                                                                                                               
[33] "<<pressure, echo=FALSE>>=\nplot(pressure)\n@"                                                                                                                                                                                                   
[34] ""                                                                                                                                                                                                                                               
[35] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                  
[36] ""                                                                                                                                                                                                                                               
[37] "<<echo=FALSE, warning=FALSE>>=\n# R chunk with no name but multiple options (using ,)\n@"                                                                                                                                                       
[38] ""                                                                                                                                                                                                                                               
[39] "<<echo=FALSE>>= # a really evil comment\n# R chunk with no name but options (not using,)\n@"                                                                                                                                                    
[40] ""                                                                                                                                                                                                                                               
[41] "<<sql, eval=FALSE>>=\n/*A  wrong sql chunk chunk with no name but options*/\n@"                                                                                                                                                                 
[42] ""                                                                                                                                                                                                                                               
[43] "<<>>=\n# A void code block\n@"                                                                                                                                                                                                                  
[44] ""                                                                                                                                                                                                                                               
[45] "End of the document"                                                                                                                                                                                                                            
[46] ""                                                                                                                                                                                                                                               
[47] "\\end{document}"                                                                                                                                                                                                                                
[48] ""
 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                               
 [2] "This is not a common Document. The Document includes properly formatted LaTeX syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                      
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                     
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                            
 [6] "FILE-NAME: example-1.Rnw"                                                                                                                                                                                                                       
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                
 [8] "#----End Instructions----#"                                                                                                                                                                                                                     
 [9] "[[document-header]]"                                                                                                                                                                                                                            
[10] "<<cars>>=\nsummary(cars)\n@"                                                                                                                                                                                                                    
[11] ""                                                                                                                                                                                                                                               
[12] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                           
[13] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         Title           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                           
[14] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                           
[15] ""                                                                                                                                                                                                                                               
[16] "\\maketitle"                                                                                                                                                                                                                                    
[17] ""                                                                                                                                                                                                                                               
[18] "%----------------------------------------------------------------------------------%"                                                                                                                                                           
[19] "%--------------------------         Introduction         --------------------------%"                                                                                                                                                           
[20] "%----------------------------------------------------------------------------------%"                                                                                                                                                           
[21] ""                                                                                                                                                                                                                                               
[22] "\\section{R and \\LaTeX}"                                                                                                                                                                                                                       
[23] ""                                                                                                                                                                                                                                               
[24] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."                                                    
[25] ""                                                                                                                                                                                                                                               
[26] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                   
[27] ""                                                                                                                                                                                                                                               
[28] ""                                                                                                                                                                                                                                               
[29] "\\section{Including Plots}"                                                                                                                                                                                                                     
[30] ""                                                                                                                                                                                                                                               
[31] "You can also embed plots, for example:"                                                                                                                                                                                                         
[32] ""                                                                                                                                                                                                                                               
[33] "<<pressure, echo=FALSE>>=\nplot(pressure)\n@\n\n<<echo=FALSE, warning=FALSE>>=\n# R chunk with no name but multiple options (using ,)\n@\n\n<<echo=FALSE>>= # a really evil comment\n# R chunk with no name but options (not using,)\n@"        
[34] ""                                                                                                                                                                                                                                               
[35] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                  
[36] ""                                                                                                                                                                                                                                               
[37] ""                                                                                                                                                                                                                                               
[38] ""                                                                                                                                                                                                                                               
[39] "<<sql, eval=FALSE>>=\n/*A  wrong sql chunk chunk with no name but options*/\n@\n\n<<>>=\n# A void code block\n@"                                                                                                                                
[40] ""                                                                                                                                                                                                                                               
[41] ""                                                                                                                                                                                                                                               
[42] "End of the document"                                                                                                                                                                                                                            
[43] ""                                                                                                                                                                                                                                               
[44] "\\end{document}"                                                                                                                                                                                                                                
[45] ""

check restore_chunk works when missing first chuncks

 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                                  
 [2] "This is not a common Document. The Document includes properly formatted Markdown syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                         
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                        
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                               
 [6] "FILE-NAME: example-1.Rmd"                                                                                                                                                                                                                          
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                   
 [8] "#----End Instructions----#"                                                                                                                                                                                                                        
 [9] "[[document-header]]"                                                                                                                                                                                                                               
[10] "```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```\n\n```{r cars}\nsummary(cars)\n```"                                                                                                                                           
[11] ""                                                                                                                                                                                                                                                  
[12] ""                                                                                                                                                                                                                                                  
[13] "## R Markdown"                                                                                                                                                                                                                                     
[14] ""                                                                                                                                                                                                                                                  
[15] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."                                                   
[16] ""                                                                                                                                                                                                                                                  
[17] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                      
[18] ""                                                                                                                                                                                                                                                  
[19] ""                                                                                                                                                                                                                                                  
[20] "## Including Plots"                                                                                                                                                                                                                                
[21] ""                                                                                                                                                                                                                                                  
[22] "You can also embed plots, for example:"                                                                                                                                                                                                            
[23] ""                                                                                                                                                                                                                                                  
[24] "```{r, pressure, echo=FALSE}\nplot(pressure)\n```"                                                                                                                                                                                                 
[25] ""                                                                                                                                                                                                                                                  
[26] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                     
[27] ""                                                                                                                                                                                                                                                  
[28] "```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```"                                                                                                                                                     
[29] ""                                                                                                                                                                                                                                                  
[30] "```{r echo=FALSE}\n# R chunk with no name but options (not using,)\n```"                                                                                                                                                                           
[31] ""                                                                                                                                                                                                                                                  
[32] "```{r, chunk_name}\n# wrong R chunk with , and name is parsed as argument\n```\n\n```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```\n\n```{eval = TRUE}\nA void code\n```"                                                 
[33] ""                                                                                                                                                                                                                                                  
[34] ""                                                                                                                                                                                                                                                  
[35] ""                                                                                                                                                                                                                                                  
[36] "```{}\nAnother void code\n```"                                                                                                                                                                                                                     
[37] ""                                                                                                                                                                                                                                                  
[38] "```\nStill another void code\n```\n\n``` {r}\na strange chuck header with space before {\n```"                                                                                                                                                     
[39] ""                                                                                                                                                                                                                                                  
[40] "```a really strange inline block ```"                                                                                                                                                                                                              
[41] ""                                                                                                                                                                                                                                                  
[42] ""                                                                                                                                                                                                                                                  
[43] "End of the document"                                                                                                                                                                                                                               
[44] ""

check restore_code works properly

 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                                  
 [2] "This is not a common Document. The Document includes properly formatted Markdown syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                         
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                        
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                               
 [6] "FILE-NAME: example-1.Rmd"                                                                                                                                                                                                                          
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                   
 [8] "#----End Instructions----#"                                                                                                                                                                                                                        
 [9] "---\ntitle: \"Reviewdown Test\"\nauthor: \"reviewdown\"\ndate: \"2/3/2021\"\noutput: html_document\n---"                                                                                                                                           
[10] ""                                                                                                                                                                                                                                                  
[11] "```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```"                                                                                                                                                                              
[12] ""                                                                                                                                                                                                                                                  
[13] "## R Markdown"                                                                                                                                                                                                                                     
[14] ""                                                                                                                                                                                                                                                  
[15] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."                                                   
[16] ""                                                                                                                                                                                                                                                  
[17] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                      
[18] ""                                                                                                                                                                                                                                                  
[19] "```{r cars}\nsummary(cars)\n```"                                                                                                                                                                                                                   
[20] ""                                                                                                                                                                                                                                                  
[21] "## Including Plots"                                                                                                                                                                                                                                
[22] ""                                                                                                                                                                                                                                                  
[23] "You can also embed plots, for example:"                                                                                                                                                                                                            
[24] ""                                                                                                                                                                                                                                                  
[25] "```{r, pressure, echo=FALSE}\nplot(pressure)\n```"                                                                                                                                                                                                 
[26] ""                                                                                                                                                                                                                                                  
[27] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                     
[28] ""                                                                                                                                                                                                                                                  
[29] "```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```"                                                                                                                                                     
[30] ""                                                                                                                                                                                                                                                  
[31] "```{r echo=FALSE}\n# R chunk with no name but options (not using,)\n```"                                                                                                                                                                           
[32] ""                                                                                                                                                                                                                                                  
[33] "```{r, chunk_name}\n# wrong R chunk with , and name is parsed as argument\n```"                                                                                                                                                                    
[34] ""                                                                                                                                                                                                                                                  
[35] "```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```"                                                                                                                                                                         
[36] ""                                                                                                                                                                                                                                                  
[37] "```{eval = TRUE}\nA void code\n```"                                                                                                                                                                                                                
[38] ""                                                                                                                                                                                                                                                  
[39] "```{}\nAnother void code\n```"                                                                                                                                                                                                                     
[40] ""                                                                                                                                                                                                                                                  
[41] "```\nStill another void code\n```"                                                                                                                                                                                                                 
[42] ""                                                                                                                                                                                                                                                  
[43] "```a really strange inline block ```"                                                                                                                                                                                                              
[44] ""                                                                                                                                                                                                                                                  
[45] "``` {r}\na strange chuck header with space before {\n```"                                                                                                                                                                                          
[46] ""                                                                                                                                                                                                                                                  
[47] "End of the document"                                                                                                                                                                                                                               
[48] ""
 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                                  
 [2] "This is not a common Document. The Document includes properly formatted Markdown syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                         
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                        
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                               
 [6] "FILE-NAME: example-1.Rmd"                                                                                                                                                                                                                          
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                   
 [8] "#----End Instructions----#"                                                                                                                                                                                                                        
 [9] "---\ntitle: \"Reviewdown Test\"\nauthor: \"reviewdown\"\ndate: \"2/3/2021\"\noutput: html_document\n---"                                                                                                                                           
[10] "```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```"                                                                                                                                                                              
[11] ""                                                                                                                                                                                                                                                  
[12] ""                                                                                                                                                                                                                                                  
[13] "## R Markdown"                                                                                                                                                                                                                                     
[14] ""                                                                                                                                                                                                                                                  
[15] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."                                                   
[16] ""                                                                                                                                                                                                                                                  
[17] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                      
[18] ""                                                                                                                                                                                                                                                  
[19] "```{r cars}\nsummary(cars)\n```"                                                                                                                                                                                                                   
[20] ""                                                                                                                                                                                                                                                  
[21] "## Including Plots"                                                                                                                                                                                                                                
[22] ""                                                                                                                                                                                                                                                  
[23] "You can also embed plots, for example:"                                                                                                                                                                                                            
[24] ""                                                                                                                                                                                                                                                  
[25] "```{r, pressure, echo=FALSE}\nplot(pressure)\n```\n\n```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```"                                                                                                
[26] ""                                                                                                                                                                                                                                                  
[27] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                     
[28] ""                                                                                                                                                                                                                                                  
[29] ""                                                                                                                                                                                                                                                  
[30] "```{r echo=FALSE}\n# R chunk with no name but options (not using,)\n```"                                                                                                                                                                           
[31] ""                                                                                                                                                                                                                                                  
[32] "```{r, chunk_name}\n# wrong R chunk with , and name is parsed as argument\n```\n\n```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```\n\n```{eval = TRUE}\nA void code\n```"                                                 
[33] ""                                                                                                                                                                                                                                                  
[34] ""                                                                                                                                                                                                                                                  
[35] ""                                                                                                                                                                                                                                                  
[36] "```{}\nAnother void code\n```"                                                                                                                                                                                                                     
[37] ""                                                                                                                                                                                                                                                  
[38] "```\nStill another void code\n```\n\n``` {r}\na strange chuck header with space before {\n```"                                                                                                                                                     
[39] ""                                                                                                                                                                                                                                                  
[40] "```a really strange inline block ```"                                                                                                                                                                                                              
[41] ""                                                                                                                                                                                                                                                  
[42] ""                                                                                                                                                                                                                                                  
[43] "End of the document"                                                                                                                                                                                                                               
[44] ""
 [1] "<!-- A child document -->"                                                                                                                                                                      
 [2] ""                                                                                                                                                                                               
 [3] "## R Markdown"                                                                                                                                                                                  
 [4] ""                                                                                                                                                                                               
 [5] "---"                                                                                                                                                                                            
 [6] ""                                                                                                                                                                                               
 [7] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."
 [8] ""                                                                                                                                                                                               
 [9] "---"                                                                                                                                                                                            
[10] ""                                                                                                                                                                                               
[11] "```{r cars}\nsummary(cars)\n```"                                                                                                                                                                
[12] ""                                                                                                                                                                                               
[13] "## Including Plots"                                                                                                                                                                             
[14] ""                                                                                                                                                                                               
[15] "You can also embed plots, for example:"                                                                                                                                                         
[16] ""                                                                                                                                                                                               
[17] "```{r, pressure, echo=FALSE}\nplot(pressure)\n```"                                                                                                                                              
[18] ""
 [1] "---\ntitle: \"Reviewdown Test\"\nauthor: \"reviewdown\"\ndate: \"2/3/2021\"\noutput: html_document\n---"                                                                                        
 [2] ""                                                                                                                                                                                               
 [3] "## R Markdown"                                                                                                                                                                                  
 [4] ""                                                                                                                                                                                               
 [5] "---"                                                                                                                                                                                            
 [6] ""                                                                                                                                                                                               
 [7] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."
 [8] ""                                                                                                                                                                                               
 [9] "---"                                                                                                                                                                                            
[10] ""
 [1] "<!-- A child document -->"                                                                                                                                                                      
 [2] ""                                                                                                                                                                                               
 [3] "## R Markdown"                                                                                                                                                                                  
 [4] ""                                                                                                                                                                                               
 [5] "---"                                                                                                                                                                                            
 [6] ""                                                                                                                                                                                               
 [7] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."
 [8] ""                                                                                                                                                                                               
 [9] "---"                                                                                                                                                                                            
[10] ""
 [1] "```{r cars}\nsummary(cars)\n```\n\n```{r, pressure, echo=FALSE}\nplot(pressure)\n```"                                                                                                           
 [2] "<!-- A child document -->"                                                                                                                                                                      
 [3] ""                                                                                                                                                                                               
 [4] "## R Markdown"                                                                                                                                                                                  
 [5] ""                                                                                                                                                                                               
 [6] "---"                                                                                                                                                                                            
 [7] ""                                                                                                                                                                                               
 [8] "This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>."
 [9] ""                                                                                                                                                                                               
[10] "---"                                                                                                                                                                                            
[11] ""                                                                                                                                                                                               
[12] ""                                                                                                                                                                                               
[13] "## Including Plots"                                                                                                                                                                             
[14] ""                                                                                                                                                                                               
[15] "You can also embed plots, for example:"                                                                                                                                                         
[16] ""                                                                                                                                                                                               
[17] ""
 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 [2] "This is not a common Document. The Document includes properly formatted LaTeX syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
 [6] "FILE-NAME: example-1.Rnw"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 [8] "#----End Instructions----#"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 [9] "\n%----    Basic packages    ----%\n\\documentclass{article}  \n\\usepackage[T1] {fontenc} \t\t  % Font encoding\n\\usepackage [utf8] {inputenc}\t\t% Encoding for the document\n\\usepackage[a4paper,includeheadfoot,top=2.4cm, bottom=2cm, left=2.4cm, right=2.4cm]{geometry}  % margin settings\n\\usepackage[english]{babel}      \n\n\n%----    Other packages    ----%\n\\usepackage{tikz}       \n\\usepackage{graphicx}   % for including graphics\n\\usepackage{amsmath}    % for math equation\n\\usepackage{hyperref}    % ref between elements\n\n\n%%%%%%%%%%%%%%%%%%%%%%          Settings        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n<<setup, include=FALSE>>=\nknitr::opts_chunk$set(echo = TRUE)\n@\n\n\n\n% Document title info\n\\title{Reviewdown Test}\n\\author{reviewdown}\n% \\date{}\n\\begin{document}"
[10] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[11] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[12] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         Title           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[13] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[14] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[15] "\\maketitle"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[16] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[17] "%----------------------------------------------------------------------------------%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[18] "%--------------------------         Introduction         --------------------------%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[19] "%----------------------------------------------------------------------------------%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[20] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[21] "\\section{R and \\LaTeX}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
[22] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[23] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[24] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[25] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
[26] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[27] "<<cars>>=\nsummary(cars)\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[28] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[29] "\\section{Including Plots}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
[30] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[31] "You can also embed plots, for example:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
[32] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[33] "<<pressure, echo=FALSE>>=\nplot(pressure)\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
[34] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[35] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
[36] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[37] "<<echo=FALSE, warning=FALSE>>=\n# R chunk with no name but multiple options (using ,)\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
[38] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[39] "<<echo=FALSE>>= # a really evil comment\n# R chunk with no name but options (not using,)\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[40] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[41] "<<sql, eval=FALSE>>=\n/*A  wrong sql chunk chunk with no name but options*/\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
[42] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[43] "<<>>=\n# A void code block\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
[44] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[45] "End of the document"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
[46] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[47] "\\end{document}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
[48] ""
 [1] "#----Trackdown Instructions----#"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 [2] "This is not a common Document. The Document includes properly formatted LaTeX syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 [3] "Please do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
 [4] "Once the review is over accept all changes: Tools -> Review suggested edits -> Accept all."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 [5] "You must not modify or remove these lines, we will do it for you ;)"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
 [6] "FILE-NAME: example-1.Rnw"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 [7] "HIDE-CODE: TRUE"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 [8] "#----End Instructions----#"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 [9] "\n%----    Basic packages    ----%\n\\documentclass{article}  \n\\usepackage[T1] {fontenc} \t\t  % Font encoding\n\\usepackage [utf8] {inputenc}\t\t% Encoding for the document\n\\usepackage[a4paper,includeheadfoot,top=2.4cm, bottom=2cm, left=2.4cm, right=2.4cm]{geometry}  % margin settings\n\\usepackage[english]{babel}      \n\n\n%----    Other packages    ----%\n\\usepackage{tikz}       \n\\usepackage{graphicx}   % for including graphics\n\\usepackage{amsmath}    % for math equation\n\\usepackage{hyperref}    % ref between elements\n\n\n%%%%%%%%%%%%%%%%%%%%%%          Settings        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n<<setup, include=FALSE>>=\nknitr::opts_chunk$set(echo = TRUE)\n@\n\n\n\n% Document title info\n\\title{Reviewdown Test}\n\\author{reviewdown}\n% \\date{}\n\\begin{document}"
[10] "<<cars>>=\nsummary(cars)\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[11] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[12] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[13] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         Title           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[14] "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[15] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[16] "\\maketitle"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[17] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[18] "%----------------------------------------------------------------------------------%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[19] "%--------------------------         Introduction         --------------------------%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[20] "%----------------------------------------------------------------------------------%"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
[21] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[22] "\\section{R and \\LaTeX}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
[23] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[24] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[25] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[26] "When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
[27] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[28] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[29] "\\section{Including Plots}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
[30] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[31] "You can also embed plots, for example:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
[32] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[33] "<<pressure, echo=FALSE>>=\nplot(pressure)\n@\n\n<<echo=FALSE, warning=FALSE>>=\n# R chunk with no name but multiple options (using ,)\n@\n\n<<echo=FALSE>>= # a really evil comment\n# R chunk with no name but options (not using,)\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
[34] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[35] "Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
[36] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[37] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[38] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[39] "<<sql, eval=FALSE>>=\n/*A  wrong sql chunk chunk with no name but options*/\n@\n\n<<>>=\n# A void code block\n@"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
[40] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[41] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[42] "End of the document"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
[43] ""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[44] "\\end{document}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
[45] ""
 [1] "% A child document"                                                                                                                                                                         
 [2] ""                                                                                                                                                                                           
 [3] "\\section{R and \\LaTeX}"                                                                                                                                                                   
 [4] ""                                                                                                                                                                                           
 [5] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."
 [6] ""                                                                                                                                                                                           
 [7] "<<cars>>=\nsummary(cars)\n@"                                                                                                                                                                
 [8] ""                                                                                                                                                                                           
 [9] "\\section{Including Plots}"                                                                                                                                                                 
[10] ""                                                                                                                                                                                           
[11] "You can also embed plots, for example:"                                                                                                                                                     
[12] ""                                                                                                                                                                                           
[13] "<<pressure, echo=FALSE>>=\nplot(pressure)\n@"                                                                                                                                               
[14] ""                                                                                                                                                                                           
[15] ""
[1] "\\documentclass{article}  \n\n\\usepackage[T1] {fontenc} \t\t  % Font encoding\n\\usepackage [utf8] {inputenc}\t\t% Encoding for the document\n\n\\begin{document}"                         
[2] ""                                                                                                                                                                                           
[3] "\\section{R and \\LaTeX}"                                                                                                                                                                   
[4] ""                                                                                                                                                                                           
[5] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."
[6] ""                                                                                                                                                                                           
[7] "\\end{document}"                                                                                                                                                                            
[8] ""
[1] "% A child document"                                                                                                                                                                         
[2] ""                                                                                                                                                                                           
[3] "\\section{R and \\LaTeX}"                                                                                                                                                                   
[4] ""                                                                                                                                                                                           
[5] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."
[6] ""
 [1] "<<cars>>=\nsummary(cars)\n@\n\n<<pressure, echo=FALSE>>=\nplot(pressure)\n@"                                                                                                                
 [2] "% A child document"                                                                                                                                                                         
 [3] ""                                                                                                                                                                                           
 [4] "\\section{R and \\LaTeX}"                                                                                                                                                                   
 [5] ""                                                                                                                                                                                           
 [6] "This is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}."
 [7] ""                                                                                                                                                                                           
 [8] ""                                                                                                                                                                                           
 [9] "\\section{Including Plots}"                                                                                                                                                                 
[10] ""                                                                                                                                                                                           
[11] "You can also embed plots, for example:"                                                                                                                                                     
[12] ""                                                                                                                                                                                           
[13] ""                                                                                                                                                                                           
[14] ""

check restore_file works properly

[1] "---\ntitle: \"Reviewdown Test\"\nauthor: \"reviewdown\"\ndate: \"2/3/2021\"\noutput: html_document\n---\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```\n## R Markdown\nThis is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.\nWhen you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:\n```{r cars}\nsummary(cars)\n```\n## Including Plots\nYou can also embed plots, for example:\n```{r, pressure, echo=FALSE}\nplot(pressure)\n```\nNote that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.\n```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```\n```{r echo=FALSE}\n# R chunk with no name but options (not using,)\n```\n```{r, chunk_name}\n# wrong R chunk with , and name is parsed as argument\n```\n```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```\n```{eval = TRUE}\nA void code\n```\n```{}\nAnother void code\n```\n```\nStill another void code\n```\n```a really strange inline block ```\n``` {r}\na strange chuck header with space before {\n```\nEnd of the document\n"
[1] "\n%----    Basic packages    ----%\n\\documentclass{article}  \n\\usepackage[T1] {fontenc} \t\t  % Font encoding\n\\usepackage [utf8] {inputenc}\t\t% Encoding for the document\n\\usepackage[a4paper,includeheadfoot,top=2.4cm, bottom=2cm, left=2.4cm, right=2.4cm]{geometry}  % margin settings\n\\usepackage[english]{babel}      \n\n%----    Other packages    ----%\n\\usepackage{tikz}       \n\\usepackage{graphicx}   % for including graphics\n\\usepackage{amsmath}    % for math equation\n\\usepackage{hyperref}    % ref between elements\n\n%%%%%%%%%%%%%%%%%%%%%%          Settings        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n<<setup, include=FALSE>>=\nknitr::opts_chunk$set(echo = TRUE)\n@\n\n% Document title info\n\\title{Reviewdown Test}\n\\author{reviewdown}\n% \\date{}\n\\begin{document}\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         Title           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\maketitle\n%----------------------------------------------------------------------------------%\n%--------------------------         Introduction         --------------------------%\n%----------------------------------------------------------------------------------%\n\\section{R and \\LaTeX}\nThis is an Rnw document. \\LaTeX is a (\\textit{not so}) simple formatting syntax for authoring PDF documents. For more details on using \\LaTeX see \\url{https://www.overleaf.com/learn}.\nWhen you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:\n<<cars>>=\nsummary(cars)\n@\n\\section{Including Plots}\nYou can also embed plots, for example:\n<<pressure, echo=FALSE>>=\nplot(pressure)\n@\nNote that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.\n<<echo=FALSE, warning=FALSE>>=\n# R chunk with no name but multiple options (using ,)\n@\n<<echo=FALSE>>= # a really evil comment\n# R chunk with no name but options (not using,)\n@\n<<sql, eval=FALSE>>=\n/*A  wrong sql chunk chunk with no name but options*/\n@\n<<>>=\n# A void code block\n@\nEnd of the document\n\\end{document}\n"


ekothe/trackdown documentation built on June 28, 2023, 4:57 p.m.