línea extra en látex de mesa

línea extra en látex de mesa

Quiero hacer una tabla en LaTeX y escribí el siguiente programa:

\documentclass[]{article}
\usepackage{graphicx}
\usepackage{color}
\begin{document}

\begin {center}
\begin {tabular}{| l | l | l | l | l | l |}
\cline{2-6}
& \multicolumn{5}{ |c| }{$\eta_{\infty}$} \\  \cline{2-6}  
&  i=1,f=6 & i=1,f=3 & i=3,f=5& i=4,f=2& i=6,f=3 \\ \hline
$k,l=0,0$  & \textcolor{blue}{0.1811} & \textcolor{blue}{0.1811}&       \textcolor{blue}{0.1811}& \textcolor{blue}{0.1811}& \textcolor{blue}{0.1811} \\ \hline
$k,l=1,2$  &0.3788 &0.3788 &0.2898 &0.2220 &0.2898 \\ \hline
$k,l=1,3$  &0.3788 &\textcolor{red}{0.9393} &0.2898 &0.2898 &0.2220  \\ \hline
$k,l=1,4$  &0.3788 &0.3788 &0.2898 &0.3788 &0.2898  \\ \hline
$k,l=1,5$  &0.3788 &0.3788 &0.2220 &0.2898 &0.2898 \\ \hline
$k,l=1,6$  &\textcolor{red}{0.9393} &0.3788 &0.2898 &0.2898 &0.3788 \\ \hline
$k,l=2,3$  &0.2898 &0.2220 &0.3788 &0.2220 &0.2220 \\ \hline
$k,l=2,4$  &0.2898 &0.2898 &0.2898 &\textcolor{red}{0.9393} &0.2898 \\ \hline
$k,l=2,5$  &0.2898 &0.2898 &0.2220 &0.2220 &0.2898 \\ \hline
$k,l=2,6$  &0.2220 &0.2898 &0.2898 &0.2220 &0.3788\\ \hline
$k,l=3,4$  &0.2898 &0.2220 &0.3788 &0.3788 &0.2220  \\ \hline
$k,l=3,5$  &0.2898 &0.2220 &\textcolor{red}{0.9393} &0.2898 &0.2220  \\ \hline
$k,l=3,6$  &0.2220 &0.2220 &0.3788 &0.2898 &\textcolor{red}{0.9393}  \\ \hline
$k,l=4,5$  &0.2898 &0.2898 &0.2220 &0.3788 &0.2898  \\ \hline
$k,l=4,6$  &0.2220 &0.2898 &0.2898 &0.3788 &0.3788 \\ \hline
$k,l=5,6$  &0.2220 &0.2898 &0.2220 &0.2898 &0.3788  \\ \hline

\end {tabular}\\ 
 Table 2: System efficiency for different k,l and i,f.
\end {center}
\end{document}

Algunas de las celdas tienen una línea vertical adicional en la primera columna, ¿cómo puedo omitirla? ¡Gracias por tu pronta respuesta!

Respuesta1

ingrese la descripción de la imagen aquí

\documentclass[]{article}
\usepackage{graphicx}
\usepackage{color}
\begin{document}

