quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.94k stars 325 forks source link

Table API overhaul: computational subtables? #4171

Closed cscheid closed 1 year ago

cscheid commented 1 year ago

I don't think we have support for this ATM, but we should, since we're on tables anyway.

cscheid commented 1 year ago

subtables and subcaptions interact with crossref, so 1.4.

cscheid commented 1 year ago

See also #1580. In Quarto 1.4's upcoming crossref system, these are instances of the same problem.

cscheid commented 1 year ago

We're not doing a perfect job at this just yet.

With explicit layouts

It works great:

---
title: tables
keep-md: true
---

```{r}
#| label: tbl-tables
#| layout-ncol: 2
#| tbl-cap: "Tables!"

knitr::kable(head(iris), caption="Caption 1 {#tbl-tables-1}")
knitr::kable(head(cars), caption="Caption 2 {#tbl-tables-2}")

See @tbl-tables, especially @tbl-tables-1 and @tbl-tables-2.


<img width="600" alt="image" src="https://github.com/quarto-dev/quarto-cli/assets/285675/370f7d31-862d-43ff-a0e0-862219d5eff6">

## Without explicit layouts

The code cells get in the way:

title: tables keep-md: true

#| label: tbl-tables
#| tbl-cap: "Tables!"

knitr::kable(head(iris), caption="Caption 1 {#tbl-tables-1}")
knitr::kable(head(cars), caption="Caption 2 {#tbl-tables-2}")

See @tbl-tables, especially @tbl-tables-1 and @tbl-tables-2.



<img width="582" alt="image" src="https://github.com/quarto-dev/quarto-cli/assets/285675/3510902c-b8c9-4f17-873a-b8559a1a4fea">

## `tbl-subcap` still doesn't work either

<img width="607" alt="image" src="https://github.com/quarto-dev/quarto-cli/assets/285675/dc5d2c53-dc68-452d-841d-8a3c22b7668d">
cscheid commented 1 year ago

This is now working on main.

rcyost commented 4 months ago

Can someone show a reproducible example of how to get two tables next to each other in python? I cannot figure it out.

::: {#tbl-panel layout-ncol=2}
```{python}
#| layout-ncol: 2

Markdown(tabulate(
    df, headers=df.columns, showindex=True))

Markdown(tabulate(
    df, headers=df.columns, showindex=True))
mcanouil commented 4 months ago

@rcyost please open a new new GitHub Discussion.