
我有一個小型頁面,裡面有一個腳註和一張 tikZ 圖片。現在我的問題是,腳註文字位於我的 tikZ 圖片的最後一個節點內。這不是我想要的——實際上這很奇怪。
程式碼和輸出
\documentclass{article}
\usepackage{tikz,lipsum}
\begin{document}
\begin{minipage}{\textwidth}
\lipsum[1]\footnote{a footnote}% I cannot use \footnotemark etc
\begin{tikzpicture}[overlay, remember picture]% I need these two options
\draw[ultra thick, black] (0,0) -- node[sloped,below,text width=12cm,text centered]
{\lipsum[4]} (11,-3);% the text has to have a maximal width
\end{tikzpicture}
\end{minipage}
\end{document}
第一個解決方法
當我完全刪除時text width = 12cm
,腳註移回文字末尾下方:
但我需要文字具有最大寬度。所以這不是很令人滿意。有任何想法嗎?
答案1
我們在其中了解到 tikz 在內部使用 minipage:-)
這會保存並恢復腳註以阻止 tikz 看到它,因此腳註出現在正確的位置,旋轉的 tikz 圖片疊印,但我想知道 tikz 的人可以解決這個問題......
\documentclass{article}
\usepackage{tikz,lipsum}
\begin{document}
\begin{minipage}{\textwidth}
\lipsum[1]\footnote{a footnote}% I cannot use \footnotemark etc
\setbox0\box\csname@mpfootins\endcsname
\begin{tikzpicture}[overlay, remember picture]% I need these two options
\draw[ultra thick, black] (0,0) -- node[sloped,below,text width=12cm,text centered]
{\lipsum[4]} (11,-3);% the text has to have a maximal width
\end{tikzpicture}\global\setbox\csname@mpfootins\endcsname\box0
\end{minipage}
\end{document}
答案2
這就是為什麼 LaTeX 如此美麗......另一個解決方案:)
\documentclass{article}
\usepackage{tikz,lipsum}
\usepackage{footnote}
\begin{document}
\begin{minipage}{\textwidth}
\savenotes
\lipsum[1]\footnote{a footnote}% I cannot use \footnotemark etc
\begin{tikzpicture}[overlay, remember picture]% I need these two options
\draw[ultra thick, black] (0,0) -- node[sloped,below,text width=12cm,text centered]
{\lipsum[4]} (11,-3);% the text has to have a maximal width
\end{tikzpicture}
\spewnotes
\end{minipage}
\end{document}
答案3
一個可能的解決方案(這不是真正的解決方案)是執行以下操作:
\documentclass{article}
\usepackage{tikz,lipsum}
\usepackage{tabu}
\begin{document}
\begin{minipage}{\textwidth}
\lipsum[1]\footnote{a footnote}% I cannot use \footnotemark etc
\begin{tikzpicture}[overlay, remember picture]% I need these two options
\draw[ultra thick, black] (0,0) -- node[sloped,below]
{
\begin{tabu}to 12cm {X[c]}
\lipsum[4]
\end{tabu}
} (11,-3);% the text has to have a maximal width
\end{tikzpicture}
\end{minipage}
\end{document}