Fix underscore handling in semantics.py that caused "'_' allowed only
in math mode" errors in rendered HTML. Issues: CollectionDefinition
used bare escaped underscores outside \text{}, expression_to_latex had
double-replacement bugs (unpaired→\text{un\text{paired}}), and
sample_sheet was unhandled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>