\begin {table}\centering
\begin {tabular}{| l | l | l | l | l | l |}
\cline{2-6}
\multicolumn{1}{c|}{}&\multicolumn{5}{c| }{$\eta_{\infty}$} \\  \cline{2-6}  
\multicolumn{1}{c|}{}&  i=1,f=6 & i=1,f=3 & i=3,f=5& i=4,f=2& i=6,f=3 \\ \hline
$k,l=0,0$  & \textcolor{blue}{0.1811} & \textcolor{blue}{0.1811}&       \textcolor{blue}{0.1811}& \textcolor{blue}{0.1811}& \textcolor{blue}{0.1811} \\ \hline
$k,l=1,2$  &0.3788 &0.3788 &0.2898 &0.2220 &0.2898 \\ \hline
$k,l=1,3$  &0.3788 &\textcolor{red}{0.9393} &0.2898 &0.2898 &0.2220  \\ \hline
$k,l=1,4$  &0.3788 &0.3788 &0.2898 &0.3788 &0.2898  \\ \hline
$k,l=1,5$  &0.3788 &0.3788 &0.2220 &0.2898 &0.2898 \\ \hline
$k,l=1,6$  &\textcolor{red}{0.9393} &0.3788 &0.2898 &0.2898 &0.3788 \\ \hline
$k,l=2,3$  &0.2898 &0.2220 &0.3788 &0.2220 &0.2220 \\ \hline
$k,l=2,4$  &0.2898 &0.2898 &0.2898 &\textcolor{red}{0.9393} &0.2898 \\ \hline
$k,l=2,5$  &0.2898 &0.2898 &0.2220 &0.2220 &0.2898 \\ \hline
$k,l=2,6$  &0.2220 &0.2898 &0.2898 &0.2220 &0.3788\\ \hline
$k,l=3,4$  &0.2898 &0.2220 &0.3788 &0.3788 &0.2220  \\ \hline
$k,l=3,5$  &0.2898 &0.2220 &\textcolor{red}{0.9393} &0.2898 &0.2220  \\ \hline
$k,l=3,6$  &0.2220 &0.2220 &0.3788 &0.2898 &\textcolor{red}{0.9393}  \\ \hline
$k,l=4,5$  &0.2898 &0.2898 &0.2220 &0.3788 &0.2898  \\ \hline
$k,l=4,6$  &0.2220 &0.2898 &0.2898 &0.3788 &0.3788 \\ \hline
$k,l=5,6$  &0.2220 &0.2898 &0.2220 &0.2898 &0.3788  \\ \hline
\end {tabular}

\caption{System efficiency for different $k,l$ and $i,f$.}
\end {table}
\end{document}

Respuesta2

