bookbase
1. Introduction
These are the shared files in my book and teaching material building projects. The files, bibliography, and scripts in this repository are used by several of my writing and teaching projects, including:
The repository offers LaTeX styles for books and slides (with background photos taken from our university), glossary support, my personal bibliography, scripts for compiling books and slides to PDF and to minify those PDFs, listings, support for including files from other git repositories (via texgit), support for Python code and virtual environments, and many more utilities. These are all designed particularly as foundation for my personal projects, tailored to our uni, and so on. However, there might be bits and pieces of code useful for others in here as well.
2. Usage
This repository is not intended for public use. I maintain it only for my personal projects. However, you are free to maybe copy it and copy my workflows. This may be an easy starting point for own books/slides. Or, at least, a stash of "working" methods, a starting point to check how something can be done. Therefore, I here also document how it can be used. If you use it in your projects, this is at your own risk — as said, I only maintain this for myself.
2.1. Mount as Git Submodule
The best way to use bookbase is to mount it into your git repository as submodule. You can do this by entering your Git project's base directory and then executing:
bash
git submodule add https://github.com/thomasWeise/bookbase
Then you can use all the scripts, bibliography, and styles from the package. They will all be in the subfolder bookbase inside your own checked-out repository.
You can update the submodule to stay up-to-date. If you change the files inside the submodule, you can also commit and push them from there.
2.2. Usage in GitHub Actions
You can use the bookbase build process inside a GitHub Action. You would create a directory named .github and inside of that a directory called workflows. Inside .github/workflows, you'd create the file build.yaml as follows:
name: publish
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
with:
submodules: true
- uses: xu-cheng/texlive-action@v3
with:
scheme: full
run: |
apk add cargo gcc linux-headers musl-dev py3-pip python3 python3-dev rust
MAKE_COMMAND
- name: deploy documentation
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
branch: gh-pages
folder: /home/runner/work/REPO_NAME/REPO_NAME/website/
single-commit: true
If you are building a book, you would replace MAKE_COMMAND with
bash
./bookbase/scripts/bookMake.sh pdfFileBaseName bookTitle bookWebsiteBaseURL
If you are building slides, you would replace MAKE_COMMAND with
bash
./bookbase/scripts/slidesMake.sh slidesMainTitle slidesWebsiteBaseURL
In either case, REPO_NAME is to be replaced with the repository name. The slidesWebsiteBaseURL would be the base URL to which your website would be deployed, usually something like https://userName.github.io/repoName, where userName is your GitHub user name in all lower case and repoName is the repository name. Then you finally need to set your repository to deploy a website from the the gh-pages branch.
3. License
With the exceptions below, the files here are under the Attribution-NonCommercial-ShareAlike 4.0 International license (CC BY‑NC‑SA 4.0), see http://creativecommons.org/licenses/by-nc-sa/4.0/ for a summary.
We statically include the pdfsizeopt tool in the GitHub Repository of our books and slides. We did use it during the book compiling and building processes in the past to compress the PDF files. It is still contained for historical reasons, because it produces smaller PDFs at the expense of longer builds. This tool is excluded from the license mentioned above. It is under the GNU GENERAL PUBLIC LICENSE Version 2, June 1991 and the copyright belongs to its authors.
4. Contact
If you have any questions or suggestions, please contact Prof. Dr. Thomas Weise (汤卫思教授) of the School of Artificial Intelligence and Big Data (人工智能与大数据学院) of Hefei University (合肥大学), in Hefei, Anhui, China (中国安徽省合肥市) via email to tweise@hfuu.edu.cn with CC to tweise@ustc.edu.cn.