Hello LuaTeX developers,
I am facing a classic and difficult layout problem when using the *cuted*
package to switch from *twocolumn* to *onecolumn* (using *\switchonecolumn*
).
When I do this, two things break:
1. *Footnote Misplacement:* Footnotes that are declared just before
the *\switchonecolumn
*command are pushed to the previous page, often creating an unwanted
blank page.
2. *Float Drifting:* A *figure** float with the *[b] *(bottom) option
(using *stfloats*) is not placed at the bottom of the page. It drifts to
the very end of the document.
I have an MWE (below) that demonstrates both issues.
My question for this list is:* Could LuaTeX's capabilities offer a more
robust solution to this problem?*
I understand this is a complex issue related to TeX's output routine,
column balancing, and float/footnote queues, which the* cuted* package
tries to manage with TeX macros (like *\onecolumngrid*).
Is it conceivable that a Lua-based approach (perhaps using callbacks like
*pre_output_filter* or managing the vertical lists directly) could handle
the transition? For example, could Lua be used to:
- Force-process the pending floats and footnotes before the column
switch is executed?
- "Snapshot" the state of the footnote/float lists and re-insert them
correctly after the switch?
I am raising this here specifically to ask if a Lua-based solution is a
viable path to explore for this kind of complex page-layout challenge,
where traditional package macros seem to struggle.
Thank you for any insights. Any help would be greatly appreciated.
*MWE:*
\documentclass[twocolumn]{article}
\usepackage{lipsum}\usepackage{stfloats}\usepackage{cuted}
\begin{document}
\section{Introduction}
Para 1: \lipsum[1-5]
\begin{figure}[t]\fbox{\vbox to 10pc{\hbox to
.98\columnwidth{}}}\caption{This is single col figure 1.}\end{figure}
Para 2: \lipsum[6-8]
\begin{figure*}[b]\fbox{\vbox to 10pc{\hbox to
\textwidth{}}}\caption{single col figure 2.}\end{figure*}
Para 3: \lipsum[8]\footnote{fn1}\footnote{fn2}
Para 4: \lipsum[8]
\switchonecolumn
\section*{Appendix}
Para A1: \lipsum[1-4]
\switchtwocolumn
\end{document}
*Current output:*
[image: current output] <https://i.sstatic.net/gYezEZ3I.png>
*Link: **https://i.sstatic.net/gYezEZ3I.png
<https://i.sstatic.net/gYezEZ3I.png>*
*Expected output:*
[image: expected output] <https://i.sstatic.net/51hMKteH.png>
*Link: https://i.sstatic.net/51hMKteH.png
<https://i.sstatic.net/51hMKteH.png>*
Kumaresh P
Engineering Lead
P: +91 44 4596 4800
<https://tnqtech.com/> <https://www.linkedin.com/company/tnqtech/>
>
--
Disclaimer: The entire content of this email message, including any files
transmitted with it are confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you are not the named
addressee or part of the entity, you should not disseminate, distribute, or
copy this email. Please notify the sender immediately by e-mail if you have
received this email by mistake and delete this e-mail from your system. If
you are not the intended recipient you are notified that disclosing,
copying, distributing, or taking any action in reliance on the contents of
this information is strictly prohibited.
_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]