2

I am using IEEEtran to prepare conference manuscript, but a table with just 3 columns didn't fit into the column of my manuscript.

I give a minimal code below to show the output. In this example, I only added on package \usepackage{lipsum} to display dummy text, and nothing else.

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts

\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{lipsum}  % the only added package..!

\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}

\title{Conference Paper Title*\\
{\footnotesize \textsuperscript{*}Note: Sub-titles are not captured in Xplore and
should not be used}
\thanks{Identify applicable funding agency here. If none, delete this.}
}

\author{\IEEEauthorblockN{1\textsuperscript{st} Given Name Surname}
\IEEEauthorblockA{\textit{dept. name of organization (of Aff.)} \\
\textit{name of organization (of Aff.)}\\
City, Country \\
email address or ORCID}
\and
\IEEEauthorblockN{2\textsuperscript{nd} Given Name Surname}
\IEEEauthorblockA{\textit{dept. name of organization (of Aff.)} \\
\textit{name of organization (of Aff.)}\\
City, Country \\
email address or ORCID}
\and
\IEEEauthorblockN{3\textsuperscript{rd} Given Name Surname}
\IEEEauthorblockA{\textit{dept. name of organization (of Aff.)} \\
\textit{name of organization (of Aff.)}\\
City, Country \\
email address or ORCID}

}

\maketitle

\begin{abstract}
This document is a model and instructions for \LaTeX.
This and the IEEEtran.cls file define the components of your paper [title, text, heads, etc.]. *CRITICAL: Do Not Use Symbols, Special Characters, Footnotes, 
or Math in Paper Title or Abstract.
\end{abstract}

\begin{IEEEkeywords}
component, formatting, style, styling, insert
\end{IEEEkeywords}

\section{Introduction}

\lipsum[2-5]

\section{Data Description}

This table extends beyond the column margins....


   \begin{table}%[htbp]
        \caption{Datasets' properties}
        \begin{center}
        \begin{tabular}{l|c|c}
        \hline 
                     & Dataset 1    & Dataset 2  \\
        \hline
       Collected in:     &      July 2011                 &   April 2007 - August 2012 \\
       \hline
       Sampling rate:    &   1- second                     &    1-5 seconds  \\
       \hline
       Location data: &  <timestamp, lat, lon, alt, speed, bearing>      &      5 modes used             \\
       \hline %\hline
        \end{tabular}
        \label{tab:datasets}
        \end{center}
    \end{table}

\end{document}

Output:

enter image description here

1 Answer 1

1

I suggest you switch from a tabular to a tabularx environment and employ a centered version of the X column type for the middle column, to allow automatic line breaking in the cells of that column.

A separate suggest: Lose the vertical rules. They're not needed, and they won't be missed.

enter image description here

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage[T1]{fontenc} % <-- new
\usepackage{lipsum} % filler text

% also new:
\usepackage{tabularx,ragged2e}
\newcolumntype{C}{>{\Centering}X} % define centered version of 'X' col. type

\begin{document}

\section*{Data Description}

\lipsum[1][1-4] % filler text

The table no longer extends beyond the column margins:

   \begin{table}[ht]
   \setlength\extrarowheight{3pt}
      \caption{Dataset Properties} 
      \label{tab:datasets}
      \centering
      \begin{tabularx}{0.9\columnwidth}{@{} lCc @{}}
      \hline 
      & Dataset 1   & Dataset 2  \\
      \hline
      Collected in  &  July 2011           &   April 2007--August 2012 \\
      %\hline
      Sampling rate &  1- second           &    1-5 seconds  \\
      %\hline
      Location data & <timestamp, lat, lon, alt, speed, bearing> & 5 modes used \\
      \hline 
      \end{tabularx}
   \end{table}

\lipsum[2][1-4] % more filler text

\end{document}
2
  • thank you. May I please ask what is the role of fontenc package here?
    – Amina Umar
    Jan 23, 2023 at 17:35
  • 1
    @AminaUmar - Did you notice that the < and > symbols weren't typeset correctly in the screenshot you posted? That's because in TeX's and LaTeX's default font encoding (which, for mainly historical reasons, is called OT1) the > and < characters are not expected to ever occur in text mode (as opposed to math mode). Running \usepackage[T1]{fontenc} tells LaTeX to employ the newer T1 font encoding, which happily does know how to handle < and > while in text mode.
    – Mico
    Jan 23, 2023 at 17:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .