我正在尝试重现我在这里找到的例子:具有两个并排子图且宽度大于文本宽度的图形
我想要同样的东西。问题是我的标题非常多。如果我像示例中那样做,我的标题就会开始重叠。有没有办法让我的标题负责任,同时仍然扩展我的图像:
\documentclass[11pt,twocolumn]{article}
\usepackage{graphicx,caption,subcaption}
\usepackage{natbib}
\usepackage{rotating}
\begin{document}
\onecolumn
\begin{figure}
\makebox[\linewidth][c]{%
\begin{subfigure}[b]{.65\textwidth}
\centering
\includegraphics[width=.95\textwidth]{someImage.png}
\caption{nsdanskdnasndasmnd,asndm,ans,dmndnamsnd,mna,snd,mans,dna,snd,ans,dnalsjdoafmad cknasojnfoansdlknasldnlaksdasdlma snfoojanwdkpmaslmdnakjsbfoasnd askfbaosnfa smf aojsfpasmflamnsfkjbaosfnlaksn f,jasnfohanslfnalsfnpiabsbfouasmfnaösfjkjapwnsdanskdnasndasmnd,asndm,ans,dmndnamsnd,mna,snd,mans,dna,snd,ans,dnalsjdoafmad cknasojnfoansdlknasldnlaksdasdlma snfoojanwdkpmaslmdnakjsbfoasnd askfbaosnfa smf aojsfpasmflamnsfkjbaosfnlaksn f,jasnfohanslfnalsfnpiabsbfouasmfnaösfjkjapw}
\label{SED}
\end{subfigure}%
\begin{subfigure}[b]{.65\textwidth}
\centering
\includegraphics[width=.95\textwidth]{someImage.png}
\caption{nsdanskdnasndasmnd,asndm,ans,dmndnamsnd,mna,snd,mans,dna,snd,ans,dnalsjdoafmad cknasojnfoansdlknasldnlaksdasdlma snfoojanwdkpmaslmdnakjsbfoasnd askfbaosnfa smf aojsfpasmflamnsfkjbaosfnlaksn f,jasnfohanslfnalsfnpiabsbfouasmfnaösfjkjapwnsdanskdnasndasmnd,asndm,ans,dmndnamsnd,mna,snd,mans,dna,snd,ans,dnalsjdoafmad cknasojnfoansdlknasldnlaksdasdlma snfoojanwdkpmaslmdnakjsbfoasnd askfbaosnfa smf aojsfpasmflamnsfkjbaosfnlaksn f,jasnfohanslfnalsfnpiabsbfouasmfnaösfjkjapw}
\label{SED1}
\end{subfigure}%
}
\makebox[\linewidth][c]{%
\begin{subfigure}[b]{.65\textwidth}
\centering
\includegraphics[width=.95\textwidth]{someImage.png}
\caption{asdmlasjkdasdnlansflnalsnflkansflnaslfnlkasnflkansofnaosnfoansofnaosnfoansfonasofnoasnfoqnfonoansifnaisjfnasnfi}
\label{SED2}
\end{subfigure}%
\begin{subfigure}[b]{.65\textwidth}
\centering
\includegraphics[width=.95\textwidth]{someImage.png}
\caption{nsdanskdnasndasmnd,asndm,ans,dmndnamsnd,mna,snd,mans,dna,snd,ans,dnalsjdoafmad cknasojnfoansdlknasldnlaksdasdlma snfoojanwdkpmaslmdnakjsbfoasnd askfbaosnfa smf aojsfpasmflamnsfkjbaosfnlaksn f,jasnfohanslfnalsfnpiabsbfouasmfnaösfjkjapw}
\label{SED3}
\end{subfigure}%
}
\caption{
sdamklsadnasld.a,smd.,asm.d,ma.smdaösd.ams.dma.,smd.ams.dmaösmdökams.d,ma.smd.,ams.,d}
\end{figure}
\end{document}
答案1
编辑:
显然,在第一次尝试中,我错过了一个重要点:图像必须比文本宽度宽(如*John Kormylo 在下面的评论中所述;谢谢 John)。为此,我建议使用 packed changepage
,它能够在文本两侧分别控制图形突出文本宽度。下面的答案已相应更正
我想,您正在寻找类似这样的东西:
与您的 MWE 相比,我做了更多改变:
- 删除
\makebox[\linewidth][c]{% ...}
并替换为\begin{adjustwidth*}{}{-11mm} ... \end{adjustwidth*}
- 对于子图宽度我选择
0.48\linetwidth
- 对于图形宽度
subfigure
我选择\linewidth
subfigure
将位置选项更改为[t]
为了显示页面布局,添加了包showframe
,在实际使用中必须将其删除。
对于标题中的文本,我使用来自lispum
包的虚拟文本。标题中的文本实际上是一个长单词,LaTeX 很难将其分成更多行。
\documentclass[11pt,twocolumn]{article}
\usepackage{caption,subcaption}
\usepackage[demo]{graphicx}
\usepackage[strict]{changepage}
\usepackage{lipsum}% for dummy text in captions
\usepackage{showframe}% to show page layout
\begin{document}
\onecolumn
\begin{figure}
\begin{adjustwidth*}{}{-11mm}% adjust to desired protrusion into outside margin
\begin{subfigure}[t]{.48\linewidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[2]}
\label{SED}
\end{subfigure}\hfill
\begin{subfigure}[t]{.48\linewidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[11]}
\label{SED1}
\end{subfigure}
\begin{subfigure}[t]{.48\linewidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[11]}
\label{SED2}
\end{subfigure}\hfill
\begin{subfigure}[t]{.48\linewidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[3]}
\label{SED3}
\end{subfigure}%
\caption{The main caption}
\end{adjustwidth*}
\end{figure}
\end{document}
答案2
\makebox
该技巧和包装的问题changepage
在于它们对称地推入边缘,当文本区域位于纸张中央时,这是没问题的。
以下效果是\columnsep
纸张边缘和两个子图之间的边距。为了通用性,我twoside
还包含了文档的代码(可能需要运行两次)。
\documentclass[11pt,twocolumn]{book}
\usepackage{caption,subcaption}
\usepackage[demo]{graphicx}
\usepackage{ifoddpage}% for twoside documents
\usepackage{lipsum}% for dummy text in captions
\usepackage{showframe}% to show page layout
\newlength{\tempwidth}
\begin{document}
%\null\newpage
\onecolumn
\begin{figure}
\setlength{\tempwidth}{\dimexpr .5\paperwidth-1.5\columnsep}%
\checkoddpage
\ifoddpageoroneside
\setlength{\leftskip}{\dimexpr \columnsep-1in-\oddsidemargin}%
\setlength{\rightskip}{\dimexpr \columnsep+1in+\oddsidemargin+\textwidth-\paperwidth}%
\else
\setlength{\leftskip}{\dimexpr \columnsep-1in-\evensidemargin}%
\setlength{\rightskip}{\dimexpr \columnsep+1in+\evensidemargin+\textwidth-\paperwidth}%
\fi
\begin{subfigure}[t]{\tempwidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[2]}
\label{SED}
\end{subfigure}\hfill
\begin{subfigure}[t]{\tempwidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[11]}
\label{SED1}
\end{subfigure}
\begin{subfigure}[t]{\tempwidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[11]}
\label{SED2}
\end{subfigure}\hfill
\begin{subfigure}[t]{\tempwidth}% <-- changed
\includegraphics[width=\linewidth]{someImage.png}
\caption{\lipsum*[3]}
\label{SED3}
\end{subfigure}%
\caption{The main caption}
\end{figure}
\end{document}