5

I want to change the default footnotemark style inside a tcolorbox, but using \renewcommand{\thefootnote}{\fnsymbol{footnote}} in the preamble does not work.

The tcolorbox is inside an environment created with \newenvironment. I have tried putting \renewcommand{\thefootnote}{\fnsymbol{footnote}} inside its definition, but still doesn't work.

I have searched inside the tcolorbox manual, but I can't find nothing about that.

Here's a MWE:

\documentclass[12pt]{article}
\usepackage{tcolorbox}

\newcounter{problem}[section]
\def\theproblem {\arabic{problem}}
\def\problem{%
    {\par{\makebox[1.8em][l]{\large\bf\theproblem.~}}}
}

\newenvironment{Exercise}
    {
        \refstepcounter{problem}
        \renewcommand{\thefootnote}{\fnsymbol{footnote}} %This doesn't work:(
        \begin{tcolorbox}[]
        \noindent\problem{}
    }
    {
        \end{tcolorbox}
        \smallskip
    }

    \begin{document}
            \begin{Exercise}
                An exercise\footnote{This is the footnote} with a footnote.
            \end{Exercise}
    \end{document}

and the typeset:

enter image description here

Any help?

Patone
  • 95

1 Answers1

8

What I meant is:

\documentclass[12pt]{article}
\usepackage{tcolorbox}
\newtcolorbox[auto counter,number within=section]{Exercise}[1][]{%
before upper=\renewcommand\thempfootnote{\fnsymbol{mpfootnote}},
title=Problem \thetcbcounter}
\begin{document}
\section{Pft}
\begin{Exercise}
    An exercise\footnote{This is the footnote} with a footnote.
\end{Exercise}
\end{document}

enter image description here

What is important here is that you were modifying the wrong mark, in minipages you need to use mpfootnote.. Applying this to your MWE (thanks BTW!) yields

\documentclass[12pt]{article}
\usepackage{tcolorbox}

\newcounter{problem}[section]
\def\theproblem {\arabic{problem}}
\def\problem{%
    {\par{\makebox[1.8em][l]{\large\bf\theproblem.~}}}
}

\newenvironment{Exercise}
{
    \refstepcounter{problem}
    \renewcommand{\thempfootnote}{\fnsymbol{mpfootnote}} %This doesn't work:(
    \begin{tcolorbox}[]
    \noindent\problem{}
}
{
    \end{tcolorbox}
    \smallskip
}

\begin{document}
        \begin{Exercise}
            An exercise\footnote{This is the footnote} with a footnote.
        \end{Exercise}
\end{document}

enter image description here

  • Thank you very much for your time. I think I learned a lot today (or, according to the uncertainty principle, I haven't learned anything yet!) – Patone Oct 02 '19 at 18:30
  • You were right. The code is much simpler and more elegant using \newtcolorbox. I'm reading about that in the tcolorbox manual. Thanks again! – Patone Oct 02 '19 at 19:24