From 2c61ccccb082e6a45e719eb9877fe247261212ea Mon Sep 17 00:00:00 2001 From: Markus Graf Date: Mon, 3 Nov 2025 20:29:41 +0100 Subject: [PATCH] fix: improve Swiss letter template localization and formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Disable page numbering (pagenumber=false) to remove "Page 2" footer - Add conditional German language support (babel with ngerman/german) - German labels (Telefon, Anlagen) when texlive-lang-german is installed - Graceful fallback to English labels when language package unavailable - Update documentation to clarify language package as recommended This addresses user feedback about English labels in German letters and unwanted page numbers on multi-page letters. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/.claude/commands/convert-cover-letter.md | 11 +++++++--- src/.claude/templates/swiss-letter.tex | 23 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/.claude/commands/convert-cover-letter.md b/src/.claude/commands/convert-cover-letter.md index 7f40141..e8aab1f 100644 --- a/src/.claude/commands/convert-cover-letter.md +++ b/src/.claude/commands/convert-cover-letter.md @@ -91,14 +91,17 @@ LaTeX (pdflatex) is required for PDF generation but is not installed. ### Ubuntu/Debian: sudo apt update -sudo apt install texlive-latex-base texlive-lang-german texlive-latex-extra +sudo apt install texlive-latex-base texlive-latex-extra + +# For German language support (recommended for proper labels): +sudo apt install texlive-lang-german ### macOS (Homebrew): brew install texlive # Note: This is a large download (~4GB). Alternative: MacTeX from https://www.tug.org/mactex/ ### Arch Linux: -sudo pacman -S texlive-core texlive-latexextra +sudo pacman -S texlive-core texlive-latexextra texlive-langgerman ### Windows: # Install MiKTeX from: https://miktex.org/download @@ -108,9 +111,11 @@ sudo pacman -S texlive-core texlive-latexextra **Required packages**: - texlive-latex-base (core LaTeX) -- texlive-lang-german (Swiss German hyphenation and spelling) - texlive-latex-extra (KOMA-Script including scrlttr2) +**Recommended packages**: +- texlive-lang-german (German labels: "Telefon" instead of "Phone", "Anlagen" instead of "encl") + After installation, run: pdflatex --version Then try /convert-cover-letter again. ``` diff --git a/src/.claude/templates/swiss-letter.tex b/src/.claude/templates/swiss-letter.tex index 274af46..1485180 100644 --- a/src/.claude/templates/swiss-letter.tex +++ b/src/.claude/templates/swiss-letter.tex @@ -9,6 +9,7 @@ fromalign=right, % Sender address aligned right fromphone, % Include phone number fromemail, % Include email address + pagenumber=false, % Disable page numbers version=last % Use latest KOMA-Script features ]{scrlttr2} @@ -32,6 +33,28 @@ \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +% ==================== LANGUAGE SUPPORT ==================== +% Try to load German language support if available +% This provides proper German labels (Telefon, Anlagen) and hyphenation +% +% If german.ldf is found: Labels will be in German +% If not found: Labels will be in English (Phone, encl) +% +% To install German support: +% Ubuntu/Debian: sudo apt install texlive-lang-german +% Arch: sudo pacman -S texlive-langgerman +% macOS/Windows: Included in full TeX Live installation +\IfFileExists{ngerman.ldf}{% + \usepackage[ngerman]{babel} +}{% + \IfFileExists{german.ldf}{% + \usepackage[german]{babel} + }{% + % No German language files found + % Labels will be in English (Phone, encl) without language package + } +} + % ==================== SWISS LETTER CONFIGURATION ==================== % Load Swiss Norm (SN) for proper address window positioning % This ensures the recipient address fits in standard Swiss envelope windows