Document projects made by memoiR can be knitted without the package, which is used only to create them. Yet, new versions of the package may support new features that should be included in an existing project. Upgrading a document project to a new version of memoiR may be done according to two different strategies. This may take some time so do it only if necessary and keep a copy of the old version of the project.
Create a new project
The simplest solution consists of creating a new project from scratch with an updated version of the package. Then, copy and paste the content of the old project:
- memoir chapters (
.Rmdfiles) and text from theindex.Rmdfiles in memoirs, - text of
.Rmdfiles from article or presentation projects - the yaml headers of
.Rmdfiles: they contain the parameters of the project (its title, its language…)
Run the commands again: build_gitignore() to build the
.gitignore file, build_ghworkflow() to
activate continuous integration, build_readme() for the
README.md file.
Upgrade the helper files of an existing project
In the alternative strategy, the existing project is modified to assess the new helper files from the package.
Create a new project of the same type as the project to upgrade, e.g. “Stylish Article”. Copy files from the new project to the same folder of the old one:
- replace the content of the
latexfolder (but do not overwrite your changes inpreamble.tex,before_body.texandafter_body.tex). - upgrade the
.cssfiles. - add any new file that do not exist in the old project,
e.g.
bs4_style.cssto allow Bootstrap 4 style in memoirs.
Conclusion
Existing document projects can be upgraded to benefit from new
features of a recent memoiR version, at the price of
copying new files from the package. Changes in modified files, e.g. new
options in the yaml header of an existing .Rmd file require
comparing the new and old file structures and updating the new files
line by line.