News for hackers. Stuff that matters.
Re:Ask HN: What prompt do you use to get Claude to consisten... by mdritch on Wednesday March 04, 2026 @08:40AM (#47247261)
I do this with claude frequently. The best tactic I have found is to include a finished file as a "style guide" alongside your content prompt. To find an appropriate style guide for your subject matter, find paper on the arxiv that covers similar material and click the "TeX Source" link.
Re:Ask HN: What prompt do you use to get Claude to consisten... by hkonte on Tuesday March 10, 2026 @03:23PM (#47327711)
The style guide approach works because it gives the output format signal its own dedicated space rather than burying it inside the task instructions.

A cleaner version: put your LaTeX rendering expectations in a dedicated output_format block, separate from the task description. Claude parses tagged XML blocks independently, so the formatting directive doesn't get diluted by surrounding context.

That's the pattern behind flompt (github.com/Nyrok/flompt), a prompt builder with a dedicated output_format block type. Worth trying if you're iterating on rendering behavior across different prompts.