ミニページの脚注は tikZ ノード内にあります

ミニページの脚注は tikZ ノード内にあります

ミニページがあり、その中に脚注と 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}

関連情報