
Utilizo o tcolorbox
pacote para produzir exercícios com solução. Pode-se ver que as notas de rodapé usuais estão escritas dentro da caixa, mas quando às vezes tenho várias notas de rodapé, utilizo o manyfoot
pacote para escrever essas notas de rodapé de forma "inline", mas obtenho um resultado indesejado. Apenas as marcas das notas de rodapé são produzidas, mas não as próprias notas de rodapé. A primeira pergunta do meu propósito foi dada aqui:
Tcolorbox, exercícios e o pacote manyfoot
Minha dúvida agora é a seguinte: Na caixa do exercício, eu produzo suas notas de rodapé fora da caixa com os comandos baseados em \footnotetextC
onde C
está o sufixo do meu item iniline, dado após a caixa do exercício, e pode-se ver que produz o resultado desejado para a pergunta (veja o arquivo .tex usado abaixo e sua compilação). Como posso obter uma forma semelhante para as notas de rodapé na caixa da solução (que pode ser baseada em comandos como \footnotetextC
), que produz as notas de rodapé fora da caixa da solução, como para a caixa do exercício.
Aqui está o arquivo .tex usado:
\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}
Responder1
Se entendi sua pergunta corretamente, você deseja que suas notas de rodapé sejam definidas no para
estilo '' de manyfoot
, mas dentro de tcolorbox
. O pacote paranotes
pode fazer isso por você.
Se não fosse pelas complexas 'soluções de exercícios' tcolorbox
, seria mais fácil automatizar as 'parnotes', que dependem de um \parnotes
comando implícito ou explícito para imprimir as notas. Mas não é muito difícil fazer isso com automação 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: removi seu código para gravar as caixas em outro diretório (que não deve ser incluído em um MWE, a menos que esse seja o foco da questão).
Responder2
Com base na resposta dada por @jon, o que aceito, dou uma resposta à minha pergunta, que é realmente uma resposta para uma pergunta desenvolvida... Coloquei esta pergunta em ambiente árabe, um ambiente da direita para a esquerda, e as sentenças latinas são fornecidas dentro dos comandos \LR{} que as escrevem da esquerda para a direita. Dou exemplos usando o pacote manyfoot, onde vemos que as notas de rodapé não são escritas, e um exemplo usando parnotes, e vemos que o comando \LR{\parnotes} escreve as notas de rodapé, no modo da esquerda para a direita se eu quiser , dentro da caixa.
Aqui está o arquivo .tex obtido:
\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}
e sua compilação, usando xelatex: