% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print_results.R
\name{results_to_latex}
\alias{results_to_latex}
\title{Export results table to LaTeX}
\usage{
results_to_latex(
  ...,
  model_names = NULL,
  digits = 3,
  file = NULL,
  caption = NULL,
  label = NULL,
  stars = TRUE,
  note = NULL,
  booktabs = TRUE,
  include_loglik = TRUE,
  param_labels = NULL
)
}
\arguments{
\item{...}{One or more factorana_result objects, or a list of them}

\item{model_names}{Optional character vector of model names for column headers}

\item{digits}{Number of decimal places (default 3)}

\item{file}{Optional file path to write the LaTeX table}

\item{caption}{Table caption (optional)}

\item{label}{Table label for cross-referencing (optional)}

\item{stars}{Add significance stars (default TRUE)}

\item{note}{Footnote text (optional, default includes significance codes)}

\item{booktabs}{Use booktabs package formatting (default TRUE)}

\item{include_loglik}{Include log-likelihood row (default TRUE)}

\item{param_labels}{Optional named list mapping parameter names to display labels}
}
\value{
A character string containing the LaTeX table code
}
\description{
Creates a LaTeX table from factorana results, suitable for academic papers.
}
\examples{
\donttest{
# Estimate a small model and export the result as a LaTeX table
set.seed(1); n <- 200
f <- rnorm(n)
dat <- data.frame(intercept = 1,
                  y1 = 1.0 * f + rnorm(n, 0, 0.5),
                  y2 = 0.8 * f + rnorm(n, 0, 0.5))
fm <- define_factor_model(n_factors = 1)
mc1 <- define_model_component("m1", dat, "y1", fm,
  covariates = "intercept", model_type = "linear",
  loading_normalization = 1)
mc2 <- define_model_component("m2", dat, "y2", fm,
  covariates = "intercept", model_type = "linear",
  loading_normalization = NA_real_)
ms <- define_model_system(components = list(mc1, mc2), factor = fm)
ctrl <- define_estimation_control(n_quad_points = 8, num_cores = 1)
fit <- estimate_model_rcpp(ms, dat, control = ctrl,
  optimizer = "nlminb", parallel = FALSE, verbose = FALSE)

# Return LaTeX as a character string
tex <- results_to_latex(fit, model_names = "Baseline")

# Or write to a file inside tempdir()
results_to_latex(fit,
                 model_names = "Baseline",
                 file = file.path(tempdir(), "results_table.tex"))
}
}
