Sorry, it's me again. Gonzalo has hinted me to the very nice leftbar environment in the framed package, which I now use for definitions, theorems and similar environment. Now I've got a new problem: Footnotes (\footnote) from inside the leftbar environment are not shown! The label is there, but there is no footnote with the corresponding number.
According to this here and similar sources, this can be fixed by using \footnotemark and \footnotetext. The problem is: I'm using SWP and would like to have the \footnote command for footnotes. I thought of something like this:
\renewcommand{\footnote}[1]{\footnotemark \footnotetext{#1}}
But \footnotemark and \footnotetext need a label. So what I would like the most is someting like
\renewcommand{\footnote}[1]{\footnotemark[some arbitrary string "x" that cannot collide with an "x" from a different footnotemark] \footnotetext["x"]{#1}}
I've tried to use #1 itself as "x", but this spits out errors (not surprisingly, given that it is non-sanitized LaTeX). Is there a trick here, or is my syntax wrong?
EDIT: My renewcommand is stupid anyway. The trick is to have the \footnotetext come after the end of the leftbar environment. Is there a way to get this through renewcommand?
Best Answer
A slightly longer code, which allows you to only type
\footnote
. The idea is to make each footnote append\footnotetext{#1}
to a token list. This token list is then typeset at the right place. Some trickery is required to get nesting right, as well ashyperref
support. Normally, this can be used for other (non-verbatim-ish) environments.Comments in the code.