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
20 changes: 20 additions & 0 deletions src/article_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ def create_parser() -> argparse.ArgumentParser:
action="store_true",
help="Overwrite existing files",
)
init_parser.add_argument(
"--type",
choices=["article", "presentation", "poster"],
default="article",
help="Project type (default: article). Use 'presentation' for Beamer slides.",
)
init_parser.add_argument(
"--theme",
default="",
help="Beamer theme for presentations (e.g., 'numpex', 'metropolis').",
)
init_parser.add_argument(
"--aspect-ratio",
choices=["169", "43", "1610"],
default="169",
help="Aspect ratio for presentations (default: 169 for 16:9).",
)

# Setup command
subparsers.add_parser("setup", help="Setup git hooks for gitinfo2")
Expand Down Expand Up @@ -185,6 +202,9 @@ def handle_init_command(args: argparse.Namespace, config: Config) -> int:
group_id=args.group_id,
force=args.force,
main_tex_file=args.tex_file,
project_type=args.type,
theme=args.theme,
aspect_ratio=args.aspect_ratio,
)
else 1
)
Expand Down
52 changes: 52 additions & 0 deletions src/article_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,29 @@ def get_latex_config(self) -> Dict[str, Any]:
"timeout": self.get("latex", "timeout", 300),
}

def get_project_config(self) -> Dict[str, Any]:
"""Get project-level configuration"""
return {
"project_type": self.get("project", "type", "article"),
}

def get_presentation_config(self) -> Dict[str, Any]:
"""Get presentation-specific configuration (for Beamer)"""
return {
"theme": self.get("presentation", "theme", ""),
"aspect_ratio": self.get("presentation", "aspect_ratio", "169"),
"color_theme": self.get("presentation", "color_theme", ""),
"font_theme": self.get("presentation", "font_theme", ""),
}

def get_poster_config(self) -> Dict[str, Any]:
"""Get poster-specific configuration"""
return {
"size": self.get("poster", "size", "a0"),
"orientation": self.get("poster", "orientation", "portrait"),
"columns": self.get("poster", "columns", 3),
}

def validate_zotero_config(
self, args: argparse.Namespace
) -> Dict[str, Optional[str]]:
Expand Down Expand Up @@ -275,6 +298,35 @@ def create_sample_config(self, path: Optional[Path] = None) -> Path:

# Compilation timeout in seconds
timeout = 300

[project]
# Project type: "article", "presentation", or "poster"
type = "article"

# Presentation-specific settings (only used when type = "presentation")
[presentation]
# Beamer theme (e.g., "numpex", "metropolis", "default")
theme = ""

# Aspect ratio: "169" (16:9), "43" (4:3), or "1610" (16:10)
aspect_ratio = "169"

# Optional: color theme (e.g., "crane", "dolphin")
color_theme = ""

# Optional: font theme (e.g., "professionalfonts")
font_theme = ""

# Poster-specific settings (only used when type = "poster")
[poster]
# Poster size: "a0", "a1", "a2", etc.
size = "a0"

# Orientation: "portrait" or "landscape"
orientation = "portrait"

# Number of columns
columns = 3
"""

try:
Expand Down
Loading