Skip to content
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

5p layout not correctly rendered when table is added #24

Open
SHolm3s opened this issue Apr 2, 2024 · 9 comments
Open

5p layout not correctly rendered when table is added #24

SHolm3s opened this issue Apr 2, 2024 · 9 comments

Comments

@SHolm3s
Copy link

SHolm3s commented Apr 2, 2024

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 :
image

Now when I just replace the content under the heading "Tables coming from R" with my own markdown table, I get this render:
image

Everything above "Using CSL" is cut off! Could you help see why this is happening?

@dragonstyle
Copy link
Collaborator

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.

@SHolm3s
Copy link
Author

SHolm3s commented Apr 3, 2024

Thanks for the suggestion! I will see if I see it in the latex file and report back

@SHolm3s
Copy link
Author

SHolm3s commented Apr 3, 2024

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

@dragonstyle
Copy link
Collaborator

Can you share the latex (or see whether the table in the document is a ‘longtable’)?

@SHolm3s
Copy link
Author

SHolm3s commented Apr 3, 2024

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!

@dragonstyle
Copy link
Collaborator

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...

@cscheid
Copy link

cscheid commented Apr 3, 2024

Can you provide a .qmd file that causes this as well as the latex file?

@SHolm3s
Copy link
Author

SHolm3s commented Apr 3, 2024

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

@SHolm3s
Copy link
Author

SHolm3s commented Apr 13, 2024

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants