Quiero colocar una tabla en la parte superior de la página. Intenté usar la respuesta proporcionada aquí:
Colocando la figura exactamente en la parte superior de la página en Latex
Sin embargo, esto no proporcionó la respuesta esperada y la tabla permanece debajo de la parte superior de la página.
\documentclass[10pt]{article}
\makeatletter
\setlength{\@fptop}{0pt}
\setlength{\@fpbot}{0pt plus 1fil}
\makeatother
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{adjustbox}
\usepackage{booktabs}
\begin{document}
\begin{table}[t!] \caption{This is a nice table} \label{tab:instruments}
\begin{adjustbox}{max width=1.5\textwidth, center }
\begin{tabular}
{p{5cm}p{2cm}p{5cm}p{1cm}p{5cm}} \hline Instrument & Resolution & Caption & Date & Figure \\
\hline
Speybroeck's X-Ray Telescope & 10 & First X-Ray Images of the Sun \cite{vanspeybroeck1970} & 1970 & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
Brueckner Sounding Rockets & No Data & Early observations of jets \cite{brueckner1983} & 1983 & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
Yohkoh/SXT & 5 & Observations using SXT \cite{shibata1992} & 1992 & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
SOHO & 2.5 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
Hinode/XRT & 1.028 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
STERO & 1.6 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
SDO/AIA & 0.6 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
Solar Orbiter (proposed) & 0.05 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\
\hline
\end{tabular}
\end{adjustbox}
\end{table}
\end{document}
Respuesta1
Vea si la siguiente solución es aceptable para usted:
\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx}
\usepackage[english]{babel}
\usepackage[export]{adjustbox}% <-- added option "export"
\usepackage{caption} % <-- added
\usepackage{siunitx} % <-- added
\usepackage{ragged2e}% <-- added
\usepackage{booktabs,
tabularx}% <-- added
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\makeatletter
\setlength{\@fptop}{0pt}
\setlength{\@fpbot}{0pt plus 1fil}
\makeatother
\usepackage{lipsum} % <-- for dummy text
\usepackage{showframe} % <-- to show page layout
\renewcommand*\ShowFrameColor{\color{teal}}
\begin{document}
\lipsum[11]
\begin{table}[t!]
\centering
\caption{This is a nice table} \label{tab:instruments}
\begin{tabularx}{\textwidth}{@{}L S L l C@{}}
\hline
Instrument & {Resolution} & Caption & Date & Figure \\
\hline
Speybroeck's X-Ray Telescope
& 10
& First X-Ray Images of the Sun \cite{vanspeybroeck1970}
& 1970
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
Brueckner Sounding Rockets
& {No Data}
& Early observations of jets \cite{brueckner1983}
& 1983
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
Yohkoh/SXT
& 5
& Observations using SXT \cite{shibata1992}
& 1992
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
SOHO & 2.5
& Description
& Date
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
\hline
\end{tabularx}
\end{table}
%
\begin{table}[t!]
\ContinuedFloat
\centering
\caption{This is a nice table (cont.)}
\begin{tabularx}{\textwidth}{@{}L S L l C@{}}
\hline
Hinode/XRT
& 1.028
& Description
& Date
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
STERO & 1.6
& Description
& Date
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
SDO/AIA & 0.6
& Description
& Date
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
Solar Orbiter (proposed)
& 0.05
& Description
& Date
& \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
\hline
\end{tabularx}
\end{table}
\lipsum[1]
\end{document}
Divido la tabla manualmente en dos partes, agrego paquetes ragged2e
para ajustar mejor el contenido de las celdas, caption
para la continuación de los flotantes, siunitx
para alinear los números de resolución y tabularx
para ajustar la tabla al ancho del texto. Con la opción export
en el paquete adjustbox
hay imágenes centradas verticalmente y se les agregan márgenes superior/inferior: