| name | make-qa-notes |
| description | Create polished standalone LaTeX question-and-answer note documents from textbook exercises, exam questions, review prompts, operating-system or computer-science questions, math problems, code questions, calculation problems, or rough Q&A material. Use when the user asks for Q&A notes, solved questions, numbered question-answer boxes, exercise solutions, practice notes, answer keys with explanations, or LaTeX documents that pair each question with a clear answer. |
Make Q&A Notes
Output Contract
Produce a complete compilable .tex document unless the user asks for selected answers, a snippet, or edits to an existing file. Each question must appear in a numbered question box, followed immediately by the matching answer box. Answers should be direct, correct, and explanatory enough for exam review.
Core Workflow
- Identify the source questions and preserve their order. If the user gives paragraphs that contain multiple questions, split them into separate question-answer pairs.
- If editing an existing
.tex file, read it first and preserve the existing question numbering and style.
- For a new document in this workspace, use
python scripts\new-note.py --subject "<subject>" --topic "<topic>" --type qa when the subject and topic are known, then fill the generated .tex file. If drafting manually, start from templates/qa-note.tex and keep \input{styles/notes-style.tex}.
- Read
references/qa-answer-patterns.md when answers include calculations, code, operating-system concepts, comparisons, safety-sensitive experiments, or ambiguity.
- For each question, write the question text first in
qaquestion, then write the answer in qaanswer.
- Verify numbering, LaTeX syntax, code listings, tables, and calculations before finishing.
Project Folder Convention
Create notes as Subject/<Topic>/<Topic>.tex and put shared images, TikZ snippets, and reusable .tex fragments in Subject/assets/. In note files, reference shared assets as assets/name.png, assets/name.jpg, assets/name.jpeg, assets/name.tikz, or assets/name.tex. The project compiler adds both the subject folder and project root to the LaTeX search path, so assets/... and styles/notes-style.tex resolve correctly.
Answer Rules
- Start with the direct answer, then explain why.
- Preserve the question's meaning and wording. Correct only clear typos or formatting problems.
- State assumptions when the answer depends on units, hardware behavior, indexing, scheduling, API semantics, or textbook convention.
- For calculations, show the formula, substitution, simplification, units, and boxed final answer.
- For "difference between" questions, define both terms first and then state the essential contrast.
- For "give examples" questions, use a table when there are multiple categories.
- For code questions, use
lstlisting and explain the output or behavior after the code.
- For unsafe experiments, include a
warningbox and provide a bounded or safer version.
- Do not add unrelated textbook background that does not help answer the question.
Box and Formatting Rules
- Use only
qaquestion for questions so numbering increments correctly.
- Use only
qaanswer for answers so the answer number matches the current question.
- Use
pointbox for compact notes, classifications, or "key idea" inserts.
- Use
warningbox for caveats, inconsistent problem statements, unsafe actions, or important assumptions.
- Use
\term{...} for important vocabulary.
- Use
tabularx and booktabs for comparison or classification tables.
- Use displayed equations and
\boxed{...} for final results.
- Use
\texttt{...} for inline code, file descriptors, commands, APIs, and constants.
LaTeX Rules
- Keep generated files compile-ready: escape
#, %, &, _, and literal backslashes outside code/listings.
- Do not use Markdown syntax inside
.tex files.
- Avoid putting long prose inside math mode.
- Keep every
qaquestion immediately followed by its corresponding qaanswer.
- Do not manually type "Question 1" or "Answer 1" in the body; the environments handle numbering.
Validation Checklist
Before finishing a Q&A note file:
- Count question-answer pairs and confirm every question has an answer.
- Confirm no answer is attached to the wrong question number.
- Confirm tables have the right number of columns per row.
- Confirm
lstlisting blocks are closed and not placed inside math mode.
- Check arithmetic, units, indexing, and final boxes.
- In this project, prefer
python scripts\compile-latex.py --file path\to\note.tex --engine tectonic --clean for PDF compilation. If it cannot run because the local TeX installation is broken or unavailable, state that compilation was not run and include the script's diagnostic.