This project provides a 25-page Codebook editing template designed for competitive programmer. It streamlines the process of compiling and formatting a Codebook by automating the LaTeX compilation flow using Docker images and GitHub workflows. This significantly reduces issues related to LaTeX environment setup and font dependencies. With this setup, users only need to focus on editing the content, and by simply pushing changes to GitHub, a fully compiled PDF will automatically be generated.
- Automated LaTeX Compilation: Docker and GitHub Actions are used to automate the LaTeX compilation process.
- Cross-Platform Compatibility: Resolves environment and font dependency issues by encapsulating the LaTeX environment within a Docker container.
- Easy Editing: Focus on editing the content (
content.tex
) of your Codebook. No need to worry about setting up LaTeX locally or managing font dependencies. - Automatic PDF Generation: Simply push changes to GitHub, and a PDF version of the Codebook is automatically compiled and ready for download.
- Docker: Containerizes the LaTeX environment to ensure consistency across different systems.
- GitHub Actions: Automates the build and LaTeX compilation process via GitHub workflows.
- LaTeX Environment: Using the
texlive:latest
Docker image for the LaTeX setup. - Fonts: Utilizes Consolas and NotoSansCJKtc for high-quality, readable typography.
-
Fork the Repository: Begin by forking this repository to your own GitHub account.
-
Edit the
content.tex
File: Modify thecontent.tex
file to customize the sections and structure of your Codebook. This file controls the presentation of your Codebook and its contents. -
Example Usage: Below is an example of how to structure a section of your Codebook using LaTeX:
\section{Chapter Title} \subsection{Dijkstra's Algorithm} % Displays algorithm name \lstinputlisting{graph/Dijkstra.cpp} % Relative path to code file \subsection{SPFA Algorithm} \lstinputlisting{graph/SPFA.cpp} % Relative path to code file
-
Push to GitHub: After editing the
content.tex
file, push your changes to GitHub. The GitHub Actions workflow will automatically compile the LaTeX document and generate the PDF. -
Download PDF: Once the workflow completes, you can download the compiled PDF from the GitHub Actions workflow artifacts.
- Docker: Make sure Docker is installed and running on your system to build the LaTeX container.
- GitHub Account: Fork the repository and push your changes to trigger the GitHub Actions workflow.
While the primary setup relies on GitHub Actions, you can also compile the LaTeX document locally using Docker by running the following commands:
-
pull the Docker image:
docker pull ghcr.io/yuankai619/codebook:latest
-
Compile the LaTeX document:
docker run --rm -v $(pwd):/workspace ghcr.io/yuankai619/codebook:latest bash -c "xelatex codebook.tex && xelatex codebook.tex"