0

I am writing a book-like set of classroom notes using the memoir documentstyle. I would like to set off some pieces of text as 'digressions" by using a background color: I've tried two solutions, mimicking an answer to a previous question.
One uses the "framed" package:

\usepackage{framed}
\colorlet{shadecolor}{lightgray}
\newenvironment{digression}[1][]%
    {\colorlet{shadecolor}{lightgray}%
        \bigskip%
                \begin{shaded}%
                \begin{flushleft}%
                \textbf{\LARGE{Digression:}\\ \Large{#1}}\\%
        \medskip
    }%
    {%
    \end{flushleft}%
    \end{shaded}%
    \bigskip%
    }

The other uses the "tcolorbox" package:

\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\newenvironment{digression}[1][]%
{%
    \begin{tcolorbox}[boxrule=0pt, sharp corners, parbox=true, breakable]
                \begin{flushleft}%
                \textbf{\LARGE{Digression:}\\ \Large{#1}}\\%
        \medskip
}%
{%
    \end{flushleft}%
    \end{tcolorbox}%
    \bigskip%
}

Both do the trick as far as getting background color is concerned, but there are two problems that remain for me: (1) if I use the first version, footnotes disappear; with the second, they appear within the box rather than at the bottom of the page; (2) neither one allows figures--the same error occurs in both (not in outer paragraph mode).
I guess the problem (especially (2)) is that this is creating a mini-page (or some analogue).
So my question is: is there a way to introduce a background color which doesn't have these limitations? I'm not in this instance interested in the bells and whistles which are useful for creating beamer slides; I just want to have a part of my page highlighted with a contrasting color.

  • 1
    Welcome to TeX-SX! As a new member, it is recommended to visit the Welcome and the Tour pages to be informed about our format and also to know about Minimal Example. Otherwise, more specifically about your question: for your first issue, might be solved by using \footnotemark and \footnotetext. A MWE helps us to test it before to give you a complete answer. – R. N Jan 24 '21 at 19:29
  • About footnotes take a look at Tcolorbox - footnotes at end of each page you'll find a solution. And respect figures is normal that you have problems. figure is a floating element, so it's not possible to include it into a tcolorbox but you can include non-floating images and add a caption to them with caption package. – Ignasi Jan 25 '21 at 09:24

0 Answers0