0

Hello I am using Overleaf for writing a paper for IEEE and I am having a bit of difficulties formatting a table.

Below the incorrect table I have so far:

enter image description here

And below the correct table I am trying to achieve. Notice that it extend across the two columns and between the header "Top 10 journals - PM-SSCM" and the header "Top 10 journals - DST-SSCM" there is a break that I am also trying to achieve.

enter image description here

Below the script I have so far:

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{booktabs,chemformula}
\usepackage{multirow,booktabs,blindtext}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{booktabs, makecell}
\usepackage{float}
\usepackage{seqsplit, collcell, ragged2e}
\newcolumntype{Y}{>{\arraybackslash\collectcell\seqsplit}X<{\endcollectcell}}
\usepackage{lipsum}

// some paragraphs....

\begin{table}[ht] \centering \small \setlength{\tabcolsep}{4pt} \makegapedcells \begin{tabularx}{\linewidth}{@{}L{0.8}L{1.1}L{1.1} @{}} \toprule Top ten journals related to QUERY-1 \ \midrule Journal Title & Publication \ & Journal of cleaner Production & 40 \ & International Journal of Production Economics & 28 \ & International Journal of Production Research & 23 \ & Supply Chain Management an International Journal & 20 \ & Business Strategy and the Environment & 40 \ & International Journal of Operations Production Management & 28 \ & International Journal of Production Research & 23 \ & Supply Chain Management an International Journal & 20 \ \bottomrule \toprule Top ten journals related to QUERY-1 \ \midrule Journal Title & Publication \ & Journal of cleaner Production & 40 \ & International Journal of Production Economics & 28 \ & International Journal of Production Research & 23 \ & Supply Chain Management an International Journal & 20 \ & Business Strategy and the Environment & 40 \ & International Journal of Operations Production Management & 28 \ & International Journal of Production Research & 23 \ & Supply Chain Management an International Journal & 20 \ \bottomrule \end{tabularx} \end{table}

I studied the following table which was helpful for understanding the concept of multi-headers.

I have used the following source in order to achieve the type of table I wanted and that was useful but I have some formatting problems as shown in the picture. Also I understand this is not totally related to the example I am trying to achieve but it was useful to understand the main idea/concept.

Also came across this other post which was also useful but not enough for me to be able to properly solve the problem.

Thanks for pointing in the right direction to find a solution.

Bernard
  • 271,350
Emanuele
  • 143
  • How do you define the L column type? – Bernard Jun 28 '21 at 17:38
  • Hello @Bernard and thanks for reading the question. I defined L from this post – Emanuele Jun 28 '21 at 17:40
  • The problem is that I never built a multi-header table and because of that I am not entirely sure about the proper definition of L. This post was useful too but it confused me because of the empty space in the double-header. – Emanuele Jun 28 '21 at 17:42
  • 1
    I don't understand why each of your tables have 3 columns, but you seem to need only 2 really. – Bernard Jun 28 '21 at 17:54
  • That is what I thought too but that also does not work. If I change the statement from \begin{tabularx}{\linewidth}{@{}L{0.8}L{1.1}L{1.1} @{}} to \begin{tabularx}{\linewidth}{@{}L{1.1}L{1.1} @{}} this is the result. As you see nothing really changes. So I am not really sure what to do. – Emanuele Jun 28 '21 at 18:28

1 Answers1

2

Here is a solution, with X and c columns:

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
%\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{booktabs,chemformula}
\usepackage{multirow,booktabs,blindtext}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{booktabs, makecell}%
\usepackage{float}
\usepackage{seqsplit, collcell, ragged2e}
\newcolumntype{Y}{>{\arraybackslash\collectcell\seqsplit}X<{\endcollectcell}}
\newcolumntype{L}[1]{>{\RaggedRight\hspace{0pt}%
                     \hsize=#1\hsize}X}
\usepackage{lipsum}

\begin{document}

\begin{table}[ht] \centering \small \setlength{\tabcolsep}{4pt} \setcellgapes{3pt} \makegapedcells \begin{tabularx}{\linewidth}{@{}X c !{\qquad}Xc} \toprule Top ten journals related to QUERY-1 & & Top ten journals related to QUERY-1 \ \cmidrule(r{1.8em}){1-2} \cmidrule{3-4} Journal Title & Publication & Journal Title & Publication \ \midrule Journal of cleaner Production & 40 & Journal of cleaner Production & 40 \ International Journal of Production Economics & 28 & International Journal of Production Economics & 28 \ International Journal of Production Research & 23 & International Journal of Production Research & 23 \ Supply Chain Management an International Journal & 20 & Supply Chain Management an International Journal & 20 \ Business Strategy and the Environment & 40 & Business Strategy and the Environment & 40 \ International Journal of Operations Production Management & 28 & International Journal of Operations Production Management & 28 \ International Journal of Production Research & 23 & International Journal of Production Research & 23 \ Supply Chain Management an International Journal & 20 & Supply Chain Management an International Journal & 20 \ \bottomrule \end{tabularx} \end{table}

\end{document}

enter image description here

Bernard
  • 271,350