How can I fit an image a two-column style confrence paperso that the image can appear in the middle of the page?
Can you please share an example code with me? Thanks
graphicstwo-column
How can I fit an image a two-column style confrence paperso that the image can appear in the middle of the page?
Can you please share an example code with me? Thanks
The tabularx
package is good to fit a tabular to a specified width. Here it’s the current \linewidth
(→ Difference between \textwidth, \linewidth and \hsize).
I guessed that the two most left columns should be twice as wide as the other ones. According to this I have set \hsize
. (The sum of all \hsize
still have to be the number of X
columns.)
I have also reduced the horizontal space between columns:
\setlength{\tabcolsep}{.3\tabcolsep}
With the \cline{2-10}
you can specify a \hline
that only goes from the second to the tenth column.
\documentclass[twocolumn]{article}
\usepackage{tabularx}
\newcolumntype{F}{>{\bfseries}c}
\begin{document}
\begin{table}[t]
\centering\setlength{\tabcolsep}{.3\tabcolsep}
\begin{tabularx}{\linewidth}{|*2{>{\centering\hsize=1.6666\hsize}X|}*8{>{\centering\arraybackslash\hsize=.83333\hsize}X|}}
\hline
\multicolumn{2}{|c|}{} & \multicolumn{8}{F|}{Wrist} \\
\multicolumn{2}{|c|}{} & \multicolumn{2}{F}{1} & \multicolumn{2}{F}{2} & \multicolumn{2}{F}{3} & \multicolumn{2}{F|}{4} \\ \hline
Upper & Lower & \multicolumn{2}{c|}{Twist} & \multicolumn{2}{c|}{Twist} & \multicolumn{2}{c|}{Twist} & \multicolumn{2}{c|}{Twist} \\
Arm & Arm & 1 & 2 & 1 & 2 & 1 & 2 & 1 & 2 \\ \hline
& 1 & 1 & 2 & 2 & 2 & 2 & 3 & 3 & 3 \\ \cline{2-10}
1 & 2 & 2 & 2 & 2 & 2 & 3 & 3 & 3 & 3 \\ \cline{2-10}
& 3 & 2 & 3 & 3 & 3 & 3 & 3 & 4 & 4 \\ \hline
& 1 & 2 & 3 & 3 & 3 & 3 & 4 & 4 & 4 \\
2 & 2 & 3 & 3 & 3 & 3 & 3 & 4 & 4 & 4 \\
& 3 & 3 & 4 & 4 & 4 & 4 & 4 & 5 & 5 \\ \hline
& 1 & 3 & 3 & 4 & 4 & 4 & 4 & 5 & 5 \\
3 & 2 & 3 & 4 & 4 & 4 & 4 & 4 & 5 & 5 \\
& 3 & 4 & 4 & 4 & 4 & 4 & 5 & 5 & 5 \\ \hline
& 1 & 4 & 4 & 4 & 4 & 4 & 5 & 5 & 5 \\
4 & 2 & 4 & 4 & 4 & 4 & 4 & 5 & 5 & 5 \\
& 3 & 4 & 4 & 4 & 5 & 5 & 5 & 6 & 6 \\ \hline
& 1 & 5 & 5 & 5 & 5 & 5 & 6 & 6 & 7 \\
5 & 2 & 5 & 6 & 6 & 6 & 6 & 6 & 7 & 7 \\
& 3 & 6 & 6 & 6 & 7 & 7 & 7 & 7 & 8 \\ \hline
& 1 & 7 & 7 & 7 & 7 & 7 & 8 & 8 & 9 \\
6 & 2 & 8 & 8 & 8 & 8 & 8 & 9 & 9 & 9 \\
& 3 & 9 & 9 & 9 & 9 & 9 & 9 & 9 & 9 \\ \hline
\end{tabularx}
\caption{Wrist and arms scores table}
\end{table}
\end{document}
May be this is what you are after:
\documentclass[11pt,twocolumn,conference]{IEEEtran}
\usepackage{amsmath,array,graphicx}
\usepackage{kantlipsum}
\begin{document}
\kant[1-2]
\begin{table}[htb]
\caption{hello2 testing}
\label{1234}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{c*{5}{>{$}c<{$}}}
& \text{LfdR} & \text{KLSRf} & \text{MLDFSP} & \text{PNDND} & \text{LDFSSVM} \\
Aa & 97.8\pm 2.3 & 97.4\pm 3.0 & 97.4\pm 3.0 & 97.0\pm 3.6 & 99.1\pm 1.8 \\
Al & 69.8\pm 9.5 & 93.6\pm 3.6 & 86.9\pm 8.4 & 91.5\pm 4.5 & 94.9\pm 5.4 \\
Av & 97.0\pm 2.9 & 99.2\pm 1.8 & 99.6\pm 1.4 & 98.3\pm 2.9 & 99.6\pm 1.4 \\
Aw & 97.8\pm 3.1 & 95.3\pm 3.1 & 96.2\pm 2.5 & 92.4\pm 3.3 & 97.5\pm 3.0 \\
Ay & 77.5\pm 7.2 & 90.2\pm 4.1 & 90.2\pm 5.7 & 88.1\pm 4.8 & 91.6\pm 4.9 \\
avg & 88.0 & 95.1 & 94.1 & 93.5 & 96.5
\end{tabular}
}
\end{table}
\kant[3-5]
\end{document}
I have used \resizebox
from graphicx
package ti re-size the table to fit inside the column. Also, I have replaced all +-
in to \pm
.
Best Answer
h
works in two column just as one columnwill make the float appear "here" i.e. mid column if it fits at that point.