This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
University course materials repository for "Introduction to Planetary Science" at the Kapteyn Astronomical Institute of the University of Groningen. The main lecturer is Tim Lichtenberg from the Kapteyn Institute. This course is a BSc Astronomy mandatory course for 2nd-year students, covering fundamental concepts in planetary science, including planet formation, solar system dynamics, exoplanets, and astrobiology. The repository contains lecture notes, figures, and planning documents for the course. The lecture notes are written in MyST Markdown and built into HTML and PDF formats using Jupyter Book. The course emphasizes scientific accuracy, proper citation of sources, and clear explanations suitable for undergraduate students.
book/— Jupyter Book source (MyST Markdown lecture notes, built to HTML and PDF)book/_config.yml— Jupyter Book configuration (XeLaTeX, MathJax3, bibliography)book/_toc.yml— Table of contentsbook/intro.md— Landing pagebook/01_introduction/throughbook/14_synthesis/— 14 lecture chapters, each with a.mdfile andfigures/directorybook/references.bib— BibTeX bibliographybook/_static/custom.css— Custom styles
planning/— Curriculum outlines and course planning documentscontent/course2025— Symlink to Google Drive containing previous lecture materials (slides, data, etc.); gitignored and not tracked.github/workflows/book.yml— GitHub Actions workflow deploying HTML to GitHub Pages
- *Always check and update
planning/course_development.mdwhen making any changes to the lecture content, schedule, or curriculum. This document serves as the master plan for the course and must reflect the current state of development. - When editing lecture content, ensure scientific accuracy by verifying all claims against authoritative sources and citing them properly in the
## Referencessection. - When adding new lectures or sections, maintain the established structure and formatting conventions (MyST Markdown, math macros, citation style).
- When searching for literature to cite, prioritize peer-reviewed journal articles, review papers, and authoritative databases (NASA, IAU) over textbooks or web sources. Always include a DOI when available.
- When looking for literature, check
content/booksfor authorative sources, but verify that they are still accurate and relevant before citing. - When looking for literature, check
content/course2025for previously used sources and lecture materials, but verify that they are still accurate and relevant before citing. - When looking for literature, use the NASA ADS database (https://ui.adsabs.harvard.edu/) to find recent papers on planetary science topics. Use the
bibtexexport option to generate BibTeX entries for new sources. - Give extra weight to the articles and referenced papers in
https://ui.adsabs.harvard.edu/public-libraries/L2e3RhUYQnqmpIyMpWUG3A. In particular, the review articles in that library are likely to be highly relevant and authoritative sources for content and/or point to the most reliable sources. - When adding or editing content, ensure that all numerical values, equations, and historical claims are verified against primary sources or authoritative databases. Do not rely on training data alone for factual accuracy.
- All lectures should have good visuals (figures, diagrams) where appropriate. When adding figures, ensure they are properly referenced in the text and included in the
figures/directory of the corresponding lecture. - For all figures prioritize original sources (e.g., from NASA missions, published papers; take the figures from arXiv) and figures from the public domain. Ensure proper attribution in the caption. Avoid using low-quality or uncredited images.
- For figures, you can also use (cut out or screenshot) figures from
contents/booksandcontents/course2025if they are relevant and properly cited, but verify that they are still accurate and up to date before including them in the lecture notes. - Double and triple check all citations for accuracy, including author names, publication year, journal, and DOI. Do not invent DOIs — if unsure whether a DOI exists, omit it and flag for manual verification with a comment:
% TODO: verify DOI. - Double and triple check all links (DOIs, URLs) to ensure they resolve correctly. For web resources, use the most stable/canonical URL available and note the access date in the BibTeX
notefield if the content is known to change frequently. - Double and trip check all math equations for dimensional consistency and physical correctness. After writing a derivation, verify that the units on both sides match and check limiting cases to ensure the equation behaves as expected.
Uses Jupyter Book v1 (jupyter-book<2) with Sphinx backend. Dependencies in pyproject.toml.
Requires Python 3.12+.
pip install .make html # Build browsable HTML → book/_build/html/
make pdf # Build PDF via pdfhtml → book/_build/pdf/
make pdflatex # Build PDF via XeLaTeX → book/_build/latex/
make slides # Build slide PDFs → slides/lectureNN/lectureNN.pdf
make clean # Remove build artifacts + generated PNGsBuild artifacts in book/_build/ are gitignored. The pdflatex and slides targets auto-convert AVIF→PNG at build time (XeLaTeX cannot read AVIF natively).
HTML is auto-deployed to GitHub Pages on push to main:
https://formingworlds.github.io/IntroductionToPlanetaryScience/
- The course covers 14 lectures spanning planet formation through exoplanets and astrobiology (see
planning/course_development.mdfor full curriculum, schedule, homework, and exam structure). - Each lecture includes a ~10 min blackboard derivation of a foundational concept.
- Lecture notes use MyST Markdown with cross-reference labels
(lecture01)=through(lecture14)=. - Math macros are defined in both
mathjax3_config(HTML) andlatex_elements.preamble(PDF) in_config.yml— new macros must be added to both. - The
physicsLaTeX package conflicts with Sphinx output; custom\dv,\dd,\pdvmacros are used instead. - LaTeX packages available:
amsmath,amssymb. - Custom math macros defined in
_config.yml(available in both HTML and PDF):\dv{f}{x}— total derivative,\dd— differential d,\pdv{f}{x}— partial derivative\Msun,\Rsun,\Lsun— solar mass, radius, luminosity\Mearth,\Rearth— Earth mass, radius\Mjup,\Rjup— Jupiter mass, radius\kB— Boltzmann constant
- The
sphinx-proofextension is loaded, providing theorem-like directives:{prf:theorem},{prf:proof},{prf:definition},{prf:example}, etc. - Figures live in
<lecture_dir>/figures/and are referenced with MyST syntax:```{figure} figures/filename.avif``` - All raster images must use AVIF format (
.avif). Do not commit JPEG or PNG files — convert to AVIF first usingmagick input.jpg -quality 65 output.avif. SVG vector graphics are kept as-is. See the "Image format" section below for details.
Each lecture .md file in book/ must end with a dedicated ## References section that lists all sources cited in that lecture. This section:
-
Appears as the final section of the lecture, after all content sections
-
Uses BibTeX citations via
sphinxcontrib-bibtex(configured inbook/_config.yml) -
All BibTeX entries live in
book/references.bib(the single shared bibliography file) -
Citations in the text use MyST syntax with explicit Chicago author-date roles (see Citation style below)
-
The references section renders the bibliography for that lecture using:
## References ```{bibliography} :filter: docname in docnames ```
The
:filter: docname in docnamesdirective ensures only sources cited in that specific lecture are listed — not the entire bibliography.
This project uses Chicago author-date citation style, configured in _config.yml as bibtex_reference_style: author_year. All citations must use explicit roles — do not use the bare {cite}`key` form.
Use {cite:p}`key` for citations that appear as a parenthetical reference at the end of a clause or sentence. This renders as (Author, Year).
The disk lifetime is roughly 3–5 Myr {cite:p}`Haisch2001`.Do not wrap {cite:p} in manual parentheses — the role already adds them. Writing ({cite:p}key) produces double parentheses ((Author, Year)).
To cite multiple sources in one parenthetical, separate keys with commas:
Seismic data constrain the core and mantle {cite:p}`Stahler2021,Khan2021`.Use {cite:t}`key` when the author is the grammatical subject of the sentence. This renders as Author (Year).
{cite:t}`Birch1952` established an empirical relationship between wave velocity and density.The bibliography list uses a custom pybtex Chicago style (bibtex_default_style: chicago in _config.yml), implemented in src/ips_styles/chicago.py and registered via entry points in pyproject.toml. This style:
- Formats entries as: Author. Year. "Title." Journal Volume(Number): Pages. doi:DOI. URL.
- Uses citation keys as labels (hidden by CSS in
book/_static/custom.css) - Sorts entries alphabetically by author, then year, then title
After modifying the style, run pip install -e . to re-register the entry point.
- Keys follow the format
AuthorYear(e.g.,Lichtenberg2021,Raymond2022), orAuthorYearLetterwhen there are multiple papers by the same first author in the same year (e.g.,Wordsworth2013a,Wordsworth2013b) - Prefer DOI-bearing entries; include
doi = {}field in every BibTeX entry where available - Prefer peer-reviewed journal articles over textbooks or web sources; use review articles where appropriate for broad topics
Every BibTeX entry must include a link to an open-access source, in order of preference:
- NASA ADS (preferred):
url = {https://ui.adsabs.harvard.edu/doi/{DOI}/abstract}— works for most journal articles and conference papers indexed by ADS - arXiv:
eprint = {XXXX.XXXXX}witharchivePrefix = {arXiv}— for preprints and papers with arXiv versions - Publisher open access: Direct URL to an open-access PDF or landing page (e.g., Nature Communications, Science Advances, open-access journals)
- Institutional repository or other stable URL: Use the
urlfield
For entries that have BOTH a DOI and an arXiv eprint, include both fields — the Chicago style will render both links. For books, include the ADS URL if the book is indexed there; otherwise omit the URL field (the DOI link is sufficient).
- Every factual claim, equation, or dataset that originates from a specific source must be cited
- Add the corresponding BibTeX entry to
book/references.bibif it does not already exist - Verify that the
## Referencessection with the{bibliography}directive is present at the end of the lecture file - Always update
planning/course_development.mdto reflect the changes — this includes:- The lecture outline (section 2) if topics are added, removed, or reordered
- The status table (section 5) to track progress (e.g., "Not started" → "In progress" → "Draft complete")
- The homework or exam sections if related content changes
- Every factual claim, equation, or dataset that originates from a specific source must be cited on the slide where it appears
- The lectures should be dominated by figures and equations, with minimal text — citations should be included in the figure captions or as small footnotes on the slide. Text should mainly appear as bullet points or annotations on figures, not as large paragraphs.
- The corresponding BibTeX entry must be added to
book/references.bibif it does not already exist - The lecture notes (MyST Markdown) must also be updated to include the new content and citations, following the same process as above (add content, add citations, update references section, update course development plan)
- Ensure that the slide content and lecture notes are consistent with each other — if a new figure or dataset is added to the slides, it should also be described and cited in the lecture notes
- The slides should be visually engaging, with clear labels, legends, and annotations to aid understanding
- All slides should share a common visual style (colors, fonts, layout) consistent with the course branding.
When writing or editing lecture content, invest substantial effort in verifying scientific accuracy. This is a university-level course — errors in the notes directly mislead students.
Specifically:
- Numerical values (physical constants, planetary parameters, orbital elements, isotopic ratios, etc.) must be checked against authoritative sources (NASA Planetary Fact Sheets, IAU standards, recent review articles). Do not rely on training data alone — look up and cite the source.
- Equations and derivations must be dimensionally consistent and physically correct. After writing a derivation, verify units on both sides and check limiting cases.
- Historical claims (discovery dates, mission timelines, naming conventions) must be verified against primary or well-established secondary sources.
- Planetary data should preferably reference NASA/JPL Solar System Dynamics, the Planetary Fact Sheet, or equivalent authoritative databases, with the access date noted where relevant.
- Exoplanet statistics (occurrence rates, demographics, detection counts) change frequently — always cite the specific study and year, and note that numbers are approximate.
- Confusing mass and weight, or mixing up
$M_\oplus$ and$M_J$ scales - Using outdated values (e.g., number of confirmed exoplanets, Hubble constant, atmospheric compositions updated by recent missions)
- Incorrect unit conversions (AU ↔ km, bar ↔ Pa, K ↔ °C)
- Attributing discoveries or models to the wrong author or year
- Citing retracted or superseded results without noting the update
- Broken or non-persistent URLs — prefer DOIs over direct URLs for journal articles
- All DOIs should resolve correctly (format:
https://doi.org/10.xxxx/...) - Do not invent DOIs — if unsure whether a DOI exists, omit it and flag for manual verification with a comment:
% TODO: verify DOI - For web resources (NASA fact sheets, mission pages), use the most stable/canonical URL available
- If a URL is known to change frequently, note the access date in the BibTeX
notefield
- Write at the level of a 2nd-year BSc Astronomy student (see prerequisites in
planning/course_development.md) - Define technical terms on first use
- Use SI units throughout; use astronomical conventions where standard (AU, solar masses, etc.)
- Chemical formulae use plain LaTeX math mode with
\mathrm{}(e.g.,$\mathrm{CO_2}$,$\mathrm{H_2O}$). Do not use\ce{}from mhchem — it does not render reliably in the Jupyter Book build pipeline - Cross-reference other lectures using MyST labels:
{ref}`lecture01`through{ref}`lecture14`
All raster images in this repository use AVIF (AV1 Image File Format) as the standard format. Do not commit JPEG or PNG raster files.
- ~50% smaller than JPEG at equivalent visual quality, reducing repo size and page load times
- Supports both photographic and graphic content well
- Native browser support for the Jupyter Book HTML output
Convert any new raster image to AVIF before adding it to the repository:
magick input.jpg -quality 65 output.avif # photographic images
magick input.png -quality 65 output.avif # diagrams / screenshotsUse quality 65 as the default. For images where compression artifacts are noticeable (fine line art, text-heavy diagrams), increase to 75–80.
Keep SVG files as-is — do not convert them to AVIF. SVGs are resolution-independent and typically smaller for diagrams, charts, and schematics.
XeLaTeX cannot read AVIF files natively. The Makefiles handle this automatically:
make pdflatexandmake slidesrun anavif2pngstep that generates temporary PNG files from AVIF before compiling LaTeX- Generated PNGs are gitignored (
book/**/figures/*.png,slides/**/*.png) - In slide
.texfiles, use extensionless\includegraphics{image_name}so XeLaTeX finds the generated PNG - In book
.mdfiles, use the.avifextension in{figure}directives — the build system handles the LaTeX substitution
- Download or create the image in any format
- Convert to AVIF:
magick source.jpg -quality 65 figures/name.avif - Reference in MyST:
```{figure} figures/name.avif``` - Reference in slides:
\includegraphics{name}(no extension) - Delete the original source file — only commit the
.avif