quarto-dev / quarto-dev/quarto-cli

Support non-ASCII characters in crossreferenceable labels

Open
#9,405 6 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Apr 25, 2024.

computations engines-jupyter enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

I used the jupyter engine and python code to draw two different bar charts using the matplotlib drawing library. In jupyter they would output correctly, but with quarto preview, he outputs two identical images. The reason is that #| label: fig-qxz contains Chinese characters.

Steps to reproduce
---
title: aaa
author: aaa
format:
  typst:
    number-sections: true

execute:
  echo: false
  warning: false
fig-align: center
editor:
  render-on-save: true
engine: jupyter
---

```{python}
import numpy
import matplotlib.pyplot as plt
from matplotlib import rcParams
import pandas as pd
%config InlineBackend.figure_format = 'svg'
```

```{python}
#| label: fig-你好
#| fig-cap: aaa


df = pd.DataFrame({'Categories': ['A', 'B', 'C'], 'Values': [10, 20, 30]})

fig1, ax1 = plt.subplots(figsize=(8, 2.5))
ax1.bar(df["Categories"], df["Values"])
plt.show()
```

```{python}
#| label: fig-世界
#| fig-cap: bbb

df2 = pd.DataFrame({'Categories': ['D', 'E', 'F'], 'Values': [30,20,10]})

fig2, ax2 = plt.subplots(figsize=(8, 2.5))
ax2.bar(df2["Categories"], df2["Values"])
plt.show()
```
Expected behavior

屏幕截图 2024-04-18 204029

Actual behavior

error

Your environment
  • IDE: VS Code
  • Windows 11
Quarto check output

Quarto 1.5.30

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.