Advanced Usage

Using a SnuggleSnapshot

It is possible to create a “snaphsot” of the state of a SnuggleSession, allowing you to recreate a fresh session having the same state later on. This is very useful if you want to reuse “macro definition” inputs that define commands and environments. You can do this with:

SnuggleSnapshot snapshot = session.createSnapshot();

// ... later on ...

SnuggleSession refriedSession = snapshot.createSession();
// refriedSession will have the same parsing state as your
// sesion did when you took the snapshot

Using a StylesheetCache

Some of SnuggleTeX’s processes — in particular the Semantic Enrichment extensions — use XSLT to do some of their work. By default, SnuggleTeX caches all XSLT stylesheets it creates in a simple hash-based cache called SimpleStylesheetCache. If you don’t like this, or use XSLT in your own application and want to control caching there, you can implement your own StylesheetCache to pass to SnuggleTeX.