# TeX: Render TeX in a plotly graph using MathJax In plotly: Create Interactive Web Graphics via 'plotly.js'

 TeX R Documentation

## Render TeX in a plotly graph using MathJax

### Description

This function makes it slightly easier to render TeX in a plotly graph – it ensures that MathJax is included with the final result and also ensures the provided string is surrounded with \$ (this is what plotly.js uses to declare a string as TeX).

### Usage

TeX(x)


### Arguments

 x a character vector

config

### Examples



plot_ly(x = c(1, 2, 3, 4), y = c(1, 4, 9, 16)) %>%
layout(title = TeX("\\text{Some mathjax: }\\alpha+\\beta x")) %>%
config(mathjax = "cdn")



plotly documentation built on Nov. 10, 2022, 5:42 p.m.