Repository navigation
Description
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
---
format:
pdf:
number-sections: true
pdf-engine: tectonic
pdf-engine-opts:
- '--print'
include-in-header:
- text: |
\usepackage{booktabs}
---
::: {.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}
```
<figcaption style="text-align: left;">
<em>Note: </em>
This table presents the results of OLS regressions relating the presence of beguinages to increased gender equality proxied by the variable $literacy\, equality\, index_{i(j}$, see main text for a description.
Columns 1) and 2) include only the presence of beguinages as a regressor.
Columns 3) and 4) add fixed-effects at the canton level.
In Columns 5) and 6) exogenous variables are incorporated, namely, latitude, longitude, distance to Leuven, to large cities (defined in 1300), to the sea and rivers, caloric yield, soil type and crop productivity, province and arrondissement capital status as well as ruler fixed effects. All distances in log-km.
Columns 7) and 8) further control for the presence of monasteries: masculine, feminine and unknown.
From Column 5) onward, we always control for the total population during 1866.
Standard errors clustered at the canton level in parenthesis and Conley standard errors, with a Bartlett kernel and a cut-off distance of 40 km, in brackets.
${}^{*}\, p < 0.1$, ${}^{**}\, p < 0.05$, ${}^{***}\, p < 0.01$.
</figcaption>
:::
</p>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)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/


Activity
mcanouil commentedon Apr 1, 2025
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.
eric-roca commentedon Apr 1, 2025
That was it, thank you!
mcanouil commentedon Apr 1, 2025
I edited my reply:
In the future, please use discussions when requesting help.
cderv commentedon Apr 1, 2025
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
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
which leads for @eric-roca to
[-]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)[/+]cderv commentedon Apr 1, 2025
I am reopening to consider and discuss the feature request for this syntax
mcanouil commentedon Apr 1, 2025
@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)
mcanouil commentedon Apr 1, 2025
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.cscheid commentedon 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:
How should this be interpreted? As
or
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.)
cderv commentedon Apr 1, 2025
Ok 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
Not that straightfoward to users. For me two paths:
Thanks for the explanation!