books/Template
Template
1
0

add license file and comprehensive README detailing usage and features

This commit is contained in:
Arindy 2025-09-21 18:41:17 +02:00
parent 1d286905e5
commit d2e6b72161
2 changed files with 222 additions and 0 deletions

28
LICENSE Normal file
View File

@ -0,0 +1,28 @@
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
LaTeX Book Template
Copyright (c) 2025 Arindy
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- NonCommercial — You may not use the material for commercial purposes.
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
---
This template is based on the eBook template from LaTeXTemplates.com, originally created by Vel, with modifications by Arindy. The original template is also licensed under CC BY-NC-SA 3.0.

194
README.md Normal file
View File

@ -0,0 +1,194 @@
# LaTeX Book Template
A professional LaTeX book template with automated CI/CD pipeline for generating multiple output formats including PDF, ePub, ODT, and DOCX. This template provides a clean, modern layout with customizable styling and automatic release generation.
## Features
- 📚 Multiple output formats: PDF (one-sided, two-sided, ebook), ePub, ODT, DOCX
- 🎨 Professional typography using Libertine font with microtype improvements
- 📄 Custom page layouts with headers, footers, and margins optimized for different formats
- 🖼️ Cover page support with background images and work-in-progress watermarks
- ⚡ Automated CI/CD pipeline with timestamped releases
- 🔧 Easy customization through structured LaTeX files
- 🐳 Docker-based build environment for consistent compilation
## Quick Start
### Prerequisites
- **Local build**: LaTeX distribution (TeX Live, MiKTeX) with `pdflatex` and `pandoc`
- **Docker build**: Docker (recommended for consistent results)
- **CI/CD**: Gitea instance with Actions enabled
### Usage
1. **Clone this template:**
```bash
git clone <your-repo-url>
cd template
```
2. **Customize your book:**
- Edit `src/book.tex` to set author, title, and subtitle
- Add/modify chapters in `src/chapters/`
- Replace `src/graphics/cover.jpg` with your cover image
- Remove `\workinprogress` command when ready for final version
3. **Build locally:**
```bash
# Build all formats
make book
# Or build specific formats
make oneside.pdf # One-sided PDF
make twosides.pdf # Two-sided PDF
make ebook.pdf # eBook PDF
make book.epub # ePub format
make book.odt # OpenDocument Text
make book.docx # Microsoft Word
```
4. **Clean build artifacts:**
```bash
make clean
```
## Project Structure
```
.
├── Makefile # Build automation
├── README.md # This file
├── src/ # LaTeX source files
│ ├── book.tex # Main book file (edit this)
│ ├── chapters/ # Individual chapters
│ │ └── one.tex # Example chapter
│ ├── graphics/ # Images and cover art
│ │ └── cover.jpg # Book cover image
│ └── .formats/ # LaTeX formatting templates
│ ├── structure.tex # Core styling and layout
│ ├── ebook.tex # eBook format template
│ ├── oneside.tex # One-sided format template
│ └── twosides.tex # Two-sided format template
├── out/ # Generated output files
└── .github/
└── workflows/
└── ci.yaml # CI/CD pipeline
```
## Customization
### Book Metadata
Edit `src/book.tex`:
```latex
\author{Your Name}
\title{Your Book Title}
\subtitle{Your Subtitle}
```
### Removing Work-in-Progress Watermark
Comment out or remove this line from `src/book.tex`:
```latex
%\workinprogress
```
### Removing Title Box from Cover
Use the `\removetitlebox` command to remove the white semi-transparent title box overlay from the cover page, leaving only the background image. This creates a cleaner cover design where the background image is fully visible without any text overlay. Add this line to `src/book.tex`:
```latex
\removetitlebox
```
**Note:** When `\removetitlebox` is active, only the work-in-progress watermark (if enabled) will be displayed on the cover. The book title, author, and subtitle will not appear on the cover page.
### Adding Chapters
1. Create new `.tex` files in `src/chapters/`
2. Include them in `src/book.tex`:
```latex
\include{chapters/your-new-chapter}
```
### Custom Styling
Modify `src/.formats/structure.tex` to customize:
- Fonts and typography
- Page layouts and margins
- Chapter and section formatting
- Colors and styling
## CI/CD Pipeline
The template includes automated building and releasing:
- **Triggers:** Push to any branch, pull requests
- **Build Environment:** Custom LaTeX Docker image (`git.arindy.de/arindy/latex-runner:1.0.1`)
- **Output:** Automatic releases with timestamped names containing all formats
- **Files Released:** All generated files from the `out/` directory
### Customizing CI/CD
Edit `.github/workflows/ci.yaml` to:
- Change the Docker image
- Modify release naming
- Add additional build steps
- Configure different triggers
## Download Latest Release
- [EBook as ePub](/../../../releases/download/latest/ebook.epub)
- [EBook as PDF](/../../../releases/download/latest/ebook.pdf)
- [Book as a one-sided PDF](/../../../releases/download/latest/oneside.pdf)
- [Book as a two-sided PDF](/../../../releases/download/latest/twosides.pdf)
- [Book as ODT](/../../../releases/download/latest/book.odt)
- [Book as DOCX](/../../../releases/download/latest/book.docx)
## Contributing
1. Fork this repository
2. Create a feature branch
3. Make your changes
4. Test the build process
5. Submit a pull request
## License
This LaTeX Book Template is licensed under the **Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License (CC BY-NC-SA 3.0)**. See the [LICENSE](LICENSE) file for the complete license text.
### What the License Covers
The CC BY-NC-SA 3.0 license applies to **all template files**, including:
- LaTeX source files (`src/` directory)
- Build configuration (`Makefile`, CI/CD workflows)
- Documentation and examples
- Styling and formatting templates
### License Terms Summary
**You are free to:**
- ✅ **Share** — Copy and redistribute the template in any medium or format
- ✅ **Adapt** — Modify, remix, and build upon the template for your own books
**Under these conditions:**
- 📝 **Attribution** — Credit the original creators (Vel from LaTeXTemplates.com and Arindy)
- 🚫 **NonCommercial** — You may not use this template for commercial purposes
- 🔄 **ShareAlike** — If you distribute modified versions, use the same CC BY-NC-SA 3.0 license
### Important Notes
- **Your book content** (text, images you add) is **not covered** by this license
- You retain full rights to your own written content
- The license only applies to the template structure and code
- For commercial use, please contact the maintainers
This template is based on the eBook template from LaTeXTemplates.com, originally created by Vel, with modifications by Arindy.
## Troubleshooting
### Build Errors
- Check LaTeX logs in `out/*.log` files
- Ensure all required packages are installed
- Verify image files exist and are accessible
### Missing Fonts
The template uses Libertine font. Install it or modify `src/.formats/structure.tex` to use different fonts.
### Docker Issues
If using the CI pipeline, ensure your Gitea instance has access to the specified Docker image or modify the workflow to use a public LaTeX image.