This guide provides step-by-step instructions for building a Quarto project locally on Linux and Windows. It covers installation of dependencies, rendering Quarto projects, and troubleshooting potential issues.
Ensure that you have the following installed:
- Quarto (Version 1.7.13 recommended, but can be updated as needed)
- R (Version 4.3.2 recommended, if using R-based Quarto features)
- TinyTeX (for PDF builds)
- TeX Live (for full LaTeX support)
- Inkscape (for SVG to PDF conversions, if required)
- Ghostscript (for PDF compression, if applicable)
- Python 3 (for PDF compression tools, if applicable)
- System Dependencies (libpango, libfontconfig, and others for Linux builds)
-
Install Quarto:
wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.7.13/quarto-1.7.13-linux-amd64.deb sudo dpkg -i quarto-1.7.13-linux-amd64.deb
-
Install TinyTeX:
quarto install tinytex
Add TinyTeX to PATH:
echo "export PATH=$HOME/.TinyTeX/bin/x86_64-linux:$PATH" >> ~/.bashrc source ~/.bashrc
-
Install Required TeX Live Packages:
sudo apt-get update && sudo apt-get install -y \ texlive texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra \ texlive-lang-english texlive-pictures texlive-xetex texlive-luatex
-
Install System Dependencies for Linux:
sudo apt-get install -y \ libpangoft2-1.0-0 fonts-dejavu fonts-freefont-ttf libpango-1.0-0 \ libpangocairo-1.0-0 libcogl-pango-dev pango1.0-tools libcairo2 \ gdk-pixbuf2.0-bin libgdk-pixbuf2.0-dev librsvg2-bin libcurl4-openssl-dev \ libssl-dev libxml2-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev \ libfreetype6-dev libtiff5-dev libjpeg-dev
-
Install Inkscape (if required for graphics processing):
sudo add-apt-repository ppa:inkscape.dev/stable -y sudo apt-get update sudo apt-get install inkscape -y
-
Install Ghostscript (for PDF compression, optional):
sudo apt-get install ghostscript -y
-
Install Python 3 (for PDF compression and other utilities):
sudo apt-get install python3 python3-pip -y
-
Install R Packages:
install.packages(c("remotes")) source("install_packages.R")
-
Install Quarto:
- Download the installer from Quarto’s website
- Run the installer and follow the prompts.
-
Install TinyTeX:
- Open R and run:
install.packages("tinytex") tinytex::install_tinytex()
- Open R and run:
-
Install TeX Live (if additional LaTeX support is needed):
- Download the TeX Live installer from TUG.org
- Follow the installation prompts.
-
Install Inkscape (if required for graphics processing):
choco install inkscape -y
-
Install Ghostscript (for PDF compression, optional):
choco install ghostscript -y
-
Install Python 3 (for PDF compression tools, if applicable):
choco install python -y
-
Install R Packages:
install.packages(c("remotes")) source("install_packages.R")
-
Navigate to the Quarto Project Directory:
cd path/to/your/project
-
Render the project to HTML:
quarto render --to html
-
Render the project to PDF:
quarto render --to pdf
If errors occur related to missing LaTeX packages, install them using TeX Live.
-
Compress PDF (Linux only, if required):
python3 ./scripts/quarto_publish/gs_compress_pdf.py \ -i ./_book/Machine-Learning-Systems.pdf \ -o ./_book/ebook.pdf \ -s "/ebook"
Ensure that Quarto is installed and available in your PATH:
quarto --version
- Ensure TinyTeX and necessary LaTeX packages are installed.
- Run
tlmgr install <missing-package>
if a package is missing.
- Ensure Inkscape is installed and accessible.
- Check if required fonts are installed on your system.
- Ensure Python and Ghostscript are installed.
- Check for missing dependencies using
pip install -r requirements.txt
if applicable.
Following these steps will allow you to build Quarto projects efficiently on both Linux and Windows. If issues persist, refer to the Quarto documentation for further troubleshooting.