r"""Restore the string `AdS` that the letter-eating bug deleted from AdS/CFT mentions. Evidence in 2102.01111: 12 prose sites read "in /CFT", and two display math runs read `$""_(d + 1)$/CFT$""_d$` - the `AdS` macro was wiped, leaving an empty `$""$` subscript run and a bare `/CFT` that Typst then rejects ("unexpected slash"). Both shapes are rewritten from the src file's own usage, so nothing is invented: prose /CFT -> AdS/CFT math $""_(x)$/CFT$""_(y)$ -> $"AdS"_(x) / "CFT"_(y)$ Usage: python -X utf8 scripts/adsfix.py [papers/...] [--dry] """ import glob, io, os, re, shutil, sys sys.stdout.reconfigure(encoding="utf-8") B = chr(92) MATH = re.compile(r'\$""_(?:\(([^)]*)\)|([0-9A-Za-z]*))\$/CFT\$""_(?:\(([^)]*)\)|([0-9A-Za-z]*))\$') PROSE = re.compile(r"(?