The build system supports three languages out of the box: English (`en_US`), Brazilian Portuguese (`pt_BR`), and Spanish (`es_ES`). A single invocation of `./scripts/build-book.sh` with no arguments produces every supported format (PDF, EPUB, HTML5) in every supported language. Individual formats and languages can be selected with the `--pdf`, `--epub`, `--html`, `--all`, and `--lang` options described below.
> I'm writing this book on a Windows machine using Typora (https://typora.io/), and I'm building the book's PDF and EPUB files on the same Windows laptop via WSL (Windows Subsystem for Linux), which is running Ubuntu.
>
> The Markdown sources are converted to PDF and EPUB using standard open-source tools within that environment. I don’t foresee any problems with this setup; it’s simply the most convenient way for me to work at the moment.
>
> My priority is finishing the content, so I’m using the resources that make life simpler; there’s no room for ideological battles.
>
> If you encounter any platform-specific issues, please open an issue with details, and I’ll take a look. If this approach isn’t to your taste, I’m afraid I won’t be complicating my workflow to accommodate preferences; I’d rather spend that time on the book.
>
> **Development Priority**: My current focus is on completing the book content. Technical improvements to the build system and file format optimizations will be addressed after the book writing is finished to maintain focus and writing momentum.
>
> Thank you
>
> Edson
## Prerequisites
This section provides complete installation instructions for Ubuntu 24.04. All commands assume a fresh system with no pre-installed dependencies.
**Note**: Throughout this document, replace `~/your-project-directory` with the actual path to your project directory.
**Note**: All command-line options are case-insensitive. You can use `--PDF`, `--Pdf`, `--pdf`, or any mixed case variation. Language codes (`en_US`, `pt_BR`, `es_ES`) accept either `-` or `_` as the separator and are also case-insensitive, so `pt_BR`, `pt-BR`, `PT_br`, and `ptbr` all resolve to the same canonical code.
2. Discover all chapters and appendices automatically for every supported language
3. Build the PDF for `en_US`, `pt_BR`, and `es_ES` using the Eisvogel template
4. Build EPUB versions for all three languages
5. Build HTML5 versions for all three languages
6. Place output files in the `public/downloads/` directory, one per language × format (nine files in total)
If a given language has no valid chapter files, that language is skipped with a clear error message, but the build continues for the remaining languages rather than aborting.
Use `--lang CODE` (or `--lang=CODE`) to restrict the build to one or more languages. The flag may be repeated. When `--lang` is omitted, every supported language is built.
| Code | Language |
|---------|-------------------------------|
| `en_US` | English (original manuscript) |
| `pt_BR` | Brazilian Portuguese |
| `es_ES` | Spanish |
| `all` | Every supported language |
```bash
# Build every format in Brazilian Portuguese only
./scripts/build-book.sh --lang pt_BR
# Build every format in Brazilian Portuguese and Spanish
# Equivalent to running with no arguments (all formats, all languages)
./scripts/build-book.sh --all --lang all
```
**Case- and separator-insensitive**: flag names and language codes both accept any case combination (`--PDF`, `--Pdf`, `--pdf` all work the same). Language codes additionally accept `-` or `_` as the separator, so `pt_BR`, `pt-BR`, `PT_br`, `Pt-Br`, and `ptbr` all resolve to the canonical `pt_BR`.
Every generated file is named with the canonical language code suffix so that the three editions can sit side by side in the same output directory. A full build produces nine files (three formats × three languages) under `public/downloads/`:
Each build also sets the appropriate Pandoc/LaTeX `lang` metadata (`en-US`, `pt-BR`, or `es-ES`) so that hyphenation, quotation marks, and other locale-sensitive typography are handled correctly for the chosen language.
The template automatically provides syntax highlighting for:
- **C/C++ code** (primary language for device drivers)
- **Shell scripts** (for build and installation commands)
- **Makefiles** (for kernel module compilation)
- **Configuration files** (for system setup)
### Book Formatting
- **Title page** with custom colors and styling
- **Table of contents** with proper page breaks
- **Chapter numbering** and section organization
- **Professional typography** optimized for technical content
- **Proper margins** and spacing for readability
### Image Handling
**Automatic Image Sizing**: All images are automatically resized to fit within page boundaries using the `header-includes` configuration in `scripts/metadata.yaml`:
While the Eisvogel template is designed specifically for LaTeX/PDF generation, Pandoc can also generate professional HTML5 versions of your book. This provides an alternative format that's easy to share, view in web browsers, and can be hosted online.
### HTML5 Features
- **Professional Styling**: Pandoc default CSS provides clean, professional appearance
- **Tango-style Code Highlighting**: Excellent syntax highlighting for C language code using the Tango theme
The normal way to produce HTML5 is the build script (`./scripts/build-book.sh --html` builds every language, `./scripts/build-book.sh --html --lang pt_BR` builds a single language). If you ever need to invoke Pandoc by hand, the input source tree and the `lang` metadata change with the target language.
**Note**: The `--syntax-highlighting=tango` option (new name for the deprecated `--highlight-style` flag in recent Pandoc releases) provides excellent C language syntax highlighting. Other available styles include: `pygments`, `kate`, `espresso`, `zenburn`, `monochrome`, `breezedark`, and `haddock`. You can list all available styles with `pandoc --list-highlight-styles`.
The build system is designed to be robust and provide clear error messages to help resolve any issues quickly.
## Known Issues and Limitations
This section documents known problems and limitations that exist in the current version of the book content and build system. These issues are being tracked for future improvements.
### 1. **ASCII Diagram Rendering Issues**
**Problem**: ASCII diagrams in the markdown files are not being rendered correctly in the generated PDF. The issue appears to be related to the Eisvogel template's handling of ASCII art and monospace text formatting.
**Symptoms**:
- ASCII diagrams appear as plain text without proper spacing
- Box-drawing characters may not align correctly
- Diagrams may break across page boundaries inappropriately
### 2. **Code Block Page Overflow**
**Problem**: Code blocks with long content (exceeding one page) are not being rendered properly and their content bleeds across page boundaries, making the final PDF difficult to read.
**Symptoms**:
- Code blocks extend beyond page margins
- Long functions or code sections are split awkwardly across pages
- Content appears cut off or overlapping
### 3. **Image Scaling and Placement Limitations**
**Problem**: While the current image handling prevents images from bleeding out of pages, there are limitations in fine-tuning image placement and scaling.
**Current Limitations**:
- Images are automatically scaled to 85% of line width
- Limited control over image positioning within text flow
- No automatic page break optimization for image-heavy sections
### 4. **Template Compatibility Issues**
**Problem**: Some advanced LaTeX features and customizations may conflict with the Eisvogel template's internal structure.
**Known Conflicts**:
- Custom page header/footer modifications
- Complex table formatting
- Advanced mathematical notation
- Custom bibliography styles
### 5. **Performance and Build Time**
**Problem**: Large documents with many images and code blocks can have extended build times and memory usage.
**Current Limitations**:
- Build time increases significantly with document size
- Memory usage can be high for complex documents
- Some LaTeX warnings may appear during compilation
### 6. **Font and Typography Constraints**
**Problem**: While the system supports multiple fonts, there are limitations in font switching and advanced typography features.
**Current Constraints**:
- Limited font fallback options
- Some special characters may not render correctly
**Note**: These limitations are documented to set realistic expectations and help users work around known problems. The build system is functional for most use cases, but awareness of these limitations helps in planning and content preparation.