latex_cache_limit: Set the maximum number of entries kept in the LaTeX layout...

View source: R/cache.R

latex_cache_limitR Documentation

Set the maximum number of entries kept in the LaTeX layout cache

Description

The cache stores parsed layout information for recently rendered LaTeX expressions, keyed by the expression and relevant rendering parameters (font, size, macros, etc.). This speeds up repeated rendering of the same expressions, especially in loops or interactive sessions. The default limit is 512 entries, which should be sufficient for most use cases. When the limit is exceeded, the least recently used entries are automatically evicted.

Usage

latex_cache_limit(n = 512L)

latex_cache_clear()

latex_cache_info()

Arguments

n

Non-negative integer cache capacity. Default is 512. Set to 0 to disable caching.

Value

  • latex_cache_limit: Invisibly returns the previous limit.

  • latex_cache_clear: Invisibly returns NULL.

  • latex_cache_info: A list with elements size (entries currently stored), max_size, hits, and misses.

See Also

latex_grob, latex_options

Examples


  latex_cache_limit(256)
  grid.latex("e^{i\\pi} + 1 = 0")
  latex_cache_info()
  latex_cache_clear()


gridmicrotex documentation built on May 16, 2026, 5:06 p.m.