Tcolorbox, ejercicios y el paquete manyfoot-2

Tcolorbox, ejercicios y el paquete manyfoot-2

Utilizo el tcolorboxpaquete para producir ejercicios con solución. Se puede ver que las notas al pie habituales están escritas dentro del cuadro, pero cuando a veces tengo varias notas al pie, uso el manyfootpaquete para escribir estas notas al pie de forma "incrustada", pero obtengo un resultado no deseado. Sólo se producen las marcas de las notas a pie de página, pero no las notas a pie de página en sí. La primera pregunta de mi propósito se dio aquí:

Tcolorbox, ejercicios y el paquete manyfoot

Mi pregunta ahora es la siguiente: En el cuadro del ejercicio, produzco sus notas a pie de página fuera del cuadro con los comandos basados ​​en \footnotetextCdónde Cestá el sufijo de mi elemento inicial, dado después del cuadro del ejercicio, y se puede ver que produce el resultado deseado para la pregunta (consulte el archivo .tex utilizado a continuación y su compilación). ¿Cómo puedo obtener una forma similar para las notas al pie en el cuadro de la solución (que puede basarse en comandos como \footnotetextC), que produce las notas al pie fuera del cuadro de la solución, como para el cuadro del ejercicio?

Aquí está el archivo .tex utilizado:

\documentclass{book}

\usepackage[most]{tcolorbox}
\tcbuselibrary{skins,breakable,xparse}

\usepackage{polyglossia}
\setmainlanguage{english}

\usepackage[para*]{manyfoot}
\DeclareNewFootnote[para]{C}
\makeatletter
\let\c@footnoteC\c@footnote
\makeatother

\renewcommand{\thefootnoteC}{\fnsymbol{footnote}}

