-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect modification of \begin{table}
environment with labeled table in LaTeX
#12085
Comments
This is a known issue. Third parties should not emit table environments as Quarto Cross-ref feature needs to add its own. |
Note that this particular case was fixed in the "parser": It will be part of the next-prerelease (1.7.14). |
I see, thank you, could not locate that issue when I tried looking for preexisting ones. I get that quarto needs to have control of It would be hard or impossible to convert the structures SummaryTables wants to create in markdown, I will have another look into this though. |
That's mainly why (I believe), Quarto tries to "fix" the tables but as it involves regexes, etc. and that LaTeX syntax is not very homogenous, it can't work all the time. |
It seems this is not fixed when trying to reproduce with this julia example. So something missed somehow in #11878 I'll see how to adapt. |
Just so this is clear, if you do not emit ---
engine: julia
format:
pdf:
include-in-header:
- text: |
\usepackage{threeparttable}
keep-tex: true
keep-md: true
---
```{julia}
#| label: tbl-test
#| tbl-pos: "!ht"
struct Latex
s::String
end
Base.show(io::IO, m::MIME"text/latex", l::Latex) = print(io, l.s)
Latex(raw"""
\setlength\tabcolsep{0pt}
\centering
\begin{threeparttable}
\begin{tabular}{@{\extracolsep{2ex}}*{5}{ccccc}}
\toprule
$\theta 1$ & $\theta 1$ & $\theta 1$ & $\theta 1$ & $\theta 1$ \\
\midrule
$\theta 2$ & $\theta 2$ & $\theta 2$ & $\theta 2$ & $\theta 2$ \\
$\theta 3$ & $\theta 3$ & $\theta 3$ & $\theta 3$ & $\theta 3$ \\
$\theta 4$ & $\theta 4$ & $\theta 4$ & $\theta 4$ & $\theta 4$ \\
$\theta 5$ & $\theta 5$ & $\theta 5$ & $\theta 5$ & $\theta 5$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
""")
``` When |
I meant that it should be okay to have a table with
Sorry, missed your earlier post saying it was not fixed. |
#12103 should fix it. This problem is a follow up on the one I fixed in #11878 - it was not complete because we do same processing but in a different code path for when the raw latex table is from a computated cell output. (meaning inside a
Results is the following for your example \begin{table}
\caption{\label{tbl-test}}
\centering{
\setlength\tabcolsep{0pt}
\centering
\begin{threeparttable}
\begin{tabular}{@{\extracolsep{2ex}}*{5}{ccccc}}
\toprule
$\theta 1$ & $\theta 1$ & $\theta 1$ & $\theta 1$ & $\theta 1$ \\
\midrule
$\theta 2$ & $\theta 2$ & $\theta 2$ & $\theta 2$ & $\theta 2$ \\
$\theta 3$ & $\theta 3$ & $\theta 3$ & $\theta 3$ & $\theta 3$ \\
$\theta 4$ & $\theta 4$ & $\theta 4$ & $\theta 4$ & $\theta 4$ \\
$\theta 5$ & $\theta 5$ & $\theta 5$ & $\theta 5$ & $\theta 5$ \\
\bottomrule
\end{tabular}
\end{threeparttable}
}
\end{table}% |
@jkrumbiegel I did not test specifically for |
@cderv thank you :) |
Bug description
SummaryTables.jl can create latex output and I noticed that tables don't look quite right when using quarto's table label feature. It seems like quarto tries to splice its own code into the
\begin{table}
environment but misses the[!ht]
parameters, which are then left dangling, leading to this kind of output:Steps to reproduce
This doc just returns some raw latex with the correct MIME type, it should work with any similar latex output:
Actual behavior
The .tex file output contains this section, notice how some code was spliced into the
\begin{table}
environment, leaving the[!ht]
on its own line:Expected behavior
No response
Your environment
No response
Quarto check output
The text was updated successfully, but these errors were encountered: