Learn R Programming

CVXR (version 1.9.1)

to_latex: 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, ...)

Value

A character string containing LaTeX code.

Arguments

x

A Problem, Expression, Constraint, or Objective.

...

Reserved for future options.

Examples

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

Run the code above in your browser using DataLab