TransWikia.com

How to convert a tabularx table into longtable in twocolumn class?

TeX - LaTeX Asked on August 28, 2021

I have created a table. I used template of springer which has a documentclass[twocolumn] class. the table is shown in the following figure:

enter image description here

my code :

documentclass[twocolumn]{svjour3}   
    gsave
    newpath
      20 20 moveto
      20 220 lineto
      220 220 lineto
      220 20 lineto
    closepath
    2 setlinewidth
    gsave
      .4 setgray fill
    grestore
    stroke
    grestore
    end{filecontents*}
    %
    RequirePackage{fix-cm}
    begin{filecontents*}{Draft Paper.eps}
    
    usepackage{booktabs,array,enumitem,ragged2e}
    begin{document}
    
    begin{table} [htp]
    
        setcellgapes{2pt}
        centering
        scriptsize
      makegapedcells
    begin{tabularx}{linewidth}
    {| p{0.007textwidth} | p{0.068textwidth} | p{0.1535textwidth} | p{0.1535textwidth}  |  }  
      hline
      
    %%%%  
    multicolumn{2}{|p{0.1textwidth}|}{  A} & B & C hline
    %%%%
    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    
     hline 
      end{tabularx}
      end{table}
    
    
    bibliographystyle{spmpsci_copy}
    bibliography{Bibliography}
    
    
    
    end{document}

How to active the auto-break of my table, i mean that I want to replace automatic the part of the table which penetrates the limits to next page as shown in that picture :

enter image description here

One Answer

Do not use the environment table it cannot have a column- or pagebreak. Use in this case package supertabular. But remember, that a break is only possible between two tabular lines and not inside a tabular line:

documentclass[twocolumn]{svjour3}  
usepackage{microtype} 
usepackage{supertabular,booktabs,array,enumitem,ragged2e}
begin{document}
    
small
tablehead{hlinemulticolumn{2}{|l|}{  A} & B & C hline}
tabletail{hline}
begin{supertabular}
    {| l | p{0.068textwidth} | p{0.17textwidth} | p{0.17textwidth}  |  }  
      hline
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
     hline     
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.    
     hline    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.    
     hline 
    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
     hline    
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
     hline     
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
     hline 
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.     
     hline 
    multicolumn{2}{|l|}{MADM} & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book.    
      & 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
     been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
     galley of type and scrambled it to make a type specimen book. 

end{supertabular}

normalsize    
end{document}

enter image description here

Answered by user187802 on August 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP