我想将一些图形放在书的左侧或右侧,从而减少文本的列宽。因此,我使用wrapfigure
行数为 40 的窄行环境。这样,图形就可以覆盖整个页面。但是,我希望将图形放在底部,并将空白放在图形上方。如何实现这一点?
\begin{wrapfigure}[40]{O}{0.4\textwidth}
\includegraphics[width=0.4\textwidth]{Fig3-Givonis-bioclimaticchart}
\caption[Givoni's bioclimatic chart for four representative climate zones of Nepal]
{Givoni's bioclimatic chart for four representative climate zones of Nepal}
\label{fig:Fig3-Givonis-bioclimaticchart}
\end{wrapfigure}
答案1
如果将其做得\parbox
更高,它将不适合整个页面。
\documentclass{book}
\usepackage{wrapfig}
\usepackage{mwe}
\begin{document}
\setcounter{page}{2}
\begin{wrapfigure}{O}{0.4\textwidth}
\parbox[b][\dimexpr \textheight-\baselineskip][b]{0.4\textwidth}{%
\includegraphics[width=0.4\textwidth,height=0.6\textheight]{example-image}
\caption{caption}}
\end{wrapfigure}
\lipsum[1-4]
\end{document}
另一种方法是使用 paracol。
\documentclass{book}
\usepackage{paracol}
\usepackage{caption}
\usepackage{mwe}
\begin{document}
\setcounter{page}{2}
\setcolumnwidth{{\dimexpr 0.6\textwidth-\columnsep},0.4\textwidth}
\twosided[c]
\begin{paracol}{2}
\sloppy
\lipsum[1-4]
\switchcolumn
\vspace*{\fill}
\noindent\includegraphics[width=0.4\textwidth,height=0.6\textheight]{example-image}
\captionof{figure}{caption}
\newpage
\end{paracol}
\end{document}
答案2
这种方法用于tikzpagenodes
将图像放置在页面底部。必须测试每个段落的重叠并进行调整。将文本向上或向下移动,则必须重新执行此操作。
\documentclass{article}
\usepackage{caption}
\usepackage{tikzpagenodes}
\usepackage{mwe}
\newlength{\overlap}
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\node[above right,inner sep=0pt] at (current page text area.south west) {%
\begin{minipage}{0.4\textwidth}
\includegraphics[width=\textwidth,height=4.5in]{example-image}
\captionof{figure}{caption}
\end{minipage}};
\end{tikzpicture}
\overlap=\dimexpr 0.4\textwidth + \columnsep\relax% for example
\lipsum[1]% no overlap
\hangindent=\overlap
\hangafter=3
\lipsum[2]% 3 lines before overlap
\leftskip=\overlap
\lipsum[3]% paragraph completely overlapped
\leftskip=0pt
\hangindent=\overlap
\hangafter=-5
\lipsum[4]% 5 lines vefore end of page
\end{document}