An hline input bug?

Thomas Schneider schneidt at mail.nih.gov
Mon Sep 20 13:04:38 CEST 2021


This problem did not occur with a previous 2018 version of latex
(Version 3.14159265-2.6-1.40.19 (TeX Live 2018)), but after upgrading
to the latest latex:

% latex --version
pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021)

For this tex file:

================= hline.tex =================
\documentclass[12pt]{article}
\begin{document}
\begin{tabular}{|cr|} \hline
\input{mytable.tex} 
\hline
\end{tabular}
\end{document}
=============================================

where this file is being input:

================= mytable.tex =================
a & 1 \\
b & 2 \\
c & 3 \\
===============================================

This should make a little table like so:

______
|a  1|
|b  2|
|c  3|
------

However, it now gives an error that I did not get for the 2018 version
of latex:

=====
 (./mytable.tex)
! Misplaced \noalign.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.5 \hline
          
? 
! Emergency stop.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.5 \hline
          
End of file on the terminal!
=====

google:
\hline ->\noalign
https://www.google.com/search?&q=\hline+->\noalign
https://www.overleaf.com/learn/latex/Errors/Misplaced_%5Cnoalign

Apparently the \hline now thinks it is not following a \\ because the
data come from an \input.

\input{mytable.tex}\hline

also fails.

Putting the \hline into the input file works, but now there is an
extra vertical bar on the left just below the table like this:

______
|a  1|
|b  2|
|c  3|
------
|

I am reading the table in because it is generated by other programs.

Is there a way to do this?

(For now I'm getting around the problem by putting the entire tabular
into the input file and it works properly.)

Tom

  Thomas D. Schneider, Ph.D.
  Senior Investigator
  National Institutes of Health
  National Cancer Institute
  Center for Cancer Research
  RNA Biology Laboratory
  Biological Information Theory Group
  Frederick, Maryland  21702-1201
  schneidt at mail.nih.gov
  https://alum.mit.edu/www/toms


More information about the texhax mailing list.