% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cache.R
\name{latex_cache_limit}
\alias{latex_cache_limit}
\alias{latex_cache_clear}
\alias{latex_cache_info}
\title{Set the maximum number of entries kept in the LaTeX layout cache}
\usage{
latex_cache_limit(n = 512L)

latex_cache_clear()

latex_cache_info()
}
\arguments{
\item{n}{Non-negative integer cache capacity. Default is 512. Set
to \code{0} to disable caching.}
}
\value{
\itemize{
\item \code{latex_cache_limit}: Invisibly returns the previous limit.
\item \code{latex_cache_clear}: Invisibly returns \code{NULL}.
\item \code{latex_cache_info}: A list with elements \code{size}
(entries currently stored), \code{max_size}, \code{hits}, and
\code{misses}.
}
}
\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.
}
\examples{
\donttest{
  latex_cache_limit(256)
  grid.latex("e^{i\\\\pi} + 1 = 0")
  latex_cache_info()
  latex_cache_clear()
}
}
\seealso{
\code{\link{latex_grob}}, \code{\link{latex_options}}
}
