如果我将图形放在脚注中并应用于width=\textwidth
它,它将是比实际文本宽度更宽(参见下文的 MWE)。(这同样适用于\linewidth
。)
显然,includegraphics 测量的是正文中区域的宽度,而不是脚注中的宽度。由于脚注编号和它前面的一些空格减少了脚注的实际宽度,因此它不再适合。
可以通过从图像宽度中减去超出部分宽度来解决此错误(即width={\linewidth}-2em
,这可能需要\usepackage{calc}
)。但实际上它应该在没有这种干预的情况下工作。或者我做错了什么?
MWE 代码:
\documentclass{article}
\usepackage{graphicx}
\usepackage[showframe]{geometry} % to see pagelayout
\begin{document}
Placing an image in main text with \texttt{width = textwidth} results correctly in:\\
\includegraphics[ width=\textwidth, height=50pt ]{example-image-a}
But placing an image with \texttt{width = textwidth} in the footnote not.\footnote{\includegraphics[ width=\textwidth, height=50pt ]{example-image-b}}
\bigskip
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vel auctor turpis, at commodo diam. Aliquam fermentum leo at erat congue, a porta ex congue. Quisque eget facilisis felis. Proin bibendum ultrices ante quis faucibus. Vivamus quis rutrum augue, in semper tellus. Duis porttitor enim tortor, a fringilla arcu rhoncus eu. In luctus nisi id odio placerat, nec pellentesque ligula rhoncus. Maecenas imperdiet dictum odio ut finibus. Proin egestas a ex eget auctor. In eget enim eleifend, fringilla leo vulputate, laoreet mi. Suspendisse potenti. Morbi faucibus risus ut nunc lobortis imperdiet. Aliquam nec ultricies nulla. Aenean feugiat libero nisi. Nam eget dapibus tortor.\footnote{Pellentesque nec varius dui. Quisque malesuada nunc id velit pulvinar, eu mollis metus auctor. Phasellus quam dolor, varius id iaculis nec, aliquam a urna. Cras imperdiet elit erat, vitae tincidunt velit commodo vel. Praesent sit amet justo rutrum, tincidunt nibh in, venenatis lacus. Vivamus sit amet turpis velit. Integer faucibus vestibulum augue sed mollis.}
MWE:
\end{document}
MWE-输出: