Loading...
Loading...
Generate LaTeX exam cheatsheets from course materials (PDF/PPTX/MD/images). Use when user says "generate cheatsheet", "make a cheat sheet", "create exam reference sheet", "condense notes", or has course materials to turn into a compact LaTeX review sheet for exams.
npx skill4agent add evan715823/cheatsheet-generator-skill cheatsheet-generator${CLAUDE_SKILL_DIR}$ARGUMENTS**/*.pptx**/*.pdf**/*.md**/*.txt**/*.png**/*.jpg**/*.jpegpython "${CLAUDE_SKILL_DIR}/scripts/config_server.py" --workdir "<WORKDIR>"<WORKDIR>/output/.cheatsheet_config.jsonPYTHONIOENCODING=utf-8 python -c "
import fitz, sys
doc = fitz.open(sys.argv[1])
for i, page in enumerate(doc):
text = page.get_text()
if text.strip():
print(f'=== PAGE {i+1} ===')
print(text)
" "<FILE_PATH>"python -c "
import fitz, os, sys
doc = fitz.open(sys.argv[1])
out_dir = os.path.splitext(sys.argv[1])[0] + '_pages'
os.makedirs(out_dir, exist_ok=True)
for i, page in enumerate(doc):
pix = page.get_pixmap(dpi=200)
out = os.path.join(out_dir, f'page_{i+1:03d}.png')
pix.save(out)
print(out)
" "<FILE_PATH>".pptxpython-pptxPYTHONIOENCODING=utf-8 python -c "
from pptx import Presentation
import sys, os
prs = Presentation(sys.argv[1])
for i, slide in enumerate(prs.slides, 1):
print(f'=== SLIDE {i} ===')
for shape in slide.shapes:
if shape.has_text_frame:
for para in shape.text_frame.paragraphs:
text = para.text.strip()
if text: print(text)
if shape.has_table:
for row in shape.table.rows:
cells = [cell.text.strip() for cell in row.cells]
print(' | '.join(cells))
if slide.has_notes_slide and slide.notes_slide.notes_text_frame:
notes = slide.notes_slide.notes_text_frame.text.strip()
if notes: print(f'[Notes: {notes}]')
" "<FILE_PATH>"python -c "
import zipfile, os, sys
pptx_path = sys.argv[1]
out_dir = os.path.splitext(pptx_path)[0] + '_media'
os.makedirs(out_dir, exist_ok=True)
with zipfile.ZipFile(pptx_path) as z:
media = [n for n in z.namelist() if n.startswith('ppt/media/')]
for m in media:
data = z.read(m)
fname = os.path.basename(m)
with open(os.path.join(out_dir, fname), 'wb') as f:
f.write(data)
print(os.path.join(out_dir, fname))
" "<FILE_PATH>"exam_focus${CLAUDE_SKILL_DIR}/templates/cheatsheet_base.tex${CLAUDE_SKILL_DIR}/examples/sample_output.tex.cheatsheet_config.json${CLAUDE_SKILL_DIR}/templates/cheatsheet_base.tex%%PLACEHOLDER%%| Placeholder | Config path | Example |
|---|---|---|
| | |
| | |
| | |
| | |
| same as font size | |
| | |
| look up | Ocean block |
| generated content | ... |
\definecolor{sectionblue}{RGB}{0,51,102}
\definecolor{conceptcyan}{RGB}{0,139,139}
\definecolor{processpurple}{RGB}{128,0,128}
\definecolor{categorygreen}{RGB}{0,128,0}
\definecolor{highlightyellow}{RGB}{255,255,150}\definecolor{sectionblue}{RGB}{21,101,192}
\definecolor{conceptcyan}{RGB}{0,151,167}
\definecolor{processpurple}{RGB}{40,53,147}
\definecolor{categorygreen}{RGB}{0,131,143}
\definecolor{highlightyellow}{RGB}{255,255,150}\definecolor{sectionblue}{RGB}{46,125,50}
\definecolor{conceptcyan}{RGB}{0,105,92}
\definecolor{processpurple}{RGB}{78,52,46}
\definecolor{categorygreen}{RGB}{51,105,30}
\definecolor{highlightyellow}{RGB}{255,255,150}\definecolor{sectionblue}{RGB}{230,81,0}
\definecolor{conceptcyan}{RGB}{191,54,12}
\definecolor{processpurple}{RGB}{136,14,79}
\definecolor{categorygreen}{RGB}{245,127,23}
\definecolor{highlightyellow}{RGB}{255,255,150}\definecolor{sectionblue}{RGB}{55,71,79}
\definecolor{conceptcyan}{RGB}{84,110,122}
\definecolor{processpurple}{RGB}{69,90,100}
\definecolor{categorygreen}{RGB}{96,125,139}
\definecolor{highlightyellow}{RGB}{255,255,150}\concept{term}\process{term}\category{term}\important{text}\section{}\\\par\begin{itemize}...\end{itemize}\\$...$\important{$formula$}\begin{equation}\resizebox{\linewidth}{!}{$...$}\important{}\parboxaligned\[...\]\begin{tabular}{@{}ll@{}}\important{}concisemoderatedetailedinclude_proofsinclude_examplesinclude_derivationsexam_focusfontspec<WORKDIR>/output/cheatsheet.texpython "${CLAUDE_SKILL_DIR}/scripts/editor_server.py" --texfile "<WORKDIR>/output/cheatsheet.tex"EDITOR_SERVER_PORT=<port>curl -s http://127.0.0.1:<PORT>/wait_for_requesttimeout: 600000{"type": "quit"}{"type": "request", "text": "...", "images": [...]}imagespython -c "
import json, sys
with open('<WORKDIR>/output/cheatsheet.tex', 'r', encoding='utf-8') as f:
tex = f.read()
payload = json.dumps({'summary': '<SUMMARY>', 'tex': tex})
sys.stdout.write(payload)
" | curl -s -X POST http://127.0.0.1:<PORT>/result \
-H "Content-Type: application/json" -d @-rm -rf "<WORKDIR>/output/.rendered" "<WORKDIR>/output/.uploads" "<WORKDIR>/output/.converted"*_media/*_pages/rm -rf <WORKDIR>/*_media <WORKDIR>/*_pagesYour cheatsheet is ready at. Compile with XeLaTeX in Overleaf. Good luck on your exam!output/cheatsheet.tex