0

Below is the error that occurred during the compilation.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "xparse/unknown-argument-type"
! 
! Unknown argument type '!' replaced by 'm'.
! 
! See the LaTeX3 documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  
                                                  
l.105 }

In the .tex file, I used a template from the tikz&pgf documentation that includes the following code (which ends at line 105):

\documentclass[a4paper]{memoir}
\usepackage{tcolorbox}
\usepackage{tikz}
\usepackage{lipsum}


\tcbuselibrary{skins,hooks}
\usetikzlibrary{shadows.blur}



% Ex si solutii fara labeling
\NewTColorBox[auto counter,number within=section]{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.northwest)}]
                    (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{Execices}%


%\vspace{-1cm}%

\tcbstartrecording\relax

\begin{exercise}
Compute the derivative of the following function:
\begin{equation*}
f(x)=\sin((\sin x)^2)
\end{equation*}

\tcblower

The derivative is:
\begin{align*}
f'(x) &= \left( \sin((\sin x)^2) \right)'=\cos((\sin x)^2) 2\sin x \cos x.
\end{align*}
\end{exercise}

\begin{exercise}[no solution]
It holds:
\begin{equation*}
\frac{d}{dx}\left(\ln|x|\right) = \frac{1}{x}.
\end{equation*}
\end{exercise}

\begin{exercise}
Compute the derivative of the following function:
\begin{equation*}
f(x)=(\sin(\sin x))^2
\end{equation*}
\tcblower
The derivative is:
\begin{align*}
f'(x) &= \left( (\sin(\sin x))^2 \right)'=2\sin(\sin x)\cos(\sin x)\cos x.
\end{align*}
\end{exercise}

\tcbstoprecording

\newpage
\tcbinputrecords


\end{document} 

How can be this problem be solved?

9
  • Welcome to TeX. SE! Please extend your code fragment to complete small but compilable document. – Zarko Jun 11 at 11:04
  • 1
    I think we need to see your log file: I wonder what version of code you have. – Joseph Wright Jun 11 at 11:08
  • Additionally is your latex up to date? This kind of problem can be seen by inproperly updated latex installations – daleif Jun 11 at 11:08
  • Some info from log file: This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2019.3.9) 11 JUN 2021 14:00 entering extended mode.... . – demeter Jun 11 at 11:32
  • Some updates after updating the Latex. A new error occurred, namely caused by the \tcblower. More precisely: LaTeX Warning: Reference 'solution@1.0.1' on page 1 undefined on input line 141 ! Undefined control sequence. \tcbverbatimwrite ...\immediate \openout \tcb@out #1 \tcb@verbatim@begin@hoo... l.141 \tcblower – demeter Jun 11 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.