Repository navigation
Support setting .landscape class directly on a crossref div (e.g. to make a table in lanscape mode) #12420
Description
Activity
Why do you have HTML markup?
You probably should split::: {.landscape #tbl-table}into two divs.
You clearly should not have HTML markup outside of raw block and not at all if you are aiming at PDF/LaTeX.Also, if you use pre-releases, please keep your version up to date before opening issues.
In the future, please use discussions when requesting help.
- addedsupporta request for supporta request for supportand removedbugSomething isn't workingSomething isn't working
on Apr 1, 2025 That was it, thank you!
I edited my reply:
In the future, please use discussions when requesting help.
Trying to set
.landscapeon the same div is not surprising to me. 🤔I wonder if we could / should detect the
.landscapeclass and handle it as if it were a div inside a div. This would be by convenience to support this syntax.Otherwise, maybe we should warn that
.landscapewas detected but is ignored.The only drawback I see is that it would make
.landscapea "protected" class because it would be Quarto only, as we would warn or act when we see it. But this wouldn't be the first.Example something like
Div = function(d) local _, i = d.classes:find("landscape") if i and #d.classes > 0 then quarto.log.output("Found landscape div") d.classes:remove(i) return pandoc.Div(d, {'', {'landscape'} }) end end
--- format: pdf filters: - path: landscape.lua at: pre-ast --- ::: {.landscape #tbl-table} ```{=latex} \begin{tabular}{|l|c|r|} \hline Column 1 & Column 2 & Column 3 \\ \hline Data 1 & Data 2 & Data 3 \\ \hline Data 4 & Data 5 & Data 6 \\ \hline \end{tabular} ``` Table captions :::
Regarding @mcanouil, you may have found a new issue when two captions are provided. See your screenshot, there is
Table 1andTable 2.Your example provide
\begin{table}which is not adviced - Quarto will handle the table environment. The caption should be below and last elementSo I would give this example
--- format: pdf --- ::: {.landscape} ::: {#tbl-table} ```{=latex} \begin{tabular}{|l|c|r|} \hline Column 1 & Column 2 & Column 3 \\ \hline Data 1 & Data 2 & Data 3 \\ \hline Data 4 & Data 5 & Data 6 \\ \hline \end{tabular} ``` Sample Table ::: *Note:* {{< lipsum 1 >}} :::
which leads for @eric-roca to
--- format: pdf --- ::: {.landscape} ::: {#tbl-table} ```{=latex} \begin{tabular}{lcccccccc} &\multicolumn{8}{c}{Dep. variable: Lit. equality index, 1866} \\ \cmidrule(lr){2-8} &\multicolumn{2}{c}{Baseline} &\multicolumn{2}{c}{Fixed-effects} &\multicolumn{2}{c}{Geography} &\multicolumn{2}{c}{Monasteries} \\ &\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} &\multicolumn{1}{c}{(4)} &\multicolumn{1}{c}{(5)} &\multicolumn{1}{c}{(6)} &\multicolumn{1}{c}{(7)} &\multicolumn{1}{c}{(8)} \\ \midrule Beguinage (0/1)& 0.144 & & 0.153 & & 0.110 & & 0.101 & \\ & (0.019)***& & (0.019)***& & (0.026)***& & (0.024)***& \\ & [0.019]***& & [0.020]***& & [0.027]***& & [0.025]***& \\ Exposure (centuries)& & 0.021 & & 0.022 & & 0.014 & & 0.012 \\ & & (0.003)***& & (0.003)***& & (0.005)***& & (0.005)***\\ & & [0.003]***& & [0.003]***& & [0.006]** & & [0.006]** \\ \midrule Fixed-effects&\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{Canton} &\multicolumn{1}{c}{Canton} &\multicolumn{1}{c}{Canton} &\multicolumn{1}{c}{Canton} &\multicolumn{1}{c}{Canton} &\multicolumn{1}{c}{Canton} \\ Geography &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{Yes} &\multicolumn{1}{c}{Yes} &\multicolumn{1}{c}{Yes} &\multicolumn{1}{c}{Yes} \\ Monasteries&\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{Yes} &\multicolumn{1}{c}{Yes} \\ Observations&\multicolumn{1}{c}{2549} &\multicolumn{1}{c}{2549} &\multicolumn{1}{c}{2549} &\multicolumn{1}{c}{2549} &\multicolumn{1}{c}{2447} &\multicolumn{1}{c}{2447} &\multicolumn{1}{c}{2447} &\multicolumn{1}{c}{2447} \\ \(R^{2}\) &\multicolumn{1}{c}{0.030} &\multicolumn{1}{c}{0.029} &\multicolumn{1}{c}{0.203} &\multicolumn{1}{c}{0.200} &\multicolumn{1}{c}{0.231} &\multicolumn{1}{c}{0.225} &\multicolumn{1}{c}{0.235} &\multicolumn{1}{c}{0.229} \\ \end{tabular} ``` Sample Table ::: *Note:* {{< lipsum 1 >}} :::
- changed the title
[-]Raw latex table, landscape mode and reference[/-][+]Support setting .landscape class directly on a crossref div (e.g. to make a table in lanscape mode)[/+]on Apr 1, 2025 - addedtablesIssues with Tables including the gt integrationIssues with Tables including the gt integrationenhancementNew feature or requestNew feature or requestand removedsupporta request for supporta request for support
on Apr 1, 2025 I am reopening to consider and discuss the feature request for this syntax
--- format: pdf --- ::: {.landscape #tbl-table} | A | B | |---|---| | C | D | Table caption :::
Reacted by Mickaël Canouil@cderv Indeed, I reused quickly one of my default "example" for LaTeX raw code. I did not picked the correct one. Since that is a misuse, I don't know if we should consider this a bug which is very specific to LaTeX. (I edited to avoid mis-direction of future readers)
About considering this a feature request, I believe it's more general than that.
Should any "layout div" be allowed to be merged with cross-reference divs? (there are other issues about this)Conceptually, I find it very weird to merge content with page layout specification.
.landscapedefine the orientation of the page in most formats, not the orientation of the content.- added and removedtablesIssues with Tables including the gt integrationIssues with Tables including the gt integration
on Apr 1, 2025 @cderv We need to be pretty careful with designs like this. The general problem is that the order of resolution becomes complicated when features interact. For example, consider the following:
::: {.column-page .landscape #tbl-1} ... table ... caption :::How should this be interpreted? As
::: {.column-page .landscape} ::: {#tbl-1} ... table ... caption ::: :::or
::: {#tbl-1} ::: {.column-page .landscape} ... table ... caption ::: :::Note that the latter is now not actually working as intended because of the caption inside a div.
(Our current designs actually handle this specific case correctly. But every time there's feature ordering involved, an n-way interaction becomes at least exponentially complicated, because there are n! different ways to order the expression.)
Reacted by Mickaël Canouil and Christophe DervieuxOk I see. Let's not do that then.
We should focus on helping / guiding users to use the right syntax.
Another linting problem when we could detect
.landscapewith other classes on a div and add an indication this should be on its own div ?I guess I am acknowledging the confusion of
- Which class needs to be on its own div ?
- Which class can be used on the same div as others ?
Not that straightfoward to users. For me two paths:
- Support multiple syntax (but you explain this is not a good idea)
- Being proactive in helping user use the right syntax.
Thanks for the explanation!


Bug description
I am trying to provide my research articles both as html and pdf. Regarding the pdf generation, I am unable to combine referencing a table and placing it in landscape mode when raw latex is used.
Steps to reproduce
Actual behavior
When both landscape and a reference are included, the page is in vertical model
Expected behavior
Rotate the page and get a reference
Your environment
IDE: quarto cli commands
OS: Arch Linux
Latex distribution: tectonic
Quarto check output
Quarto 1.7.6
[✓] Checking environment information...
Quarto cache location: /home/eric/.cache/quarto
[✓] 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.7.6
Path: /opt/quarto/bin
[✓] Checking tools....................OK
Chromium: 869685
TinyTeX: (not installed)
[✓] Checking LaTeX....................OK
Tex: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.13.2
Path: /usr/bin/python3
Jupyter: 5.7.2
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........(None)