% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/options.R
\name{latex_options}
\alias{latex_options}
\alias{reset_latex_options}
\title{Set or query package-wide LaTeX rendering defaults}
\usage{
latex_options(
  math_font = NULL,
  render_mode = NULL,
  tex_style = NULL,
  input_mode = NULL
)

reset_latex_options()
}
\arguments{
\item{math_font}{Math font name or alias (see
\code{\link{available_math_fonts}}).}

\item{render_mode}{Either \code{"typeface"} or \code{"path"}.}

\item{tex_style}{TeX style override. One of \code{""} (let the parser
decide), \code{"display"}, \code{"text"}, \code{"script"}, or
\code{"scriptscript"}. \code{"display"} forces large operators with
limits placed over/under, useful for inline labels that should still
look like display equations.}

\item{input_mode}{How the input string is interpreted before being
handed to MicroTeX. \code{"math"} (default) treats the whole string
as math --- the standard MicroTeX behaviour, where letters render as
math italics and unwrapped prose looks wrong. \code{"mixed"} wraps
the string in \code{\\text{...}} so it reads as ordinary text, with
\code{$...$} (and \code{\\(...\\)}) opening math mode --- the
document-level LaTeX convention. Useful when consuming labels from
other packages that mix prose and math without explicit
\code{\\text{}} markers.}
}
\value{
Invisibly returns the previous settings (a list). With no
arguments, returns the current settings visibly.
}
\description{
A single entry point for project-wide defaults used by
\code{\link{latex_grob}}, \code{\link{grid.latex}},
\code{\link{latex_dims}}, and \code{\link{latex_tree}}. Options set
here are applied only when the corresponding argument is \emph{not}
supplied at the call site, so explicit arguments always win.
}
\details{
Calling \code{latex_options()} with no arguments returns the current
settings (a list whose \code{NULL} entries mean "use the built-in
default"). Supply one or more named arguments to update them.

Font size and line spacing are controlled via \code{gp} parameters
(\code{fontsize}, \code{cex}, \code{lineheight}) at the grob level
--- see \code{\link{latex_grob}}.
}
\examples{
\donttest{
  latex_options(math_font = "stix", render_mode = "typeface")
  grid.latex("\\\\sum_{i=1}^{n} i^{2}", gp = grid::gpar(fontsize = 14))
  reset_latex_options()
}
}
\seealso{
\code{\link{available_math_fonts}}, \code{\link{latex_grob}}
}
