Two column document with the table intruding into the second column

Christopher G 10/14/2018 at 22:25. 3 answers, 0 views
tables two-column article

I'm currently having this issue where the table is intruding into the second column and I can't figure out what I've done wrong...

table intruding on second column

\documentclass[twoside,twocolumn]{article}
\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} 
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} 
\usepackage[utf8]{inputenc}
\setlength{\arrayrulewidth}{0.25mm}
\setlength{\tabcolsep}{9pt}
\renewcommand{\arraystretch}{1.5}
\begin{document}
\begin{table}[ht]
\begin{tabular}{ p{5cm} p{5.3cm} } 
\hline 
Parameter & Condition \\
\hline
Flow Rate & $4.5 \frac{\text{mL}}{\text{min}}$ \\
Carrier gas & Nitrogen \\
Column type & HP-$5$  \\
Column dimensions & \SI{10}{m} long $\times$ \SI{0.53}{mm} ID  \\
Injection port temperature & \SI{140}{\celsius}  \\
Oven temperature & \SI{40}{\celsius} \\
Attenuation & Automatically done by computer \\
Sample size & $\num{3.00000e-1}\frac{\text{ng}}{\text{ul}}$ \\
Number of products & $2$  \\ 
Types of products & Butenes \\  [1ex] % [1ex] adds vertical space[1ex]
\hline %inserts single line
\end{tabular}
\caption{GC parameters on}
\label{table:nonlin} % is used to refer this table in the text
\end{table}
\end{document}

3 Answers


Fran 03/04/2018.

mwe

\documentclass[twoside,twocolumn]{article}
\usepackage{amsmath,siunitx,booktabs,lipsum}
\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} 
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} 
\usepackage[utf8]{inputenc}
\setlength{\arrayrulewidth}{0.25mm}
\setlength{\tabcolsep}{9pt}
\renewcommand{\arraystretch}{1.5}

\begin{document}

\begin{table}[ht]
\setlength{\tabcolsep}{9pt}
\begin{tabular*}{\linewidth}{@{}p{\dimexpr.5\linewidth-\tabcolsep}p{\dimexpr.5\linewidth-\tabcolsep}@{}} 
\toprule 
Parameter & Condition \\
\midrule
Flow Rate & $4.5 \frac{\text{mL}}{\text{min}}$ \\
Carrier gas & Nitrogen \\
Column type & HP-$5$  \\
Column dimensions & \SI{10}{m} long $\times$ \SI{0.53}{mm} ID  \\
Injection port temperature & \SI{140}{\celsius}  \\
Oven temperature & \SI{40}{\celsius} \\
Attenuation & Automatically done by computer \\
Sample size & $\num{3.00000e-1}\frac{\text{ng}}{\text{ul}}$ \\
Number of products & $2$  \\ 
Types of products & Butenes \\  [1ex] % [1ex] adds vertical space[1ex]
\bottomrule %inserts single line
\end{tabular*}
\caption{GC parameters on}
\label{table:nonlin} % is used to refer this table in the text
\end{table}

\lipsum[1-10]
\end{document}

Edit: To have a table taking two columns but without using table* environment to avoid the jump to the next page, you can use cuted and capt-of packages:

enter image description here

\documentclass[twoside,twocolumn]{article}
\usepackage{amsmath,siunitx,booktabs,lipsum,cuted,capt-of}
\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} 
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} 
\usepackage[utf8]{inputenc}
\setlength{\arrayrulewidth}{0.25mm}
\setlength{\tabcolsep}{9pt}
\renewcommand{\arraystretch}{1.5}

\begin{document}
\section{Nulla malesuada} 
\lipsum[3]
\begin{strip}
\begin{tabular*}{\linewidth}{@{}p{\dimexpr.5\linewidth-\tabcolsep}p{\dimexpr.5\linewidth-\tabcolsep}@{}} 
\toprule 
Parameter & Condition \\
\midrule
Flow Rate & $4.5 \frac{\text{mL}}{\text{min}}$ \\
Carrier gas & Nitrogen \\
Column type & HP-$5$  \\
Column dimensions & \SI{10}{m} long $\times$ \SI{0.53}{mm} ID  \\
Injection port temperature & \SI{140}{\celsius}  \\
Oven temperature & \SI{40}{\celsius} \\
Attenuation & Automatically done by computer \\
Sample size & $\num{3.00000e-1}\frac{\text{ng}}{\text{ul}}$ \\
Number of products & $2$  \\ 
Types of products & Butenes \\  
\bottomrule 
\end{tabular*}
\captionof{table}{GC parameters on}
\end{strip}
\lipsum[1]
\section{Nam dui ligula}
\lipsum[2]
\end{document}

Kurt 03/04/2018.

You can use environment table* to get a table going over both columns ...

The the following MWE (important code changings marked with <======)

\documentclass[twoside,twocolumn]{article}

\usepackage[utf8]{inputenc}

\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} 
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} 

\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{blindtext} % <======= dummy text ===========================

\setlength{\arrayrulewidth}{0.25mm}
\setlength{\tabcolsep}{9pt}
\renewcommand{\arraystretch}{1.5}


\begin{document}
\Blindtext Code for the table
\begin{table*}[ht] % <==================================================
\centering
\begin{tabular}{ p{5cm} p{5.3cm} } 
\hline 
Parameter & Condition \\
\hline
Flow Rate & $4.5 \frac{\text{mL}}{\text{min}}$ \\
Carrier gas & Nitrogen \\
Column type & HP-$5$  \\
Column dimensions & \SI{10}{m} long $\times$ \SI{0.53}{mm} ID  \\
Injection port temperature & \SI{140}{\celsius}  \\
Oven temperature & \SI{40}{\celsius} \\
Attenuation & Automatically done by computer \\
Sample size & $\num{3.00000e-1}\frac{\text{ng}}{\text{ul}}$ \\
Number of products & $2$  \\ 
Types of products & Butenes \\  [1ex] % [1ex] adds vertical space[1ex]
\hline %inserts single line
\end{tabular}
\caption{GC parameters on}
\label{table:nonlin} % is used to refer this table in the text
\end{table*} % <========================================================
\Blindtext
\end{document}

and the resulting second page:

second page


Zarko 03/03/2018.

an alternative:

\documentclass[twoside,twocolumn]{article}
\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry}
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption}
\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{siunitx}
\setlength{\arrayrulewidth}{0.25mm}
\renewcommand{\arraystretch}{1.5}

\usepackage{lipsum}

\begin{document}
\lipsum[1]
\begin{table}[ht]
    \setlength{\tabcolsep}{3pt}
    \small
\begin{tabular}{@{}l >{\raggedright\arraybackslash}p{3.5cm}@{}}
\hline
Parameter & Condition \\
\hline
Flow Rate & $4.5 \frac{\text{mL}}{\text{min}}$ \\
Carrier gas & Nitrogen \\
Column type & HP-$5$  \\
Column dimensions & \SI{10}{m} long $\times$ \SI{0.53}{mm} ID  \\
Injection port temperature & \SI{140}{\celsius}  \\
Oven temperature & \SI{40}{\celsius} \\
Attenuation & Automatically done by computer \\
Sample size & $\num{3.00000e-1}\frac{\text{ng}}{\text{ul}}$ \\
Number of products & $2$  \\
Types of products & Butenes \\  [1ex] % [1ex] adds vertical space[1ex]
\hline %inserts single line
\end{tabular}
\caption{GC parameters on}
\label{table:nonlin} % is used to refer this table in the text
\end{table}
\lipsum
\end{document}

enter image description here


HighResolutionMusic.com - Download Hi-Res Songs

1 Martin Garrix

Yottabyte flac

Martin Garrix. 2018. Writer: Martin Garrix.
2 Alan Walker

Diamond Heart flac

Alan Walker. 2018. Writer: Alan Walker;Sophia Somajo;Mood Melodies;James Njie;Thomas Troelsen;Kristoffer Haugan;Edvard Normann;Anders Froen;Gunnar Greve;Yann Bargain;Victor Verpillat;Fredrik Borch Olsen.
3 Sia

I'm Still Here flac

Sia. 2018. Writer: Sia.
4 Blinders

Breach (Walk Alone) flac

Blinders. 2018. Writer: Dewain Whitmore;Ilsey Juber;Blinders;Martin Garrix.
5 Dyro

Latency flac

Dyro. 2018. Writer: Martin Garrix;Dyro.
6 Cardi B

Taki Taki flac

Cardi B. 2018. Writer: Bava;Juan Vasquez;Vicente Saavedra;Jordan Thorpe;DJ Snake;Ozuna;Cardi B;Selena Gomez.
7 Bradley Cooper

Shallow flac

Bradley Cooper. 2018. Writer: Andrew Wyatt;Anthony Rossomando;Mark Ronson;Lady Gaga.
8 Halsey

Without Me flac

Halsey. 2018. Writer: Halsey;Delacey;Louis Bell;Amy Allen;Justin Timberlake;Timbaland;Scott Storch.
9 Lady Gaga

I'll Never Love Again flac

Lady Gaga. 2018. Writer: Benjamin Rice;Lady Gaga.
10 Kelsea Ballerini

This Feeling flac

Kelsea Ballerini. 2018. Writer: Andrew Taggart;Alex Pall;Emily Warren.
11 Mako

Rise flac

Mako. 2018. Writer: Riot Music Team;Mako;Justin Tranter.
12 Dewain Whitmore

Burn Out flac

Dewain Whitmore. 2018. Writer: Dewain Whitmore;Ilsey Juber;Emilio Behr;Martijn Garritsen.
13 Bradley Cooper

Always Remember Us This Way flac

Bradley Cooper. 2018. Writer: Lady Gaga;Dave Cobb.
14 Little Mix

Woman Like Me flac

Little Mix. 2018. Writer: Nicki Minaj;Steve Mac;Ed Sheeran;Jess Glynne.
15 Charli XCX

1999 flac

Charli XCX. 2018. Writer: Charli XCX;Troye Sivan;Leland;Oscar Holter;Noonie Bao.
16 Rita Ora

Let You Love Me flac

Rita Ora. 2018. Writer: Rita Ora.
17 Diplo

Electricity flac

Diplo. 2018. Writer: Diplo;Mark Ronson;Picard Brothers;Wynter Gordon;Romy Madley Croft;Florence Welch.
18 Jonas Blue

Polaroid flac

Jonas Blue. 2018. Writer: Jonas Blue;Liam Payne;Lennon Stella.
19 Lady Gaga

Look What I Found flac

Lady Gaga. 2018. Writer: DJ White Shadow;Nick Monson;Mark Nilan Jr;Lady Gaga.
20 Avril Lavigne

Head Above Water flac

Avril Lavigne. 2018. Writer: Stephan Moccio;Travis Clark;Avril Lavigne.

Language

Popular Tags