| Author | John Haverlack |
| Version | 1.1.0 |
| Date | 2026-02-04 |
| Affiliation | Alaska Center for Energy and Power |
| Institution | University of Alaska Fairbanks |
| ISBN: | UNSPECIFIED |
| DOI: | UNSPECIFIED |
| Maturity | BETA |
Copyright © 2026 Alaska Center for Energy and Power
Licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License
This is a basic book (or article / document) builder template based on a Pandoc(Pandoc - Index, n.d.) build process in conjunction with a number of other tools to generate PDF, HTML, LaTex, Markdown, ODT, DOCX, and Epub book output formats from a single set Markdown source content , which can optionally be edited as an Obsidian vault.
This basic book builder(Jehaverlack/Basic-Book-Builder, n.d.) template has been curated by John Haverlack.(John Haverlack ACEP, n.d.)
Clone the repository
git clone https://github.com/jehaverlack/basic-book-builder.git
Navigate to the repo directory
cd basic-book-builder
~Debian Linux
This script only support Debian based Linux system (Debian, Ubunutu, Zorin, etc) This script has not been widely tested across platforms
Setup Build Environment
./scripts/setup-linux-deb.sh
For more information on setting up the build environment for your system see Appendix A.
If you can build all format for the Basic Book Build then you have a working build environment.
Testing Build Environment
make all
To create a new Project based on the Basic Book Builder template:
./scripts/new-project.sh <PATH_TO_PROJECT>
cd <PATH_TO_PROJECT>
Update:
metadata.yamltemplates/pandoc.yamlSuggestion
Create a git repository to version control your new
Edit your source content Markdown under the chapters
directory.
Optional
<PATH_TO_PROJECT> directory as an
Obsidian vault.make pdf
NOTE: Building the PDF also builds the LaTeX version of the book.
make html
make docx
NOTE: DocX is a work in progress. Frontmatter and formatting need work.
make odt
NOTE: ODT is a work in progress. Frontmatter and formatting need work.
To build all supported formats
make all
Metadata for the project is managed in metadata.yaml.
Edit this file to make global changes to variables for your document.
Changes here will propagate to all format builds.
Front matter content is manged in:
templates/frontmatter.textemplates/frontmatter.htmltemplates/frontmatter-md.htmlTip
Unfortunately when you edit one, you need to edit the respective changes to the other front-matter formats. ### Title Page
Edit the Front-matter files to modify the formatting of the Title Page.
Tip
You’ll need to modify the HTML / LaTex.
Edit the Front-matter files to modify the 2nd page Metadata format.
Edit the Front-matter files to optionally un-comment the Cover Art Acknowledgement.
Edit the Front-matter files to modify un-comment the Book Dedication.
Chapter Markdown source files are located in the
chapters directory. Edit the
template\pandoc.yaml file to control which chapter markdown
files are in what order.
TBD
TBD
TBD
TBD
TBD
TBD
TBD
TBD
TBD
TBD
TBD
A few call-out box styles have been custom added to easily highlight certain types of content.
Markdown Example
[!established] Green Call-out Title
A green box
Will render:
Green Call-out Title
A green box
Markdown Example
[!proposed] Blue Call-out Title
A blue box
Will render:
Blue Call-out Title
A blue box
Markdown Example
[!info] Info Box
Same as a blue box
Will render:
Info Box
Same as a blue box
Markdown Example
[!speculative] Purple Call-out Title
A purple box
Will render:
Purple Call-out Title
A purple box
Markdown Example
[!caution] Caution Note
Beware of this section. AKA a orange box.
Will render:
Caution Note
Beware of this section. AKA a orange box.
Markdown Example
[!warning] Warning Note
Same as the Caution Box
Will render:
Warning Note
Same as the Caution Box
Markdown Example
[!danger] Alert
A slightly stronger warning. AKA a red box.
Will render:
Alert
A slightly stronger warning. AKA a red box.
Markdown Example
[!code] Code Block
'''
if [ true ]; do
echo "The Cow Jumps over the Moon"
fi
'''
Will render:
Code Block
if [ true ]; do
echo "The Cow Jumps over the Moon"
fi
Markdown Example
[!cli] Command line
A command line example
'''
$ ls
build chapters conf filters lib LICENSE.md Makefile metadata.yaml >README.md scripts templates
'''
Will render:
Command line
A command line example
$ ls
build chapters conf filters lib LICENSE.md Makefile metadata.yaml README.md scripts templates
Appendix A
Not Cross-platform Tested
For Debian / ZorinOS and likely Ubuntu based systems.
sudo apt install https://github.com/jgm/pandoc/releases/download/3.8.2.1/pandoc-3.8.2.1-1-amd64.deb
Code Editor
VSCodium is recommend for privacy (telemetry/tracking) reasons - https://vscodium.com/
But any text editor will work. #### make
sudo apt install make
sudo apt install jq yq
sudo apt install texlive texlive-xetex texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra
wget https://registry.npmjs.org/mathjax/-/mathjax-3.2.2.tgz
tar xzf mathjax-3.2.2.tgz
mv package/es5/* lib/mathjax
rm -rf package mathjax-3.2.2.tgz
TODO
This need to be rolled into a setup script.
The following are not strictly requires to use this book builder template.
Highly Recommended
Editing book chapter content in Obsidian is a very productive means for editing Markdown source content.
sudo apt install https://github.com/obsidianmd/obsidian-releases/releases/download/v1.9.14/obsidian_1.9.14_amd64.deb
Highly Recommended
If you need to managed citations and references, Zotero integration is highly recommended.
sudo cp ./scripts/deps/zotero.list /etc/apt/sources.list.d/
sudo apt update
sudo apt install zotero
Install the Better BibTex Plugin for Zotero - Zotero > Tool > Plugins
Provides you the ability to auto add Web resources to your Zotero citation database.
sudo apt install lmodern
sudo apt install epubcheck
An EPub Reader
sudo apt install https://github.com/johnfactotum/foliate/releases/download/2.6.4/com.github.johnfactotum.foliate_2.6.4_all.deb
An EPub Reader
sudo apt install calibre
| Term | Description |
|---|---|
| AST (Abstract Syntax Tree) | Pandoc’s internal structured representation of a document. Lua filters operate on the AST before rendering to a target format. |
| Bibliography | A .bib file (e.g., Zotero export) used by Pandoc with
citeproc to generate formatted citations and reference
lists. |
| Callout | A styled block (e.g., [!warning]) transformed by Lua
filters into format-specific output such as LaTeX environments or HTML
<div> elements. |
| Defaults File (YAML) | A Pandoc configuration file defining output format, filters,
metadata, and rendering options (e.g., pdf.yaml,
html.yaml). |
| DOCX | Microsoft Word document format generated by Pandoc; styling is
controlled via a reference.docx file. |
| Filter (Lua) | A script that modifies Pandoc’s AST before rendering. Used in this workflow for callouts and other structural transformations. |
| Frontmatter | Format-specific content inserted before the main body (e.g.,
frontmatter.tex, frontmatter.html,
frontmatter-docx.md). |
| HTML | Web output format generated by Pandoc, typically styled via CSS and supporting interactive features. |
| LaTeX | Typesetting system used for high-quality PDF generation via XeLaTeX in this workflow. |
| Lua Filter | A lightweight scripting extension used by Pandoc to customize document transformations programmatically. |
| Makefile | Automation script orchestrating the build pipeline for PDF, HTML, DOCX, ODT, and Markdown outputs. |
| Markdown | Plain-text markup language serving as the source format for all outputs in the workflow. |
| Metadata | Key–value pairs (e.g., metadata.yaml) defining title,
author, license, version, and other document variables. |
| ODT | OpenDocument Text format used by LibreOffice; similar to DOCX but open-standard. |
| Pandoc | Universal document converter used to transform Markdown into PDF, HTML, DOCX, ODT, EPUB, and more. |
| Portable Document Format output produced via Pandoc + XeLaTeX. | |
| Reference Document | A DOCX or ODT file defining styles (fonts, headings, spacing) used when generating Word/LibreOffice outputs. |
| Resource Path | Directories Pandoc searches for images, diagrams, and other assets during rendering. |
| Template | A format-specific layout file (e.g., LaTeX template) used to control document structure beyond styling. |
| TOC (Table of Contents) | Automatically generated navigation structure controlled by
toc and toc-depth options. |
| XeLaTeX | LaTeX engine used to generate PDFs with modern font support (via
fontspec). |
| Zotero | Reference manager used to generate .bib files for
citation processing with Pandoc. |