3

I am trying to make the following table fit on one page.

I have tried to rotate the table by 90 degrees using the rotatebox option, however, I would like the table to be horizontal/regular.

I was wondering how I can make the text in the second column fit on the page, by making use of the vertical space in the right most column. The syntax I am using:

\begin{table}[h!]
\centering
\begin{tabular}{c|l}
Parameter & unit/description \\\hline
time & timestamp [sec]\\ \hline
icao24 & ICAO 24-bit address to identify a single airframe\\
lat/lon & 2D position\\
velocity & Ground speed [m/s]\\
heading & [degrees]\\
vertrate & vertical speed of the aircraft [m/s]\\
callsign & callsign broadcasted by the aircraft (may be the flight number, but not necessarily the case\\
onground & indicates whether the aircraft is on the ground or airborne (True/False respectively)\\
squawk & A four digit number used for identification of an aircraft, or signalling that an emergency is taking place\\
baroaltitude/geoaltitude & baroalitude as measured by the on-board barometer - dependent on the atmospheric conditions. Geoaltitude is determined through GPS [m]\\
lastposupdate & last time since the position was updated [s]\\
lastcontact & indicator on when OpenSky has last received a signal from the aircraft. Highly dependent on the coverage of OS receivers [s]. Note that the state vectors are generated up to 300 seconds after the last signal has been received\\
\end{tabular}
\caption{\label{tab:opensky}OpenSky database - parameters and units}
\end{table}

This yields the following error:

Overfull \hbox (671.47899pt too wide) in paragraph at lines 48--63
3
  • Welcome to TSE. Please post a Minimal Working Example, instead of a code snippet. Sep 19, 2022 at 19:27
  • For what it's worth, Overfull \hbox (671.47899pt too wide) is not technically an error message, or even a warning message. It simply means that one line in the table stuck 671.48pt, or about 9.3 inches or 23.6cm, into the right-hand margin. As far as TeX is concerned, not every typographic disaster is caused by a coding error...
    – Mico
    Sep 19, 2022 at 20:00
  • You are right, it indeed was not an error but rather a warning
    – user280364
    Sep 20, 2022 at 18:53

1 Answer 1

5

I don't think it's a good idea to switch the table contents to landscape format. Instead, I think you should allow automatic line breaking in the second column. This may be done with the help of a tabularx environment; I suggest you set its width to \textwidth. While you're at it, you could also tell LaTeX to provide for hanging indentation of continued lines.

enter image description here

\documentclass{article} % or some other suitable document class

\usepackage{tabularx,ragged2e}
% suspend full justification, arrange for hanging indentation:
\newcolumntype{L}{>{\RaggedRight\hangafter=1\hangindent=1em}X}

% measure desired width of first column:
\newlength\mylen
\settowidth\mylen{lastposupdate} % longest word in first column

\begin{document}

\begin{table}[h!]
\begin{tabularx}{\textwidth}{@{} p{\mylen} L @{}}
Parameter & unit/description \\ \hline
time      & timestamp [sec] \\  \hline
icao24    & ICAO 24-bit address to identify a single airframe\\
lat/lon   & 2D position\\
velocity  & Ground speed [m/s]\\
heading   & [degrees]\\
vertrate  & Vertical speed of the aircraft [m/s]\\
callsign  & Callsign broadcasted by the aircraft (may be the flight number, but not necessarily the case\\
onground  & Indicates whether the aircraft is on the ground or airborne (True/False respectively)\\
squawk    & A four digit number used for identification of an aircraft, or signalling that an emergency is taking place\\
baroaltitude\slash geoaltitude & Baroalitude as measured by the onboard barometer---dependent on the atmospheric conditions. Geoaltitude is determined through GPS [m]\\
lastposupdate & Last time since the position was updated [s]\\
lastcontact   & Indicator on when OpenSky has last received a signal from the aircraft. Highly dependent on the coverage of OS receivers [s]. Note that the state vectors are generated up to 300 seconds after the last signal has been received
\end{tabularx}

\caption{OpenSky database, parameters and units} \label{tab:opensky}

\end{table}

\end{document}
1
  • 1
    Many thanks for your solution! I have implemented it and works like a charm
    – user280364
    Sep 20, 2022 at 18:52

You must log in to answer this question.

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