### Bug description

I try to generate a LaTeX table in Julia using PrettyTables.jl

This creates the LaTeX code for the `\begin{tabular} ... \end{tabular}` sections. 

1. If I use `#| output: true` that gets inserted in a `verbatim` environment, which prints the LaTeX code in the final document, which is not what I want. It does include the `table` environment and adds a caption and label as expected, though. I can use the `@tbl-label` method to cross-reference in this case.

2. If I use `#| output: asis` the output is inserted as is (as expected). This renders a nice table, however, then I don't get the `table` environment and no caption and label.

3. I use 2, and add the `\begin{table}`, `\caption`, `\label` before the block and the `\end{table}` after. Then I get the correct table, incl. caption, but I cannot use the `@tbl-label` to crossreference, which is annoying, since I want to use HTML export as well. For LaTeX `\ref{tbl-label}` works, but then I'd need to add the "Table" in front of that and it would need more trickery to switch to HTML export.

Is there a way to either make (1) not use the verbatim environment, or (2) honour the float options `#| label` and `#| tbl-cap:`?





### Checklist

- [ ] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [ ] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cscheid
2022-12-27T17:39:39Z
TS-CUBED
bug crossref tables
v1.4
open
Code cells with `#| output: asis` ignore `#| tbl-cap` and `#| label:` 
https://github.com/quarto-dev/quarto-cli/issues/3770