A Living Papers article starter template. Copy this repository and edit to make your own article.
This template is set up to produce a web-based article from a Markdown source file named index.md. Any figures, datasets, and other external files should be placed in the assets folder.
View the published sample article content at https://uwdata.github.io/living-papers-template/.
For more usage examples, see the example articles in the main Living Papers repository.
Before working with Living Papers, set up your local environment:
- Install Node.js and npm if you don't have them already. We recommend using a node version manager like nvm. Node v16.17 or higher is recommended.
- Install pandoc >= 2.18. You should be able to run
pandocfrom the command line.
- On Ubuntu,
aptdoesn't have the latest version. You can either go through pandoc's listed installation process or use conda (conda install pandoc).
- Install other software packages as needed:
- To use R code blocks, install R along with the
knitrpackage and other libraries you wish to use. For example, if you want to use tidyverse libraries and SVG graphics output:install.packages(c("knitr", "tidyverse", "svglite"))
- To publish LaTeX / PDF output, install a TeX distribution such as TeX Live. You should be able to run
pdflatexandbibtexfrom the command line.
- Clone or copy the content of this repository. For example, click the green "Code" button on GitHub, select "Download ZIP", and unpack into a new working folder.
- Run
npm iin your working folder to install all JavaScript dependencies. - Now you're ready to start writing!
- Run
npm run buildto compile your article to a web page. The output will be written to thebuilddirectory. - Run
npm run watchto "watch" your sourceindex.mdfile and automatically recompile it when it changes. This command will also launch a local web server, open your browser, and automatically update the web page view upon updates. Use Control-C to stop watching and shut down the local server. - Once your article is ready -- and if you are working in your own dedicated GitHub repo -- run
npm run deployto publish your article to GitHub pages. This action copies the content of thebuildfolder to your GitHub pages branch.