Skip to contents

These functions are used to create cumulative operators in LaTeX. They take care of the sum, prod and int functions.

Usage

Sum(f, from = lsymb(""), to = lsymb(""))
Prod(f, from = lsymb(""), to = lsymb(""))
Int(f, meas = lsymb("dx"), from = lsymb(""), to = lsymb(""))

Arguments

f

An expression to be summed, multiplied or integrated.

from

The lower limit of the sum, product or integral.

to

The upper limit of the sum, product or integral.

meas

The measure of the integral.

Value

An object of class latex_symb whose repr is the LaTeX code for the cumulative operator concatenated with the limits and the expression.

Examples

    i <- lsymb("i")
    n <- lsymb("n")
    x <- lsymb("x")
    f <- function(x) lsymb("f") * pths(x)
    Sum(i, from = 1, to = n)
#> [1] "\\sum _{ 1 } ^{ n } i"
    Prod(i, from = 1, to = n)
#> [1] "\\prod _{ 1 } ^{ n } i"
    Int(f(x), from = 0, to = 1)
#> [1] "\\int _{ 0 } ^{ 1 } f \\left( x \\right) \\, dx"