5p layout not correctly rendered when table is added
Hi, I am using the elsevier quarto extension for a paper I am writing. When I add a markdown table, the 5p format is not rendering correctly. It is fine without the table, but with the table, some of the text in the beginning is cut off.
This is the render from the template file :
Now when I just replace the content under the heading "Tables coming from R" with my own markdown table, I get this render:
Everything above "Using CSL" is cut off! Could you help see why this is happening?
This format should be trying to do the right thing with long tables in 2-column layouts, but I've seen when that code isn't working properly (e.g. before I added it).
I think a place to start is to add keep-tex: true to your document front matter, then inspect the latex that is produced to see whether we're correctly injecting the table handling.
We're basically hoping that this:
\usepackage{float}
\makeatletter
\let\oldlt\longtable
\let\endoldlt\endlongtable
\def\longtable{\@ifnextchar[\longtable@i \longtable@ii}
\def\longtable@i[#1]{\begin{figure}[H]
\onecolumn
\begin{minipage}{0.5\textwidth}
\oldlt[#1]
}
\def\longtable@ii{\begin{figure}[H]
\onecolumn
\begin{minipage}{0.5\textwidth}
\oldlt
}
\def\endlongtable{\endoldlt
\end{minipage}
\twocolumn
\end{figure}}
\makeatother
makes it into the latex.
One other thought- it's possible that since this is redefining longtable, if R/Quarto isn't producing longtables this may no longer be working. I know that we did a lot of work in this area for 1.4 (to make tables in LaTeX far more stable and reliable), so this is a real possibility. CC'ing @cscheid just in case he knows this off the top of his head.
Thanks for the suggestion! I will see if I see it in the latex file and report back
Hi, I checked the latex file, and the code that you mentioned is present in the generated latex. The top part is still cut off though
Can you share the latex (or see whether the table in the document is a ‘longtable’)?
I am attaching the latex file. I think I saw "longtable" at the end, longtable_cuts_off_text.txt
Thanks a lot for taking the time to help!
Yeah it definitely seems like everything should be working, but it sure looks like the table is evading our special handling. I'll need to try to drill into the LaTeX more carefully to diagnose what is happening...
Can you provide a .qmd file that causes this as well as the latex file?
I actually am using quarto from jupyterlab and rendering the .ipynb file. But I made a qmd file too just now. The problem persists. I am attaching the qmd code in txt file elsevier5p_tablecutoff_qmd.txt
Hi, Any luck with the debugging process ? Also I wanted to ask an unrelated question. Is there any way to span a figure across the 2 columns in 5p or 3p ?