Two column document with the table intruding into the second column

Christopher G yesterday at 06:24. 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

Language

Popular Tags