Hi -- I've been running into issues with Latex in my ggplots for Shiny apps when they are published. Locally, the Latex compiles fine, but when I publish the app, the Latex is incorrect. Specifically, anytime there is a sort of "container" (e.g., a tilde or bar) over a Latex symbol (not text), the container overlaps with the symbol, instead of being over it. This issue persists with both expression() and latex2exp:TeX(). Reprex below:
# Packages ----
library(shiny)
library(ggplot2)
library(dplyr)
library(tidyverse)
library(latex2exp)
library(plotly)
# Loading data ----
df <- as.data.frame(iris)
# ui.R ----
ui <- fluidPage(
withMathJax(),
fluidRow(
column(12,
"Hello"),
plotOutput("plot")
)
)
# server.R ----
server <- function(input, output){
output$plot <- renderPlot(
df %>%
ggplot() +
aes(x = Sepal.Width, y = Sepal.Length) +
geom_point() +
labs(title = expression("Title is " * widetilde(beta)))
)
}
# Run the app ----
shinyApp(ui = ui, server = server)
Local version:
Published version:
This also appears to be an issue across browsers, as I've tried in both Safari and Chrome.
Any help would be appreciated!