像下面的布局一样垂直组合图像和表格的最佳方法是什么?
______________
| Image |
|______________|
a) Our Image
______________
| Table |
|______________|
d) Our Table
我发现这个问题相关。但是,它讨论的是多个图形,而不是一个图形和一个表格。
答案1
虽然您在问题中没有提到这方面,但我猜这里的主要问题是获取图表列表和表格列表中的正确条目。在这种情况下,您的朋友是包caption
,如以下可编译示例所示。
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
\usepackage{caption} % essential
\usepackage{booktabs} % just provides better rules for tables
\usepackage{graphicx} % for figures
\usepackage{mwe} % dummy text, easier access to example figures
\usepackage{hyperref} % to check that it works too
\captionsetup[figure]{position=bottom}
% you asked for captions following tables
\captionsetup[table] {position=bottom}
\begin{document}
\listoffigures
\listoftables
\section{Our example}
\lipsum[1]
\begin{figure}[tbp]
\centering
\includegraphics[scale = .5]{image-a}
\caption{A figure with the letter~``A'''}
\label{fig:a}
\end{figure}
Some text that refers to figure~\ref{fig:a} and to figure~\ref{fig:b}.
\lipsum[2-4]
\begin{table}[tbp]
\centering
\begin{tabular}{ccc}
\toprule
Alpha & Beta & Gamma \\
\midrule
1 & 2 & 3 \\
4 & 5 & 6 \\
\bottomrule
\end{tabular}
\caption{The first table}
\label{tab:first}
\end{table}
Some text that refers to table~\ref{tab:first} and to table~\ref{tab:second}.
\lipsum[5-8]
\begin{figure}[tbp] % here "figure" could also be "table"
\centering
\includegraphics[scale = .25]{image-b}
\captionof{figure}{A figure with the letter~``B'''}
\label{fig:b}
\bigskip % for example; or "\vspace{...}"
\begin{tabular}{ccc}
\toprule
Delta & Epsilon & Zeta \\
\midrule
10 & 20 & 30 \\
40 & 50 & 60 \\
\bottomrule
\end{tabular}
\captionof{table}{The second table}
\label{tab:second}
\end{figure}
\end{document}