![mdframed:在两个嵌入式 mdframes 环境下如何管理脚注?](https://linux22.com/image/288315/mdframed%EF%BC%9A%E5%9C%A8%E4%B8%A4%E4%B8%AA%E5%B5%8C%E5%85%A5%E5%BC%8F%20mdframes%20%E7%8E%AF%E5%A2%83%E4%B8%8B%E5%A6%82%E4%BD%95%E7%AE%A1%E7%90%86%E8%84%9A%E6%B3%A8%EF%BC%9F.png)
问题
mdframed
我的问题是关于脚注的行为。我有两个嵌入式mdframed
环境,第一个环境中有一个脚注,它将显示在第二个环境中。我希望脚注显示在mdframed
它所属的环境中。可以吗?
此外,第二个环境的宽度也存在不一致。有人能解释一下这些奇怪的事实吗?
代码和图片
\documentclass{article}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}[
innerrightmargin = 0.5cm,
innertopmargin = 0.5cm,
skipbelow = 135mm,
backgroundcolor = red,
skipabove = 35mm,
linewidth = 0pt,
userdefinedwidth = 11cm,
innerbottommargin = 0.5cm,
splitbottomskip = 10mm,
splittopskip = 10mm,
roundcorner = 5pt,
innerleftmargin = 0.5cm,
align = center]
Vestibulum\footnote{lectus metus} lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.
\begin{mdframed}[
innerrightmargin = 0.5cm,
innertopmargin = 0.5cm,
skipbelow = 135mm,
backgroundcolor = blue,
skipabove = 35mm,
linewidth = 0pt,
userdefinedwidth = 9cm,
innerbottommargin = 0.5cm,
splitbottomskip = 10mm,
splittopskip = 10mm,
roundcorner = 5pt,
innerleftmargin = 0.5cm,
align = center]
Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.
\end{mdframed}
\end{mdframed}
\end{document}
答案1
由于还没有人给出直接的mdframed
答案,我可以提供另一种方法来tcolorbox
解决脚注问题。
以下代码模拟了您的mdframed
框。我排除了较大的skipabove
和skipbelow
值,因为我猜这些只是为了测试(?)。
\documentclass{article}
\usepackage[skins,breakable]{tcolorbox}
\begin{document}
\begin{tcolorbox}[
enhanced,breakable,arc=0pt,outer arc=0pt,boxrule=0pt,frame hidden,
grow to left by=-5mm,
grow to right by=-5mm,
colback=red]
Vestibulum\footnote{lectus metus} lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.
\begin{tcolorbox}[
enhanced,arc=0pt,outer arc=0pt,boxrule=0pt,frame hidden,
colback=blue]
Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.
\end{tcolorbox}
\end{tcolorbox}
\end{document}