to_latex: Convert CVXR Object to LaTeX

to_latexR Documentation

Convert CVXR Object to LaTeX

Description

Renders a CVXR Problem, Expression, or Constraint as a LaTeX string. Problem-level output uses the optidef package (mini*/maxi* environments) and atom macros from dcp.sty (shipped as system.file("sty", "dcp.sty", package = "CVXR")).

Usage

to_latex(x, ...)

Arguments

x

A Problem, Expression, Constraint, or Objective.

...

Reserved for future options.

Value

A character string containing LaTeX code.

Examples

x <- Variable(3, name = "x")
cat(to_latex(p_norm(x, 2)))
# \cvxnorm{x}_2


CVXR documentation built on March 6, 2026, 9:10 a.m.