Tcolorbox, 연습 및 Manyfoot 패키지-2

Tcolorbox, 연습 및 Manyfoot 패키지-2

나는 tcolorbox패키지를 사용하여 솔루션이 포함된 연습문제를 제작합니다. 일반적인 각주는 상자 안에 쓰여 있는 것을 볼 수 있지만, 가끔 여러 개의 각주가 있을 때 패키지를 사용하여 manyfoot이러한 각주를 "인라인" 방식으로 작성하지만 원치 않는 결과를 얻습니다. 각주 표시만 생성되고 각주 자체는 생성되지 않습니다. 내 목적에 대한 첫 번째 질문은 다음과 같습니다.

Tcolorbox, 연습 및 Manyfoot 패키지

이제 내 질문은 다음과 같습니다. 연습 상자에서 연습 상자 뒤에 주어진 내 인라인 항목의 접미사가 \footnotetextC어디에 있는지에 따라 명령을 사용하여 상자 외부에 각주를 생성합니다. C질문에 대한 원하는 결과(아래에 사용된 .tex 파일 및 컴파일 참조). \footnotetextC연습 상자와 같이 솔루션 상자 외부에 각주를 생성하는 솔루션 상자 (예: 명령을 기반으로 할 수 있음)의 각주에 대해 유사한 방법을 얻을 수 있습니까 ?

사용된 .tex 파일은 다음과 같습니다.

\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}

xelatex를 사용한 컴파일입니다. 여기에 이미지 설명을 입력하세요

답변1

귀하의 질문을 올바르게 이해했다면 의 ' ' 스타일로 각주를 설정 para하되 . 패키지가 이 작업을 수행할 수 있습니다.manyfoottcolorboxparanotes

복잡한 '연습 솔루션'이 아닌 경우 묵시적 또는 명시 적 명령을 사용하여 메모를 인쇄하는 tcolorbox'parnotes'를 자동화하는 것이 더 쉬울 것입니다 . \parnotes하지만 부분자동화로 하면 큰 어려움은 없습니다.

\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}

참고: 상자를 다른 디렉터리에 기록하기 위해 코드를 제거했습니다(질문의 초점이 아닌 한 MWE에 포함하면 안 됨).

tcolorbox-parnote

답변2

@jon이 제공한 답변을 바탕으로 제가 수락한 질문에 대한 답변을 제공합니다. 이는 실제로 개발된 질문에 대한 답변입니다. 이 질문을 아랍어 환경, 오른쪽에서 왼쪽 환경으로 설정하고 라틴어 문장은 왼쪽에서 오른쪽으로 쓰는 \LR{} 명령 내부에 제공됩니다. 나는 Manyfoot 패키지를 사용하여 각주가 작성되지 않은 예와 parnotes를 사용한 예를 제공하고 원하는 경우 \LR{\parnotes} 명령이 각주를 왼쪽에서 오른쪽으로 쓰는 것을 볼 수 있습니다. , 상자 안에.

얻은 .tex 파일은 다음과 같습니다.

\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}

xelatex를 사용하여 컴파일합니다.

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

관련 정보