ABSTRACT

LaTeX rendering via MathJax is possible via the TeX() function which flags a character vector as LaTeX. To load MathJaX externally (meaning an internet connection is needed for TeX rendering), set the new mathjax argument in config() to "cdn". This chapter provides an example that demonstrates how to render LaTeX with on-graph text. There are two ways to draw on-graph text: add_text() which is a scatter trace with a mode of text and add_annotations() which is part of the graph’s layout. The main difference is that add_text() is able to display tooltips and add_annotations() is able to display arrows. To use a local version of MathJax (so that graphs will render without an internet connection), one need to inform plotly where it is located.