\documentclass[a4paper,12pt]{article}
\usepackage[nottoc]{tocbibind}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{booktabs,siunitx}
\usepackage{color, colortbl}
\usepackage[table,svgnames]{xcolor}
%\usepackage{xcolor, colortbl}
%\usepackage{enumitem}
\usepackage{flafter}
%\usepackage{geometry}
\usepackage{float}
\usepackage{bigstrut}
\usepackage{makecell}
\usepackage{siunitx}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
left=20mm,
right=20mm
}
\usepackage{tgtermes}
%\usepackage{pslatex}
\usepackage{amsmath,amssymb,amsthm,textcomp}
\usepackage{enumerate}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{ragged2e}
\pagenumbering{arabic}
\usepackage{enumerate,mdwlist}
\sisetup{separate-uncertainty=true}
\definecolor{LightCyan}{rgb}{0.69,1.21,1.21}
\renewcommand{\refname}{Bibliography}
\linespread{1.3}
%\renewcommand{\contentsname{Table of Contents}}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\sffamily}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}
\begin{document}
\begin{table}[H]
\centering
\caption{Add caption}
\begin{tabular}{r r r r r r }
\hline
\rowcolor{LightCyan}
\thead{Current \textit{I}/ \si{\milli\ampere} \\ $\Delta I$ $\approx$ 0 \si{\milli\ampere}} & \thead{Voltage \textit{$V_{1}$}/ \si{\volt} \\ $\Delta$ $V_{1}$ = $\pm$ 0.01 \si{\volt}} & \thead{Voltage \textit{$V_{2}$}/ \si{\volt} \\ $\Delta$ $V_{2}$ = $\pm$ 0.0001 \si{\volt}} & \thead{Voltage $\frac{V_{1}}{V_{2}}$/ \si{\volt} \\ } & \thead{Fractional uncertainty\\$\frac{\Delta V_{1}}{V_{1}}$+$\frac{\Delta V_{2}}{V_{2}}$} & V1(V) \bigstrut\\
\hline
1 & 0.50 & 0.5837 & 0.8566044 & 0.0202 & 0.7500 \bigstrut\\
\hline
2 & 1.00 & 1.1875 & 0.8421053 & 0.0101 & 0.7500 \bigstrut\\
\hline
3 & 1.50 & 1.7928 & 0.8366801 & 0.0067 & 0.7500 \bigstrut\\
\hline
4 & 2.00 & 2.4034 & 0.8321544 & 0.0050 & 0.7500 \bigstrut\\
\hline
5 & 2.50 & 3.0182 & 0.8283083 & 0.0040 & 0.7500 \bigstrut\\
\hline
6 & 3.00 & 3.6359 & 0.8251052 & 0.0034 & 0.7500 \bigstrut\\
\hline
7 & 3.50 & 4.2556 & 0.8224457 & 0.0029 & 0.7500 \bigstrut\\
\hline
8 & 4.00 & 4.8728 & 0.8208833 & 0.0025 & 0.7500 \bigstrut\\
\hline
9 & 4.50 & 5.4929 & 0.8192394 & 0.0022 & 0.7500 \bigstrut\\
\hline
10 & 5.00 & 6.1217 & 0.8167666 & 0.0020 & 0.7500 \bigstrut\\
\hline
11 & 5.50 & 6.7480 & 0.8150563 & 0.0018 & 0.7500 \bigstrut\\
\hline
12 & 6.00 & 7.3694 & 0.8141775 & 0.0017 & 0.7500 \bigstrut\\
\hline
\end{tabular}%
\end{table}%
\end{document}
Respuesta1
micome adelantan (otra vez) durante 48 segundos...
\documentclass[a4paper,12pt]{article}
\usepackage[nottoc]{tocbibind}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{booktabs,siunitx}
\sisetup{separate-uncertainty=true}
\usepackage{color, colortbl}
\usepackage[table,svgnames]{xcolor}
\definecolor{LightCyan}{rgb}{0.69,1.21,1.21}
%\usepackage{xcolor, colortbl}
%\usepackage{enumitem}
\usepackage{flafter}
%\usepackage{geometry}
\usepackage{float}
\usepackage{bigstrut}
\usepackage{makecell}
\renewcommand\theadalign{tc}
\renewcommand\theadfont{\sffamily}
\renewcommand\theadgape{}
\setcellgapes{5pt}
\usepackage{siunitx}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
left=20mm,
right=20mm
}
\usepackage{tgtermes}
%\usepackage{pslatex}
\usepackage{amsmath,amssymb,amsthm,textcomp}
%\usepackage{enumerate}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{ragged2e}
\pagenumbering{arabic}
\usepackage{enumerate,mdwlist}
\renewcommand{\refname}{Bibliography}
\linespread{1.3}
%\renewcommand{\contentsname{Table of Contents}}
\begin{document}
\begin{table}[htb]
\centering
\caption{Add caption}
\setlength\tabcolsep{0pt}
\makegapedcells
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
S[table-format=2]
S[table-format=1.2]
S[table-format=1.4]
S[table-format=1.6]
*{2}{S[table-format=1.4]}
}
\toprule
{\thead{$I$/\si{\milli\ampere}\\ $\Delta I\approx 0$ \si{\milli\ampere}}}
& {\thead{$V_{1}$/\si{\volt}\\ $\Delta V_{1} = \SI{\pm 0.01}{\volt}$}}
& {\thead{$V_{2}$/\si{\volt}\\ $\Delta V_{2} = \SI{\pm e-4}{\volt}$}}
& {\thead{$\frac{V_{1}}{V_{2}}$/\si{\volt}}}
& {\thead{Fractional\\[-1ex] uncertainty\\
$\frac{\Delta V_{1}}{V_{1}}+\frac{\Delta V_{2}}{V_{2}}$}}
& {$V_1(V)$} \\
\midrule
1 & 0.50 & 0.5837 & 0.8566044 & 0.0202 & 0.7500 \\
2 & 1.00 & 1.1875 & 0.8421053 & 0.0101 & 0.7500 \\
3 & 1.50 & 1.7928 & 0.8366801 & 0.0067 & 0.7500 \\
4 & 2.00 & 2.4034 & 0.8321544 & 0.0050 & 0.7500 \\
5 & 2.50 & 3.0182 & 0.8283083 & 0.0040 & 0.7500 \\
6 & 3.00 & 3.6359 & 0.8251052 & 0.0034 & 0.7500 \\
7 & 3.50 & 4.2556 & 0.8224457 & 0.0029 & 0.7500 \\
8 & 4.00 & 4.8728 & 0.8208833 & 0.0025 & 0.7500 \\
9 & 4.50 & 5.4929 & 0.8192394 & 0.0022 & 0.7500 \\
10 & 5.00 & 6.1217 & 0.8167666 & 0.0020 & 0.7500 \\
11 & 5.50 & 6.7480 & 0.8150563 & 0.0018 & 0.7500 \\
12 & 6.00 & 7.3694 & 0.8141775 & 0.0017 & 0.7500 \\
\bottomrule
\end{tabular*}%
\end{table}%
\end{document}
en su preámbulo carga algunos paquetes dos veces... los comento arriba mwe. También corrijo la configuración para makecell
otros es más o menos la misma que enmicorespuesta.
Respuesta2
En primer lugar, debe hacer que algunas de las celdas del encabezado sean menos anchas; idealmente, insertando un par de saltos de línea en las columnas 4 y 5.
También simplificaría y racionalizaría todo el aspecto de la tabla, principalmente eliminando todas \hline
las directivas y usando, en su lugar, \toprule
, \midrule
( \addlinespace
2 casos) y \bottomrule
. Eso también le permitirá deshacerse de todas \bigstrut
las directivas.
Mostrar las relaciones de voltaje con 7 [!] dígitos significativos parece excesivo. Le sugiero que enumere algunas de las capacidades del siunitx
paquete para redondear las cifras a sólo 3 lugares. También parece inútil mostrar 4 dígitos en la columna final, cuando 2 dígitos bastarán.
Por otra parte, tengo que expresar mi opinión de que añadir color al material del encabezado no contribuye en absoluto a su legibilidad ni a la legibilidad de la tabla en su conjunto. Honestamente, no usaría colores, a menos que quisiera crear una apariencia llamativa. Finalmente, he mantenido su configuración de representar palabras en modo texto en las celdas del encabezado en sans-serif, pero debo confesar que no creo que agregue mucho (si es que aporta algo...).
\documentclass[12pt]{article}
%% (simplified the preamble as much as possible)
\usepackage[utf8]{inputenc}
\usepackage{booktabs,siunitx,float}
\usepackage{geometry}
\geometry{total={170mm,257mm},margin=20mm}
\usepackage{tgtermes}
\usepackage{setspace}
\setstretch{1.3}
\usepackage{makecell}
\renewcommand\theadalign{tc}
\renewcommand\theadfont{\sffamily}
\renewcommand\theadgape{\Gape[2pt]}
\renewcommand\cellgape{\Gape[2pt]}
\begin{document}
\begin{table}[H]
\centering
\sisetup{detect-mode,round-mode=places}
\caption{Add caption}
\begin{tabular}{@{}ccc
S[table-format=1.3,
round-precision=3]
c
S[table-format=1.2,
round-precision=2]@{}}
\toprule
\thead{Current $I$ (\si{\milli\ampere}) \\
$\Delta I \approx \SI{0}{\milli\ampere}$}
& \thead{Voltage $V_{1}$ (\si{\volt}) \\
$\Delta V_{1} = \pm \SI{0.01}{\volt}$}
& \thead{Voltage $V_{2}$ (\si{\volt}) \\
$\Delta V_{2} = \pm \SI{0.0001}{\volt}$}
& {\thead{Voltage\\ratio \\
$V_{1}/V_{2}$}}
& \thead{Fractional\\uncertainty\\
$\frac{\Delta V_{1}}{V_{1}}+\frac{\Delta V_{2}}{V_{2}}$}
& {\textsf{V1} (\si{V})} \\
\midrule
1 & 0.50 & 0.5837 & 0.8566044 & 0.0202 & 0.7500 \\
2 & 1.00 & 1.1875 & 0.8421053 & 0.0101 & 0.7500 \\
3 & 1.50 & 1.7928 & 0.8366801 & 0.0067 & 0.7500 \\
4 & 2.00 & 2.4034 & 0.8321544 & 0.0050 & 0.7500 \\
\addlinespace
5 & 2.50 & 3.0182 & 0.8283083 & 0.0040 & 0.7500 \\
6 & 3.00 & 3.6359 & 0.8251052 & 0.0034 & 0.7500 \\
7 & 3.50 & 4.2556 & 0.8224457 & 0.0029 & 0.7500 \\
8 & 4.00 & 4.8728 & 0.8208833 & 0.0025 & 0.7500 \\
\addlinespace
9 & 4.50 & 5.4929 & 0.8192394 & 0.0022 & 0.7500 \\
10 & 5.00 & 6.1217 & 0.8167666 & 0.0020 & 0.7500 \\
11 & 5.50 & 6.7480 & 0.8150563 & 0.0018 & 0.7500 \\
12 & 6.00 & 7.3694 & 0.8141775 & 0.0017 & 0.7500 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Respuesta3
Una solución, con mejoras y simplificaciones de código, utilizando sistemáticamente siunitx
y makecell
(en particular reglas con espesor variable), y reemplazando los \bigstrut
comandos con loscellspace
paquete, que definemínimoespaciado vertical en la parte superior e inferior de las celdas en columnas con el prefijo de la letra S
, o C
si, como es el caso aquí, carga siunitx
. Tenga en cuenta que los comandos de relleno makecell
parecen tener problemas con los comandos de color de la tabla. Además, lo cargué caption
para tener un espacio razonable entre el título y la tabla.
\documentclass[a4paper,12pt]{article}
\usepackage[nottoc]{tocbibind}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{booktabs,siunitx}
\usepackage[table,svgnames]{xcolor}
%\usepackage{enumitem}
\usepackage{flafter}
\usepackage{caption, float}
\usepackage{bigstrut}
\usepackage{makecell}
\usepackage{siunitx}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
hmargin=20mm,
top=20mm,
showframe
}
\usepackage{amsmath, amssymb, amsthm, textcomp}%
\usepackage{tgtermes}
\usepackage[EULERGREEK]{sansmath}
\usepackage{enumerate}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{ragged2e}
\pagenumbering{arabic}
\usepackage{enumerate,mdwlist}
\sisetup{separate-uncertainty=true}
\definecolor{LightCyan}{rgb}{0.69,1.21,1.21}
\renewcommand{\refname}{Bibliography}
\linespread{1.3}
%\renewcommand{\contentsname{Table of Contents}}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\sffamily\sansmath}
\usepackage{cellspace}
\setlength{\cellspacetoplimit}{6pt}
\setlength{\cellspacebottomlimit}{6pt}
%\renewcommand\theadgape{\Gape[4pt]}
% \renewcommand\cellgape{\Gape[4pt]}
\begin{document}
\begin{table}[H]
\centering\sisetup{detect-all}
\caption{Add caption}
\begin{tabular}{Cr r r r r r }
\Xhline{0.8pt}
\rowcolor{LightCyan}
\thead{Current $I/ \si{\mA}$ \\ $\Delta I\approx \SI{0}{\mA}$} & \thead{Voltage $V_{1}/\mkern1.5mu \si{\V}$ \\ $\Delta V_{1} = \pm \SI{0.01}{\V}$} & \thead{Voltage $V_{2}/\mkern1.5mu \si{\V}$ \\ $\Delta V_{2} = \pm \SI{0.0001}{\V}$} & \thead{Voltage $\frac{V_{1}}{V_{2}}/ \mkern1.5mu\si{\V}$} & \thead{Fractional\\[-1ex] uncertainty\\[-0.5ex] $\frac{\Delta V_{1}}{V_{1}} + \frac{\Delta V_{2}}{V_{2}}$} & V1(V) \\
\Xhline{0.8pt}
1 & 0.50 & 0.5837 & 0.8566044 & 0.0202 & 0.7500 \\
\hline
2 & 1.00 & 1.1875 & 0.8421053 & 0.0101 & 0.7500 \\
\hline
3 & 1.50 & 1.7928 & 0.8366801 & 0.0067 & 0.7500 \\
\hline
4 & 2.00 & 2.4034 & 0.8321544 & 0.0050 & 0.7500 \\
\hline
5 & 2.50 & 3.0182 & 0.8283083 & 0.0040 & 0.7500 \\
\hline
6 & 3.00 & 3.6359 & 0.8251052 & 0.0034 & 0.7500 \\
\hline
7 & 3.50 & 4.2556 & 0.8224457 & 0.0029 & 0.7500 \\
\hline
8 & 4.00 & 4.8728 & 0.8208833 & 0.0025 & 0.7500 \\
\hline
9 & 4.50 & 5.4929 & 0.8192394 & 0.0022 & 0.7500 \\
\hline
10 & 5.00 & 6.1217 & 0.8167666 & 0.0020 & 0.7500 \\
\hline
11 & 5.50 & 6.7480 & 0.8150563 & 0.0018 & 0.7500 \\
\hline
12 & 6.00 & 7.3694 & 0.8141775 & 0.0017 & 0.7500 \\
\Xhline{0.8pt}
\end{tabular}%
\end{table}%
\end{document}