Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.4.0] - 2026-01-18

### Added
- **Typst Support**: Full support for Typst document compilation
- New `TypstCompiler` class for Typst document compilation
- `article-cli compile presentation.typ` - Compile Typst documents
- `article-cli compile --engine typst --watch` - Watch mode for Typst
- `article-cli compile --font-path fonts/` - Custom font paths for Typst
- Auto-detection of `.typ` files and automatic engine selection
- Font path configuration via `[typst]` section in config
- **Typst Project Types**: Initialize Typst projects with templates
- `article-cli init --type typst-presentation` - Create Typst presentation
- `article-cli init --type typst-poster` - Create Typst poster
- Theme support for Typst presentations (e.g., numpex theme)
- **Enhanced Theme Installation**: Themes now include Typst files
- `numpex.typ` included alongside LaTeX `.sty` files
- Usage instructions shown for both LaTeX and Typst
- New `get_typst_config()` method in Config class
- 23 new tests for Typst functionality

### Changed
- Theme sources now include `typst_files` list alongside `files`
- Updated CLI help with Typst examples
- Description updated to mention Typst support

## [1.3.2] - 2025-12-08

### Fixed
Expand Down Expand Up @@ -195,6 +220,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `article-cli config show` - Show current configuration
- `article-cli config create` - Create sample configuration

[1.4.0]: https://github.com/feelpp/article.cli/releases/tag/v1.4.0
[1.3.2]: https://github.com/feelpp/article.cli/releases/tag/v1.3.2
[1.3.1]: https://github.com/feelpp/article.cli/releases/tag/v1.3.1
[1.3.0]: https://github.com/feelpp/article.cli/releases/tag/v1.3.0
Expand Down
78 changes: 70 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
[![PyPI version](https://badge.fury.io/py/article-cli.svg)](https://badge.fury.io/py/article-cli)
[![Python Support](https://img.shields.io/pypi/pyversions/article-cli.svg)](https://pypi.org/project/article-cli/)

A command-line tool for managing LaTeX articles and presentations with git integration and Zotero bibliography synchronization.
A command-line tool for managing LaTeX and Typst documents with git integration and Zotero bibliography synchronization.

## Features

- **Repository Initialization**: Complete setup for LaTeX article or presentation projects with one command
- **Project Types**: Support for articles, Beamer presentations, and posters
- **Repository Initialization**: Complete setup for LaTeX or Typst projects with one command
- **Project Types**: Support for articles, Beamer presentations, posters, and Typst documents
- **LaTeX Compilation**: Compile documents with latexmk/pdflatex/xelatex/lualatex, watch mode, shell escape support
- **Typst Compilation**: Full support for Typst documents with watch mode and custom font paths
- **Font Installation**: Download and install fonts for XeLaTeX projects (Marianne, Roboto Mono, etc.)
- **GitHub Actions Workflows**: Automated PDF compilation with XeLaTeX support, artifact upload, and GitHub releases
- **Git Release Management**: Create, list, and delete releases with gitinfo2 support
Expand Down Expand Up @@ -131,8 +132,13 @@ directory = "."
# url = "https://example.com/theme.zip"
# description = "My custom theme"
# files = ["beamerthememytheme.sty"]
# typst_files = ["mytheme.typ"]
# requires_fonts = false
# engine = "pdflatex"

[typst]
font_paths = ["fonts/", "~/.fonts/"]
build_dir = "build"
```

## Usage
Expand All @@ -149,6 +155,12 @@ article-cli init --title "My Presentation" --authors "Author" --type presentatio
# Initialize with numpex theme (requires theme files from presentation.template.d)
article-cli init --title "NumPEx Talk" --authors "Author" --type presentation --theme numpex

# Initialize a Typst presentation project
article-cli init --title "My Typst Talk" --authors "Author" --type typst-presentation

# Initialize a Typst poster project
article-cli init --title "My Typst Poster" --authors "Author" --type typst-poster

# Specify custom Zotero group ID
article-cli init --title "My Article" --authors "Author" --group-id 1234567

Expand Down Expand Up @@ -224,6 +236,32 @@ article-cli compile --clean-first --clean-after
article-cli compile --output-dir build/
```

### Typst Compilation

```bash
# Compile a Typst document (auto-detects .typ files)
article-cli compile presentation.typ

# Compile with explicit Typst engine
article-cli compile --engine typst document.typ

# Watch for changes and auto-recompile
article-cli compile presentation.typ --watch

# Specify custom font paths
article-cli compile presentation.typ --font-path fonts/

# Multiple font paths
article-cli compile presentation.typ --font-path fonts/ --font-path ~/.fonts/

# Specify output directory
article-cli compile presentation.typ --output-dir build/
```

**Note:** The engine is automatically detected from the file extension:
- `.tex` files use LaTeX engines (latexmk by default)
- `.typ` files use the Typst engine

### Font Installation

Install fonts for XeLaTeX projects (useful for custom Beamer themes):
Expand Down Expand Up @@ -268,9 +306,11 @@ article-cli install-theme my-theme --url https://example.com/theme.zip
```

**Available themes:**
- **numpex**: NumPEx Beamer theme following French government visual identity (requires XeLaTeX and custom fonts)
- **numpex**: NumPEx theme following French government visual identity
- LaTeX: Beamer theme files (requires XeLaTeX and custom fonts)
- Typst: `numpex.typ` theme file for Typst presentations

**Complete presentation setup:**
**Complete LaTeX presentation setup:**
```bash
# 1. Install the theme
article-cli install-theme numpex
Expand All @@ -282,6 +322,15 @@ article-cli install-fonts
article-cli compile presentation.tex --engine xelatex
```

**Complete Typst presentation setup:**
```bash
# 1. Install the theme (includes numpex.typ)
article-cli install-theme numpex

# 2. Compile with Typst
article-cli compile presentation.typ --font-path fonts/
```

### Project Setup

```bash
Expand Down Expand Up @@ -313,6 +362,7 @@ Release versions must follow the semantic versioning format:
- Python 3.8+
- Git repository with gitinfo2 package (for LaTeX integration)
- Zotero account with API access (for bibliography features)
- Typst CLI (for Typst compilation) - install from https://typst.app/

## License

Expand All @@ -328,12 +378,24 @@ MIT License - see LICENSE file for details.

## Changelog

### v1.2.0
- Add font installation command (`install-fonts`) for XeLaTeX projects
- Support Marianne and Roboto Mono fonts by default
### v1.4.0
- Add full Typst document compilation support
- New `TypstCompiler` class for Typst documents
- Auto-detection of `.typ` files with automatic engine selection
- Watch mode for Typst with live recompilation
- Custom font path support (`--font-path` option)
- New project types: `typst-presentation` and `typst-poster`
- Theme installation now includes Typst files (e.g., `numpex.typ`)
- Typst configuration section in config files

### v1.3.0
- Add theme installation command (`install-theme`) for Beamer presentations
- Built-in support for numpex theme with automatic download
- Extended GitHub Actions workflow with XeLaTeX and multi-document support

### v1.2.0
- Add font installation command (`install-fonts`) for XeLaTeX projects
- Support Marianne and Roboto Mono fonts by default
- Add presentation project type with Beamer template support
- Add `--engine` option for xelatex and lualatex compilation
- Improved CI/CD with font installation steps
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ build-backend = "hatchling.build"

[project]
name = "article-cli"
version = "1.3.2"
version = "1.4.0"
authors = [
{name = "Christophe Prud'homme", email = "prudhomm@cemosis.fr"},
]
description = "CLI tool for managing LaTeX articles with git integration and Zotero bibliography"
description = "CLI tool for managing LaTeX and Typst documents with git integration and Zotero bibliography"
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.8"
Expand All @@ -26,7 +26,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
"Topic :: Text Processing :: Markup :: LaTeX",
]
keywords = ["latex", "git", "zotero", "bibliography", "academic", "research"]
keywords = ["latex", "typst", "git", "zotero", "bibliography", "academic", "research", "presentations"]
dependencies = [
"requests>=2.28.0",
]
Expand Down
11 changes: 7 additions & 4 deletions src/article_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""
Article CLI - A command-line tool for managing LaTeX articles
Article CLI - A command-line tool for managing LaTeX and Typst documents

This package provides tools for:
- Git release management with gitinfo2 support
- Zotero bibliography synchronization
- LaTeX build file cleanup
- Git hooks setup
- LaTeX and Typst compilation
- Theme installation for presentations
- Git hooks setup
"""

__version__ = "1.3.2"
__version__ = "1.4.0"
__author__ = "Christophe Prud'homme"
__email__ = "prudhomm@cemosis.fr"

Expand All @@ -18,6 +19,7 @@
from .git_manager import GitManager
from .repository_setup import RepositorySetup
from .latex_compiler import LaTeXCompiler
from .typst_compiler import TypstCompiler

Comment on lines +22 to 23
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TypstCompiler class is imported but the module typst_compiler.py does not exist in the codebase. This will cause an ImportError when the package is imported or when the compile command is used with Typst files. The missing module needs to be created with a TypstCompiler class that implements the compile method with the signature used in cli.py (typ_file, output_dir, font_paths, watch parameters).

Suggested change
from .typst_compiler import TypstCompiler
try:
from .typst_compiler import TypstCompiler
except ImportError:
class TypstCompiler:
"""
Fallback TypstCompiler used when the typst_compiler module is not available.
This class exposes the expected interface but will raise a NotImplementedError
if compile is called, indicating that Typst support is not installed.
"""
def compile(self, typ_file, output_dir, font_paths=None, watch=False):
"""
Compile a Typst file.
Parameters
----------
typ_file : str or pathlib.Path
Path to the Typst source file.
output_dir : str or pathlib.Path
Directory where compiled output should be written.
font_paths : list[str] or list[pathlib.Path], optional
Additional font search paths for the compiler.
watch : bool, optional
If True, recompile automatically when sources change.
"""
raise NotImplementedError(
"TypstCompiler is not available because 'typst_compiler' module "
"could not be imported. Ensure typst_compiler.py is present and "
"provides a TypstCompiler implementation."
)

Copilot uses AI. Check for mistakes.
__all__ = [
"main",
Expand All @@ -26,4 +28,5 @@
"GitManager",
"RepositorySetup",
"LaTeXCompiler",
"TypstCompiler",
]
Loading