有脚注环境吗?
Few cases are known%
\begin{footnote}
The first experiments date back to 1912, when\ldots
A second paragraph.
\end{footnote}
语境
我有一个自定义环境mynote
,手稿作者可以在其中留下注释(等等);注释以不同的颜色排版在文档正文中。最近,一位合作者要求将这些注释移到脚注中。
理想情况下,我想将环境定义从
\newenvironment{mynote}{%
\par\color{purple}}{%
\par}
类似于
\newenvironment{mynote}{%
\marginpar{\footnotemark}% marginal mark for the note
\footnotetext\begingroup}{%
\endgroup\par}
但这似乎是一种(非常)错误的用法\begingroup
。
以下是当前设置的示例
\documentclass{memoir}
\usepackage{tikz}
\newenvironment{mynote}{%
\par\noindent\color{purple}}{%
\par}
\begin{document}
This experimental setup has evolved
greatly.
\begin{mynote}
The first experiments date back to 1912, when\ldots
A second paragraph.
\end{mynote}
\end{document}
答案1
类似这样?用 捕捉环境内容\BODY
并应用\footnotetext
到此?
\documentclass{memoir}
\usepackage{xcolor}
\usepackage{environ}
\NewEnviron{mynote}{%
\marginpar{\footnotemark}% marginal mark for the note
\footnotetext{{\color{purple}\BODY}}}[\par]
\begin{document}
This experimental setup has evolved
greatly.
\begin{mynote}
The first experiments date back to 1912, when\dots
A second paragraph.
\end{mynote}
\end{document}