다음 단락을 제공하면 \DeclareTotalTColorBox에 오류가 발생합니다.

다음 단락을 제공하면 \DeclareTotalTColorBox에 오류가 발생합니다.

내 태그는 다음과 같습니다.

\documentclass{book}

\usepackage{environ} %fancy boxes
\usepackage{xcolor}
\usepackage[tikz]{bclogo}

\usepackage{etoolbox}
\usepackage{blindtext}%
\usepackage[skins,breakable,xparse]{tcolorbox}%

\bibliographystyle{mit-chicago}

\DeclareTotalTColorBox[auto counter]{\myexer}{ O{} m }
{ enhanced,breakable,
  boxrule=0pt,boxsep=0pt,arc=2mm,toptitle=12pt,beforeafter skip=17pt,top=3mm,left=7mm,right=12pt,pad at break=2mm,
%  colframe=yellow!20!white,interior hidden,
  colframe=black!10,interior hidden,
  coltitle=black,fonttitle=\bfseries\large,title={\hspace*{10pt}Exercise}, %title={Exercise~\thetcbcounter},
  overlay unbroken and first={\node at ([xshift=20pt,yshift=-21pt]frame.north west) {\bccrayon};},
  #1}
  {#2}


\begin{document}

\myexer{
\begin{center} \textbf{Selling Bicycles} \end{center}
Imagine you buy and sell bicycles from your small store. One day, you receive a customer, Yuya, who tells you the following: ``I want to buy a bicycle whose price is \$200, but I am only willing to pay \$100 for it.'' You know that the total cost of each bicycle is \$160, with \$70 the sum of variable costs and \$90 the sum of \emph{allocated} fixed costs.

Next paragraph text follows here:%%If I remove this enter mark, then it works
\begin{enumerate}
    \item Would you sell the bicycle for \$100? (Ignore taxes when making your calculations.)
\end{enumerate}
}


\end{document}

위 코드는 제대로 작동합니다. 을 제거했지만 para enter단락 텍스트가 많은 경우 이 문제를 어떻게 해결할 수 있습니까? 조언해주세요...

답변1

+m대신 으로 얻은 필수 인수에 단락을 허용해야 합니다 m.

\documentclass{book}

\usepackage{environ} %fancy boxes
\usepackage{xcolor}
\usepackage[tikz]{bclogo}

\usepackage{etoolbox}
\usepackage{blindtext}%
\usepackage[skins,breakable,xparse]{tcolorbox}%

\bibliographystyle{mit-chicago}

\DeclareTotalTColorBox[auto counter]{\myexer}{ O{} +m }
 {
  enhanced,breakable,
  boxrule=0pt,
  boxsep=0pt,
  arc=2mm,
  toptitle=12pt,
  beforeafter skip=17pt,
  top=3mm,
  left=7mm,
  right=12pt,
  pad at break=2mm,
  %colframe=yellow!20!white,
  colframe=black!10,
  interior hidden,
  coltitle=black,
  fonttitle=\bfseries\large,
  title={\hspace*{10pt}Exercise},
  %title={Exercise~\thetcbcounter},
  overlay unbroken and first={\node at ([xshift=20pt,yshift=-21pt]frame.north west) {\bccrayon};},
  #1
}{#2}


\begin{document}

\myexer{
  \begin{center} \textbf{Selling Bicycles} \end{center}
  Imagine you buy and sell bicycles from your small store. One day, you receive a 
  customer, Yuya, who tells you the following: ``I want to buy a bicycle whose price 
  is \$200, but I am only willing to pay \$100 for it.'' You know that the total cost 
  of each bicycle is \$160, with \$70 the sum of variable costs and \$90 the sum of 
  \emph{allocated} fixed costs.
  interior hidden,

  Next paragraph text follows here:
  \begin{enumerate}
    \item Would you sell the bicycle for \$100? (Ignore taxes when making your calculations.)
  \end{enumerate}
}


\end{document}

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

관련 정보