Además de la solución de David Carlisle, prefiero suprimir todas las líneas verticales y utilizar el paquete booktabsand cellspace. Este paquete garantiza espacios verticales mínimos en la parte superior e inferior de las celdas en columnas con un especificador con el prefijo S. También utilicé el table environment, and acomando \caption`, para que puedas tener referencias cruzadas a esta tabla:

\documentclass[]{article}
\usepackage{graphicx}
\usepackage{array}
\usepackage{color}
\usepackage{cellspace, booktabs}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\begin{document}

\begin{table}
\centering
\begin {tabular}{Sl*{5}{Sc}}
& \multicolumn{5}{Sc }{$\eta_{\infty}$} \\
\cmidrule[\heavyrulewidth]{2-6}
 & i=1,f=6 & i=1,f=3 & i=3,f=5& i=4,f=2& i=6,f=3 \\
 \midrule
$k,l=0,0$ & \textcolor{blue}{0.1811} & \textcolor{blue}{0.1811}& \textcolor{blue}{0.1811}& \textcolor{blue}{0.1811}& \textcolor{blue}{0.1811} \\
$k,l=1,2$ &0.3788 &0.3788 &0.2898 &0.2220 &0.2898 \\
$k,l=1,3$ &0.3788 &\textcolor{red}{0.9393} &0.2898 &0.2898 &0.2220 \\
$k,l=1,4$ &0.3788 &0.3788 &0.2898 &0.3788 &0.2898 \\
$k,l=1,5$ &0.3788 &0.3788 &0.2220 &0.2898 &0.2898 \\
$k,l=1,6$ &\textcolor{red}{0.9393} &0.3788 &0.2898 &0.2898 &0.3788 \\
$k,l=2,3$ &0.2898 &0.2220 &0.3788 &0.2220 &0.2220 \\
$k,l=2,4$ &0.2898 &0.2898 &0.2898 &\textcolor{red}{0.9393} &0.2898 \\
$k,l=2,5$ &0.2898 &0.2898 &0.2220 &0.2220 &0.2898 \\
$k,l=2,6$ &0.2220 &0.2898 &0.2898 &0.2220 &0.3788\\ 
$k,l=3,4$ &0.2898 &0.2220 &0.3788 &0.3788 &0.2220 \\
$k,l=3,5$ &0.2898 &0.2220 &\textcolor{red}{0.9393} &0.2898 &0.2220 \\
$k,l=3,6$ &0.2220 &0.2220 &0.3788 &0.2898 &\textcolor{red}{0.9393} \\
$k,l=4,5$ &0.2898 &0.2898 &0.2220 &0.3788 &0.2898 \\
$k,l=4,6$ &0.2220 &0.2898 &0.2898 &0.3788 &0.3788 \\
$k,l=5,6$ &0.2220 &0.2898 &0.2220 &0.2898 &0.3788 \\
\bottomrule
\end {tabular}
\caption{System efficiency for different $ k,l $ and i,f.}\label{effi}
\end {table}

ingrese la descripción de la imagen aquí

Respuesta3

Aquí hay una solución que reorganiza el material en la segunda fila del encabezado para que se ajuste a la forma de la primera columna. También utiliza el Stipo de columna (del siunitxpaquete) para alinear los puntos de datos numéricos en las columnas 2 a 6 en el marcador decimal. (He cambiado algunos de los números, para que tengan dos o tres dígitos después del marcador decimal, para resaltar el efecto de esta configuración). Además, sugiero deshacernos de todas las reglas verticales y de la mayoría de las reglas horizontales; Créame, no los extrañaremos.

ingrese la descripción de la imagen aquí

\documentclass{article}
\usepackage{color,siunitx,booktabs}
\begin{document}
\begin{table}
\begin{tabular*}{\textwidth}{ @{} @{\extracolsep{\fill}} l *{5}{S[table-format=1.4]} @{} }
\toprule
& \multicolumn{5}{ c@{} }{$\eta_{\infty}$} \\  
\cmidrule(l){2-6}  
& {$i,f=1,6$}& {$i,f=1,3$}& {$i,f=3,5$}& {$i,f=4,2$}& {$i,f=6,3$} \\ 
\midrule
$k,l=0,0$  & \color{blue}0.1811& \color{blue}0.1811&       \color{blue}0.1811& \color{blue}0.1811& \color{blue}0.1811 \\ 
$k,l=1,2$  &0.38 &0.38 &0.2898 &0.222 &0.2898 \\ 
$k,l=1,3$  &0.38 &\color{red}0.9393&0.2898 &0.2898 &0.222  \\ 
$k,l=1,4$  &0.38 &0.38 &0.2898 &0.38 &0.2898  \\ 
$k,l=1,5$  &0.38 &0.38 &0.222 &0.2898 &0.2898 \\ 
$k,l=1,6$  &\color{red}0.9393&0.38 &0.2898 &0.2898 &0.38 \\ 
$k,l=2,3$  &0.2898 &0.222 &0.38 &0.222 &0.222 \\ 
$k,l=2,4$  &0.2898 &0.2898 &0.2898 &\color{red}0.9393&0.2898 \\ 
$k,l=2,5$  &0.2898 &0.2898 &0.222 &0.222 &0.2898 \\ 
$k,l=2,6$  &0.222 &0.2898 &0.2898 &0.222 &0.38\\ 
$k,l=3,4$  &0.2898 &0.222 &0.38 &0.38 &0.222  \\ 
$k,l=3,5$  &0.2898 &0.222 &\color{red}0.9393&0.2898 &0.222  \\ 
$k,l=3,6$  &0.222 &0.222 &0.38 &0.2898 &\color{red}0.9393  \\ 
$k,l=4,5$  &0.2898 &0.2898 &0.222 &0.38 &0.2898  \\ 
$k,l=4,6$  &0.222 &0.2898 &0.2898 &0.38 &0.38 \\ 
$k,l=5,6$  &0.222 &0.2898 &0.222 &0.2898 &0.38  \\ 
\bottomrule
\end{tabular*} 
\caption{System efficiency for various combinations of $k,l$ and $i,f$.}
\end{table}
\end{document}

información relacionada