| name | csv-to-latex-book |
| description | Convert quiz/practice-test CSV files (Udemy practice-test format or similar MCQ data) into professionally typeset, brand-themed LaTeX PDF books. Use this skill whenever the user wants to turn a CSV of questions into a PDF book, exam book, study guide, practice-test book, or question bank PDF — or mentions "LaTeX book from CSV", "themed PDF", or a company brand theme (NVIDIA, Databricks, Google, Microsoft, GitHub, Oracle, AWS, Claude/Anthropic, IBM, Meta, OpenAI, Salesforce, Intel, Hugging Face, or any other company). Trigger even if the user only says "make my quiz CSV into a nice PDF" without mentioning LaTeX. |
CSV → Branded LaTeX PDF Book
Turn a practice-test CSV into an expert-quality PDF book: branded title page, table of contents, one chapter per domain, question cards with options, highlighted correct answers, per-option explanations, and an overall explanation for every question.
Workflow
-
Inspect the CSV (head -3 file.csv). The script expects the Udemy practice-test format:
Question, Question Type, Answer Option 1..6, Explanation 1..6, Correct Answers, Overall Explanation, Domain.
Column matching is case-insensitive and tolerant of missing option columns. If the CSV uses different column names, rename/map them first with a small Python snippet.
-
Determine the theme. If the user named a company or theme, use it. If the user did NOT specify a theme, always ask which theme they want (list a few built-ins and offer custom). Never silently pick one.
- Built-in themes:
nvidia, databricks, google, microsoft, github, oracle, aws, claude, ibm, meta, openai, salesforce, intel, huggingface.
- Any other company: use
--theme custom --brand-name "Spotify" --primary 1DB954 --dark 191414 --accent 1ED760 with that brand's real colors (look them up if unsure). This is how the skill supports every company, not just the built-ins.
-
Build the book:
python3 scripts/build_book.py INPUT.csv \
--theme nvidia \
--title "NCP-AAI Practice Test" \
--subtitle "Agentic AI Certification — 65 Questions with Explanations" \
--author "Prepared by ..." \
--layout inline \
--output book.pdf
--layout inline (default): answer + explanations directly under each question (study-guide style).
--layout examkey: Part I questions only (exam simulation), Part II full answer key with explanations.
- The script writes the
.tex next to the PDF and runs pdflatex twice (TOC). Requires texlive with tcolorbox.
-
Verify. Check the script's summary output (question/domain counts, pages). If compilation fails, read the .log tail it prints; the usual culprit is an unescaped character — fix the sanitizer map in the script rather than hand-editing the .tex.
-
Deliver the PDF (and the .tex if the user wants to tweak it).
Theme system
Each theme defines four colors used consistently across the book:
| Role | Used for |
|---|
primary | Chapter numbers, question accents, answer boxes, links |
dark | Title-page background, question title bars, headings |
accent | Secondary highlights, title-page rule, badges |
light | Subtle box tints (auto-derived if omitted) |
Built-in palettes live in the THEMES dict at the top of scripts/build_book.py. To add a permanent theme, add one dict entry — nothing else changes.
Quality bar
The output should read like a published exam-prep book, not a data dump: consistent typography (sans-serif corporate look), a stats table in the "About this book" chapter, correct answers marked with letters (A–F), ✓/✗ per-option explanations, and page headers/footers in brand colors. If the user asks for extras (cover tagline, logo image, different paper size), pass --paper letter or edit the generated .tex preamble.