I have an issue with \input when using the new versions of LuaLateX. I include this MWE and afterwards some figures of the issue. I'm testing the code in Overleaf.
The problem is that when I'm using LuaLateX version 2020 the outcome is Figure 1, while if a use newer ones (i.e. 2022) I get Figure 2. If you notice it seems that \input is including a white space. I have tried to apply the answer to this question but unfortunately it is not working in tables.
If I don't use \input and I directly insert the code in books.tex file in main.text everything works and I get Figure 1.
Could you please give me some hints?
TA
- main.tex
\documentclass[a4paper, 11pt]{scrartcl}
\usepackage[utf8x]{inputenc}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage[
left=1.8cm,
right=2cm,
top=3cm,
bottom=1.25cm
]{geometry}
\usepackage{longtable,tabu}
\newcount\totalcol
\newdimen\cola
\newdimen\colb
\newdimen\colc
\newdimen\cold
\newdimen\cole
\newdimen\colf
\usepackage{tabularx}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\arraybackslash\hspace{0pt}}m{#1}}
\renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}}
\newcommand{\mydata}[4]{
{#1} & {#2} & {#3} \
\hline
}
\begin{document}
\newcount\totalcol
\newdimen\cola
\newdimen\colb
\newdimen\colc
\totalcol=3
\cola=7.8cm
\colb=2.8cm
\colc=\dimexpr\textwidth-\tabcolsep\totalcol2-\arrayrulewidth*(1+\totalcol)-\cola-\colb\relax
\begin{longtable}{|>{\footnotesize}L{\cola}|>{\footnotesize}C{\colb}|>{\footnotesize}L{\colc}|}
\hline
\multicolumn{3}{|c|}{\large\textbf{Title}}\
\hline
\centering\small{Item 1} & \centering\small{Item 2} & \centering\arraybackslash\small{Item 3}\
\hline
\endhead
\hline
\endfoot%
\input{books}
\end{longtable}
\end{document}
- books.tex
\mydata{
a1}{
b1}{
c1}{
d1
}
\mydata{
a2}{
b2}{
c2}{
d2
}
\mydata{
a3}{
b3}{
c3}{
d3
}
- Figure 1
- Figure 2


\input booksinstead of\input{books}. BTW, you've got lots of spurious spaces, you shouldn't loadinputencwith LuaTeX, and I'm not entirely sure what\let\newline\\should be doing. – campa Aug 10 '23 at 13:42\inputyou have\\ \hlinethen a\parfrom the blank line then\end{longtable}so you have started a new row, – David Carlisle Aug 10 '23 at 15:35\parin a cell you will get a non empty cell unless you rely on low level tex primitives silently discarding it. so I'd say the output shown is the expected output even if tex primitive input manages to avoid it. – David Carlisle Aug 10 '23 at 15:39