MyNixOS website logo
Description

R Functions for Readable LaTeX Mathematical Expressions.

Build complex 'LaTeX' mathematical expressions using intuitive 'R' functions. Replace error-prone 'LaTeX' syntax with readable, modular functions that make mathematical typesetting straightforward and maintainable.

latexSymb

Transform complex LaTex mathematical expressions into readable, composable R code. Instead of wrestling with backslashes and braces, express your mathematics naturally using familiar R syntax.

✨ Why latexSymb?

Before (Raw LaTex) 😓

\frac{d}{dt} \left \langle V,W \right \rangle = \left \langle \frac{DV}{dt}, W \right \rangle + \left \langle V, \frac{DW}{dt} \right \rangle

After (latexSymb) 🎉

vf1 <- lsymb("V")
vf2 <- lsymb("W")
inner <- function(x, y) ang(lsymb(x, ",", y))
cov.der <- function(x) lsymb("D", x) / "dt"
ddt <- function(x) lsymb("d", x) / "dt"

ddt(inner(vf1, vf2)) *eq* inner(cov.der(vf1), vf2) + inner(vf1, cov.der(vf2))

🚀 Key Features

1. Natural Mathematical Syntax

# Division automatically becomes \frac
x / y               # → \frac{x}{y}

# Powers become superscripts
x^2                 # → x^{2}

# Subscripts with under()
x |> under(i)       # → x_{i}

2. Automatic Delimiter Sizing

No more \left and \right headaches!

pths(x / y)         # Parentheses with auto-sizing
ang(x, y)           # Angle brackets ⟨x,y⟩
sqbr(x + y)         # Square brackets [x+y]
br(condition)       # Braces {condition}

3. Composable Mathematical Functions

Build complex expressions from simple, reusable parts:

# Define semantic functions
exp_val <- function(x) lsymb("\\mathbb{E}") * sqbr(x)
sq <- function(x) pths(x)^2
abs <- function(x) lsymb("\\abs{", x, "}")

# Compose naturally
exp_val(sq(abs(x) - y))     # → 𝔼[(|x| - y)²]

4. Multi-line Equations Made Simple

proof_steps <- list(
  ruler * dist(x, y) * leq * dist(x, z) + dist(z, y) * endl,
  ruler * thus * dist(x, y) - dist(x, z) * leq * dist(z, y)
) |>
  lenv("align*", rows = _)

5. Common Symbols Pre-loaded

data(common)
attach(common)
# Instantly use: alpha, beta, mu, sigma, eq, leq, sum, int, infty...

📦 Installation

Released version from CRAN:

install.packages("latexSymb")

Development version from GitHub:

# install.packages("devtools")
devtools::install_github("nicoesve/latexSymb")

🎓 Quick Example: Central Limit Theorem

library(latexSymb)
data(common)
attach(common)

# Define components
sample_mean <- lsymb("\\bar{x}")
sqrt <- function(x) lsymb("\\sqrt{", x, "}")
conv_distr <- lsymb("\\overset{d}{\\rightarrow}")

# Express the theorem
clt <- sqrt(n) * (pths(sample_mean - mu) / si) * conv_distr * lsymb("N(0,1)")

📚 Learn More

  • Vignettes: See vignette("vignette1", package = "latexSymb") for getting started
  • Advanced Usage: vignette("advanced_usage", package = "latexSymb") for complex examples
  • Documentation: Full function reference at ?latexSymb

🎯 Perfect For

  • 📊 Statistical reports with complex notation
  • 🎓 Academic papers and presentations
  • 📚 Course materials and textbooks
  • 🧮 Any document with serious mathematics

Stop fighting with LaTex syntax. Start expressing your mathematics naturally with latexSymb!

Metadata

Version

1.0.0

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows