R Under development (unstable) (2024-10-14 r87233 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # only run this when NOT_CRAN is true (e.g., on Travis CI) > if (Sys.getenv('NOT_CRAN') == 'true') local({ + all_files = function() { + list.files('rmd', all.files = TRUE, full.names = TRUE) + } + files1 = all_files() + on.exit(unlink(setdiff(all_files(), files1), recursive = TRUE), add = TRUE) + + for (f in list.files('rmd', '[.]Rmd$', full.names = TRUE)) { + rmarkdown::render(f, envir = globalenv(), quiet = TRUE) + } + + # split by section works correctly + ## id is used for html file name + sections_files = c("section-1.html", "subsection-1.html", "section-2.html", "sub2.html") + if (any(!file.exists(file.path("rmd", sections_files)))) + stop("Failed to generate sections files") + ## reference is working correctly (see #787) + if (!any(xfun::read_utf8("rmd/subsection-1.html") == '
See chapter 2 now at 2
')) + stop('Failed to reference section when split by sections') + if (!any(xfun::read_utf8("rmd/sub2.html") == 'See figure 2.1
')) + stop('Failed to reference figure when split by sections') + + # Check equation label are working + if (!any(readLines('rmd/equation-label.html') == 'y \\in \\mathbb{Z} \\tag{2}')) { + stop('Failed to render the equation label in equation-label.Rmd') + } + + # footnotes are parsed and moved correctly + ## deleted from last section + if (any(grepl('