我正在使用 Tufte-LaTeX,我有两个小图形,我想让它们并排显示。我读过这个关于放置的问题和答案两个并排的人物。我尝试使用 Tufte-LaTeX,但它只打印了第一个标题。此外,如果标题分别出现在各自的图下,就像我引用的示例一样,那就太好了。有办法吗?谢谢!
附言
这是我正在使用的示例
\documentclass[nohyper,titlepage,nols]{tufte-book}
\usepackage{lipsum}
\usepackage{mwe}
\begin{document}
How can I put two figures side-by-side? Not two sub-figures, but two actual
figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need
to
save the space in order to withstand the pages limit.
\lipsum
\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{example-image-a} % first figure itself
\caption{first figure}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{example-image-b} % second figure itself
\caption{second figure}
\end{minipage}
\end{figure}
\lipsum[3]
\end{document}
答案1
像这样?
看起来简单的解决方案在文档类minipage
中不起作用tufte-book
(第一个标题丢失)。但是,\ffigbox
可以解决您的问题,但标题位于图形下方,而不是正文外面,因为它是默认tufte
样式:
\documentclass[nohyper,titlepage,nols]{tufte-book}
\usepackage{lipsum}
\usepackage{mwe}
\usepackage{floatrow} % <--- added
\begin{document}
How can I put two figures side-by-side? Not two sub-figures, but two actual figures with separate "Fig.: bla bla" captions. A figure is supposed to spread over the entire text width, but I have two figures which are narrow and long, and I need to save the space in order to withstand the pages limit.
\begin{figure}[!h]
\begin{floatrow}
\ffigbox{\includegraphics[width=\linewidth]{example-image-a}}%
{\caption{first figure}\label{fig:example-1}}
\hfill
\ffigbox{\includegraphics[width=\linewidth]{example-image-b}}%
{\caption{second figure}\label{fig:example-2}}
\end{floatrow}
\end{figure}
\lipsum[3]
\end{document}