Dollar signs in plotly trace names cause render issues when LaTeX is used elsewhere
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, latex, r
- Domain
- web-dev
Research direction
Start by rendering the supplied Quarto document with the listed Quarto versions and compare the output with the documented workarounds. Trace how LaTeX dollar signs and Plotly trace names appear in the generated HTML, then verify that the document and figures render normally without requiring those workarounds.
Written by the indexing model from the issue text.
Description
Bug description
I noticed documents do not render as expected when they contain $\LaTeX$ dollar signs and plotly figures that have dollar signs in their trace names. In my case, each trace represents a price range.
Steps to reproduce
The plotly figure in this document does not render properly.
---
title: "Test Doc"
format: html
---
$R^2$
```{r}
#| code-fold: true
x <- c(1:100)
trace_0 <- rnorm(100, mean = 5)
trace_1 <- rnorm(100, mean = 0)
data <- data.frame(x, trace_0, trace_1)
plotly::plot_ly(data, type = "scatter", mode = "lines") |>
plotly::add_trace(x = ~x, y = ~trace_0, name = "$100-$200") |>
plotly::add_trace(x = ~x, y = ~trace_1, name = "$200-$300")
```
Expected behavior
That the document and plotly figures therein would render properly.
The document does render as expected if:
- The $\LaTeX$ equation is removed
- One of the dollar signs in each trace name is removed
- At least one of the dollar signs in each trace name is replaced with the corresponding HTML entity code (
$)
I include these workarounds for anyone else who has trouble with this, but I would expected these symbols to be handled as necessary.
Actual behavior
The plotly figure is very small and all you can see is part of the legend.
Your environment
Positron Version: 2024.10.0 (Universal) build 14
Code - OSS Version: 1.93.0
Commit: 901ab5d11d694212d32e53b97f771c5d601e428e
Date: 2024-10-09T15:26:55.363Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0
Quarto check output
Quarto 1.6.26
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.6.26
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Tex: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.9.6
Path: /Users/jeffkeller/git/test/renv/python/virtualenvs/renv-python-3.9/bin/python
Jupyter: 5.7.2
Kernels: python3
(|) Checking Jupyter engine render....Traceback (most recent call last):
File "/Applications/quarto/share/jupyter/jupyter.py", line 21, in <module>
from notebook import notebook_execute, RestartKernel
File "/Applications/quarto/share/jupyter/notebook.py", line 15, in <module>
from yaml import safe_load as parse_string
ModuleNotFoundError: No module named 'yaml'
There is a requirements.txt file in this directory. Is this for a venv that you need to restore?
[✓] Checking Jupyter engine render....OK
I can reproduce this issue in Quarto 1.5.56, 1.5.57, and 1.6.26 (pre-release)
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto-cli
-
binder bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
quarto-dev/quarto-cli#14907 · 3 comments ·
-
brand bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Openengines-jupyter enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14850 · 2 comments ·
All issues in quarto-dev/quarto-cli
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficulty 1/5 Under an hour Newbie friendliness 90/100
matrix-org/matrix.org#3649 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·