\NewTColorBox[auto counter,number within=chapter]{exercise}{+O{}}{%
enhanced,colframe=green!20!black,colback=yellow!10!white,coltitle=green!40!black,
fonttitle=\bfseries,
underlay={\begin{tcbclipinterior}
\shade[inner color=green!80!yellow,outer color=yellow!10!white]
(interior.north west) circle (2cm);
\draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
\end{tcbclipinterior}},
title={Exercise~ \thetcbcounter:},
label={exercise@\thetcbcounter},
attach title to upper=\quad,
after upper={\par\hfill\textcolor{green!40!black}%
{\itshape Solution on page~\pageref{solution@\thetcbcounter}}},
lowerbox=ignored,
savelowerto=solutions/exercise-\thetcbcounter.tex,
record={\string\solution{\thetcbcounter}{solutions/exercise-\thetcbcounter.tex}},
#1
}
\NewTotalTColorBox{\solution}{mm}{%
enhanced,colframe=red!20!black,colback=yellow!10!white,coltitle=red!40!black,
fonttitle=\bfseries,
underlay={\begin{tcbclipinterior}
\shade[inner color=red!50!yellow,outer color=yellow!10!white]
(interior.north west) circle (2cm);
\draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
\end{tcbclipinterior}},
title={Solution of Exercise~\ref{exercise@#1} on page~\pageref{exercise@#1}:},
phantomlabel={solution@#1},
attach title to upper=\par,
}{\input{#2}}

\tcbset{no solution/.style={no recording,after upper=}}

\begin{document}
\chapter{The first chapter}

\section{Exercises}
\tcbstartrecording
\begin{exercise}
Exercise with inlined footnotes, \footnoteC{inlined footnote 1} and \footnoteC{inlined footnote 2}, in the question.
\tcblower
Exercise with inlined footnotes, \footnoteC{inlined footnote 1} and \footnoteC{inlined footnote 2}, in the answer.
\end{exercise}
\footnotetextC[1]{inlined footnote 1}
\footnotetextC[2]{inlined footnote 2}
\begin{exercise}
Exercise with usual footnotes, \footnote{footnote 1} and \footnote{footnote 2}, in the question.
\tcblower
Exercise with usual footnotes, \footnote{footnote 1} and \footnote{footnote 2}, in the answer.
\end{exercise}
\tcbstoprecording
\section{Solutions of exercises}
\tcbinputrecords

\end{document}

y su compilación, usando xelatex: ingrese la descripción de la imagen aquí

Respuesta1

Si entiendo su pregunta correctamente, desea que sus notas a pie de página se establezcan en el paraestilo '' de manyfoot, pero dentro de tcolorbox. El paquete paranotespuede hacer esto por usted.

Si no fuera por las complejas 'soluciones de ejercicio' tcolorbox, sería más fácil automatizar las 'parnotes', que dependen de un \parnotescomando implícito o explícito para imprimir las notas. Pero no supone demasiado problema hacerlo con una automatización parcial.

\documentclass{book}

\usepackage[most]{tcolorbox}
\tcbuselibrary{skins,breakable,xparse}

\usepackage{polyglossia}
\setmainlanguage{english}

\usepackage{parnotes}

\NewTColorBox[auto counter,number within=chapter]{exercise}{+O{}}{%
  enhanced,
  colframe=green!20!black,
  colback=yellow!10!white,
  coltitle=green!40!black,
  fonttitle=\bfseries,
  underlay={\begin{tcbclipinterior}
      \shade[inner color=green!80!yellow,outer color=yellow!10!white]
      (interior.north west) circle (2cm);
      \draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
      (interior.south west) grid (interior.north east);
    \end{tcbclipinterior}
  },
  title={Exercise~ \thetcbcounter:},
  label={exercise@\thetcbcounter},
  attach title to upper=\quad,
  after upper={\par\hfill\textcolor{green!40!black}%
    {\itshape Solution on page~\pageref{solution@\thetcbcounter}}%
    \par\parnotes
  },
  lowerbox=ignored,
  savelowerto=exercise-\thetcbcounter.tex,
  record={\string\solution{\thetcbcounter}{exercise-\thetcbcounter.tex}},
  #1,
  code={\parnotereset}, % <-- parnotes
}

\NewTotalTColorBox{\solution}{mm}{%
  enhanced,
  colframe=red!20!black,
  colback=yellow!10!white,
  coltitle=red!40!black,
  fonttitle=\bfseries,
  underlay={\begin{tcbclipinterior}
      \shade[inner color=red!50!yellow,outer color=yellow!10!white]
      (interior.north west) circle (2cm);
      \draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
      (interior.south west) grid (interior.north east);
    \end{tcbclipinterior}},
  title={Solution of Exercise~\ref{exercise@#1} on page~\pageref{exercise@#1}:
  },
  phantomlabel={solution@#1},
  attach title to upper=\par,
}{\input{#2}}

\tcbset{no solution/.style={no recording,after upper=}}

\begin{document}

\chapter{The first chapter}

\section{Exercises}

\tcbstartrecording
\begin{exercise}
  1.  Exercise with inlined footnotes, \parnote{inlined footnote 1}
  and \parnote{inlined footnote 2}, in the question.

  % \parnotes % <-- this won't work because of your "Solution on page ..."

  \tcblower

  2.  Exercise with inlined footnotes, \parnote{inlined footnote 1}
  and \parnote{inlined footnote 2}, in the answer.

  \parnotes

\end{exercise}

% \footnotetextC[1]{inlined footnote 1}
% \footnotetextC[2]{inlined footnote 2}

\begin{exercise}
  Exercise with usual footnotes, \footnote{footnote 1} and
  \footnote{footnote 2}, in the question.

  \tcblower

  Exercise with usual footnotes, \footnote{footnote 1} and
  \footnote{footnote 2}, in the answer.
\end{exercise}
\tcbstoprecording

\section{Solutions of exercises}
\tcbinputrecords

\end{document}

Nota: eliminé su código para escribir los cuadros en otro directorio (que no debería incluirse en un MWE a menos que ese sea el foco de la pregunta).

tcolorbox-parnote

Respuesta2

Basado en la respuesta dada por @jon, lo que acepto, doy una respuesta a mi pregunta, que en realidad es una respuesta para una pregunta desarrollada... Puse esta pregunta en un entorno árabe, un entorno de derecha a izquierda, y las oraciones latinas se dan dentro de los comandos \LR{} que las escriben de izquierda a derecha. Doy ejemplos usando el paquete manyfoot, donde vemos que las notas al pie no están escritas, y un ejemplo usando parnotes, y vemos que el comando \LR{\parnotes} escribe las notas al pie, en modo de izquierda a derecha si quiero , dentro de la caja.

Aquí está el archivo .tex obtenido:

\documentclass{book}

\usepackage[most]{tcolorbox}
\tcbuselibrary{skins,breakable,xparse}

\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\setmainfont[Script=Arabic,Scale=1.2]{Arial}

\usepackage{parnotes}

\usepackage[para*]{manyfoot}
\DeclareNewFootnote[para]{C}
\makeatletter
\let\c@footnoteC\c@footnote
\makeatother

\renewcommand{\thefootnoteC}{\fnsymbol{footnote}}

\NewTColorBox[auto counter,number within=chapter]{exercise}{+O{}}{%
enhanced,colframe=green!20!black,colback=yellow!10!white,coltitle=green!40!black,
fonttitle=\bfseries,
underlay={\begin{tcbclipinterior}
\shade[inner color=green!80!yellow,outer color=yellow!10!white]
(interior.north west) circle (2cm);
\draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
\end{tcbclipinterior}},
title={Exercise~ \thetcbcounter:},
label={exercise@\thetcbcounter},
attach title to upper=\quad,
after upper={\par\hfill\textcolor{green!40!black}%
{\itshape Solution on page~\pageref{solution@\thetcbcounter}}},
lowerbox=ignored,
savelowerto=solutions/exercise-\thetcbcounter.tex,
record={\string\solution{\thetcbcounter}{solutions/exercise-\thetcbcounter.tex}},
#1
}

\NewTotalTColorBox{\solution}{mm}{%
enhanced,colframe=red!20!black,colback=yellow!10!white,coltitle=red!40!black,
fonttitle=\bfseries,
underlay={\begin{tcbclipinterior}
\shade[inner color=red!50!yellow,outer color=yellow!10!white]
(interior.north west) circle (2cm);
\draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
\end{tcbclipinterior}},
title={Solution of Exercise~\ref{exercise@#1} on page~\pageref{exercise@#1}:},
phantomlabel={solution@#1},
attach title to upper=\par,
}{\input{#2}}

\tcbset{no solution/.style={no recording,after upper=}}

\renewcommand{\theparnotemark}{\fnsymbol{parnotemark}} %% The mark for parnote
\renewcommand{\parnotefmt}[1]{\footnotesize\rmfamily
 \noindent\rule{\linewidth}{.5pt}\\ %% The rule before the footnotes
 \noindent #1\par
 \noindent\rule{\linewidth}{.5pt} %% The rule below the footnotes
 }
\begin{document}
\chapter{The first chapter}
\section{Exercises}
\tcbstartrecording
\begin{exercise}
\LR{Exercise with inlined footnotes, using manyfoot, \footnoteC{inlined footnote 1} and \footnoteC{inlined footnote 2}, in the question.}
\tcblower
\LR{Exercise with inlined footnotes, using manyfoot, \footnoteC{inlined footnote 1} and \footnoteC{inlined footnote 2}, in the answer.}
\end{exercise}
\begin{exercise}
\LR{1.  Exercise with inlined footnotes, using parnotes, \parnote{inlined footnote 1} and \parnote{inlined footnote 2}, in the question.}
\LR{\parnotes}
\tcblower
\LR{2.  Exercise with inlined footnotes, using parnotes, \parnote{inlined footnote 1} and \parnote{inlined footnote 2}, in the answer.}
\LR{\parnotes}
\end{exercise}

\begin{exercise}
\LR{Exercise with usual footnotes, \footnote{footnote 1} and \footnote{footnote 2}, in the question.}
\tcblower
\LR{Exercise with usual footnotes, \footnote{footnote 1} and \footnote{footnote 2}, in the answer.}
\end{exercise}
\tcbstoprecording
\section{Solutions of exercises}
\tcbinputrecords
\end{document}

y su compilación, usando xelatex:

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

información relacionada