# Release v1.2.1

**Release Date**: November 17, 2025

This is a patch release that fixes a bug causing build failures in LaTeX/PDF output.

## 🐛 Bug Fixes

### LaTeX/PDF Build Failure

Fixed a `ValueError: list.remove(x): x not in list` error that occurred when building LaTeX/PDF documentation with sphinx-exercise v1.2.0.

**Issue:**
- The `UpdateReferencesToEnumerated` transform attempted to remove the `'std-ref'` CSS class from inline reference nodes
- In LaTeX/PDF builds (and potentially other build scenarios), this class may not be present
- Python's `list.remove()` raises a `ValueError` when the item doesn't exist, causing the build to fail

**Fix:**
- Added a defensive check: `if "std-ref" in classes:` before attempting removal
- The transform now safely handles cases where the class is absent
- Preserves the intended behavior: converting textual references to numeric references for enumerated exercises

**Impact:**
- Fixes build failures in projects using sphinx-exercise with LaTeX/PDF output
- No functional changes to existing behavior
- All existing tests continue to pass

**Example Error (before fix):**
```
Exception occurred:
  File ".../sphinx_exercise/post_transforms.py", line 69, in run
    classes.remove("std-ref")
ValueError: list.remove(x): x not in list
```

## 📦 Installation

Install or upgrade via pip:

```bash
pip install --upgrade sphinx-exercise
```

## 🔄 Migration Notes

**If you're upgrading from v1.2.0:**
- No breaking changes
- No action required
- If you encountered LaTeX/PDF build failures with v1.2.0, this release fixes that issue

**Compatibility:**
- Python 3.10, 3.11, 3.12, 3.13
- Sphinx 6, 7, 8
- All existing directives and configurations continue to work

## 🔗 Related Issues

- PR [#82](https://github.com/executablebooks/sphinx-exercise/pull/82) - Fix std-ref class removal
- Issue discovered in [QuantEcon/continuous_time_mcs CI build](https://github.com/QuantEcon/continuous_time_mcs/actions/runs/19413054039/job/55537214078?pr=144)

## 📚 Documentation

For complete documentation, see:
- [Configuration Options](../syntax.md)
- [Installation Guide](../install.md)
