Varias notas a pie de página dentro de un mdframed para hacer referencia al mismo texto

Varias notas a pie de página dentro de un mdframed para hacer referencia al mismo texto

Estoy usando un mdframedpara mostrar una lista grande de elementos. En esta lista, hayunoexcepción que tienen algunos de los elementos, y estoy tratando de tomar nota de esto a través de una nota al pie. El texto de la nota a pie de página es el mismo paratodolas excepciones. Entonces lo que me gustaría es:

  • Varias notas a pie de página que utilizan el mismo símbolo (en cada mdframe)
  • Cada una de las notas a pie de página para vincular a launofragmento de texto al final decadamdframed

Probé elcortar a tajosa continuación basado enHacer notas a pie de página globales dentro de una minipágina con soporte de hiperreferencia, lo que me da el mismo símbolo para la nota al pie, pero solo la última nota al pie está vinculada correctamente.

Notas:

  • Si es posible, preferiríanotener que hacer varias ejecuciones. Dado que un instante de la nota al pie no requiere ejecuciones múltiples, creo que esto debería ser factible sin eso.

Referencias:

Código:

\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}
\usepackage{xcolor}

\usepackage[colorlinks=true]{hyperref}

\makeatletter
%% Adapted from https://tex.stackexchange.com/questions/119092/making-global-footnotes-inside-a-minipage-with-hyperref-support
\newcommand*{\MyFootnoteMark}{%
    \footnotemark%
%   \global\let\saved@Href@A\Hy@footnote@currentHref%
    \addtocounter{footnote}{-1}%
}%

\newcommand*{\MyFootnoteText}[1]{%
%%  \addtocounter{footnote}{-1}%
%   \let\Hy@footnote@currentHref\saved@Href@A%
    \footnotetext{#1}%
    \stepcounter{footnote}%
}%
\makeatother


%https://tex.stackexchange.com/questions/175951/changing-footnote-symbol-within-mdframed
\makeatletter
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or \dagger\or \ddagger\or
   \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
   \or \ddagger\ddagger \else\@ctrerr\fi}}%
\renewcommand\thefootnote{\fnsymbol{footnote}}   
\renewcommand\thempfootnote{\fnsymbol{mpfootnote}}
\makeatother

\newcommand*{\MyContent}[1][yellow!20]{%
\begin{mdframed}[backgroundcolor=#1]
\lipsum[1-2]
\begin{minipage}{\linewidth}\color{blue}
Hey, look at me.\MyFootnoteMark
\end{minipage}%
\par\lipsum[2]
\begin{minipage}{\linewidth}\color{blue}
Hey, look at me\MyFootnoteMark again.\par
\end{minipage}%
\par\lipsum[3-6]
\MyFootnoteText{This is the text that all the footnotes refers to.}
\end{mdframed}%
}%


\begin{document}
\MyContent[yellow!20]

\MyContent[green!20]
\end{document}

Respuesta1

¡Realmente no sé lo que estoy haciendo! ¡Debería estar durmiendo!

Añadir \addtocounter{Hfootnote}{-1}%adicionalmente.

\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}
\usepackage{xcolor}

\usepackage[colorlinks=true]{hyperref}

\makeatletter
%% Adapted from http://tex.stackexchange.com/questions/119092/making-global-footnotes-inside-a-minipage-with-hyperref-support
\newcommand*{\MyFootnoteMark}{%
    \footnotemark%
%   \global\let\saved@Href@A\Hy@footnote@currentHref%
    \addtocounter{footnote}{-1}%
    \addtocounter{Hfootnote}{-1}%     Added
}%

\newcommand*{\MyFootnoteText}[1]{%
%%  \addtocounter{footnote}{-1}%
%   \let\Hy@footnote@currentHref\saved@Href@A%
    \footnotetext{#1}%
    \stepcounter{footnote}%
    \stepcounter{Hfootnote}%      %% Added
}%
\makeatother


%http://tex.stackexchange.com/questions/175951/changing-footnote-symbol-within-mdframed
\makeatletter
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or \dagger\or \ddagger\or
   \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
   \or \ddagger\ddagger \else\@ctrerr\fi}}%
\renewcommand\thefootnote{\fnsymbol{footnote}}
\renewcommand\thempfootnote{\fnsymbol{mpfootnote}}
\makeatother

\newcommand*{\MyContent}[1][yellow!20]{%
\begin{mdframed}[backgroundcolor=#1]
\lipsum[1-2]
\begin{minipage}{\linewidth}\color{blue}
Hey, look at me.\MyFootnoteMark
\end{minipage}%
\par\lipsum[2]
\begin{minipage}{\linewidth}\color{blue}
Hey, look at me\MyFootnoteMark again.\par
\end{minipage}%
\par\lipsum[3-6]
\MyFootnoteText{This is the text that all the footnotes refers to.}
\end{mdframed}%
}%


\begin{document}
\MyContent[yellow!20]

\MyContent[green!20]
\end{document}

ingrese la descripción de la imagen aquí

Otro truco feo para recuperar los símbolos en la nota al pie

\documentclass{article}
\usepackage{mdframed,footnote}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{xparse}

\usepackage[colorlinks=true]{hyperref}

\makeatletter
%% Adapted from http://tex.stackexchange.com/questions/119092/making-global-footnotes-inside-a-minipage-with-hyperref-support
\newcommand*{\MyFootnoteMark}{%
    \footnotemark%
    \addtocounter{footnote}{-1}%
    \addtocounter{Hfootnote}{-1}%     Added
}%

\newcommand{\MyFootnoteText}[1]{%
    \footnotetext[\numexpr\value{footnote}+1\relax]{#1}%
    \refstepcounter{footnote}%
    \refstepcounter{Hfootnote}%      %% Added
}%
\makeatother


%http://tex.stackexchange.com/questions/175951/changing-footnote-symbol-within-mdframed
\makeatletter
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or \dagger\or \ddagger\or
   \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
   \or \ddagger\ddagger \else\@ctrerr\fi}}%
\renewcommand\thefootnote{\fnsymbol{footnote}}
\renewcommand\thempfootnote{\fnsymbol{mpfootnote}}
\makeatother

\NewDocumentCommand{\MyContent}{O{yellow!20}O{}}{%
\begin{mdframed}[backgroundcolor=#1]
\lipsum[1-2]
\begin{minipage}{\linewidth}\color{blue}
Hey, look at me.\MyFootnoteMark
\end{minipage}%
\par\lipsum[2]
\begin{minipage}{\linewidth}\color{blue}
Hey, look at me\MyFootnoteMark again.\par
\end{minipage}%
\par\lipsum[3-6]
\MyFootnoteText{This is the text that all the footnotes refers to.}
\end{mdframed}%
}%


\begin{document}
\MyContent[yellow!20]

\MyContent[green!20]
\end{document}

información relacionada