Commercial enterprise offerings

Creating multilingual documentation with Quarto

Isabella Velásquez's head shot
Written by Isabella Velásquez
2025-03-10
Image with two inset headshots on a brown patterned background. The left inset shows a man with short brown hair smiling, labeled 'Wes McKinney'. The right inset shows a man with light brown hair and a slight beard, labeled 'Hadley Wickham'. A cup of coffee with latte art and a partially visible laptop are also in the image.

During a recent coffee chat with Wes McKinney and Hadley Wickham, a participant shared an interesting use case:

We want to use Quarto to share documentation with different contexts, same documentation, but quickly switching between R and Python for our users that need to see one language or the other.

Wes and Hadley shared different solutions available in Quarto, and we enjoyed the discussion so much that we turned it into a blog post!

Quarto is a scientific and technical authoring system built from the ground up to support multilingual projects. You can combine R, Python, Julia, and more in one document. It’s an excellent choice for developers, technical writers, and educators looking to create multilingual documentation for different programming languages. Below, we explore two approaches to implement this functionality: grouped tabsets on a page and the Tabby extension.

Group tabsets on a page

Quarto’s tabsets allow you to organize content, such as R and Python code, in separate tabs. Grouped tabsets enable you to synchronize these tabs so that when a user switches to one language, all related tabs on the page switch simultaneously.

Create grouped tabsets by assigning the same group attribute (e.g., language) to multiple tabset divs. Each heading within the tabset will output a separate tab. All the tabs with the same heading will synchronize across the page. For example, selecting the R tab will switch all related tabs on the page to the tabs containing R code.

:::{.panel-tabset group="language"}

## R

```{r}
R code here
```

## Python

```{python}
Python code here
```
:::

More stuff in between...

:::{.panel-tabset group="language"}

## R

```{r}
R code here
```

## Python

```{python}
Python code here
```
:::

See an example of grouped tabsets.

Tabby extension

The Tabby extension by James J. Balamuta provides another way to create multilingual documentation.

Similar to the example above, you assign a group attribute (e.g., language) a Tabby div. However, unlike grouped tabsets, where you need to define the same headings across all tabsets for synchronization, Tabby automatically creates tabsets for each code block in the Tabby div. It will then synchronize tab switches across the document.

---
filters:
  - tabby
---

::: {.tabby group="language"}
```{r}
R code here
```

```{python}
Python code here
```
:::

More stuff in between...

::: {.tabby group="language"}
```{r}
R code here
```

```{python}
Python code here
```
:::

Additionally, Tabby lets you set a default tab selection, which is handy if you would like to prioritize the most relevant language for your audience.

See an example of grouped tabsets using Tabby.

Learn more

We are excited for you to present R and Python (or other languages) side by side with Quarto!

Isabella Velásquez's head shot

Isabella Velásquez

Sr. Product Marketing Manager at Posit, PBC
Isabella is a content strategist, data enthusiast, and author. Her goal is to drive engagement around all the awesome things happening at Posit.