0

I am trying to highlight some text with soul::hl within a mdframed environment defined by newmdenv. I get expected output using:

  • hl text outside of the environment
  • normal text within the environment.

However, when I try highlighted text within the environment, the number of the footnote disappears... not sure why?

enter image description here

\documentclass{article}

\usepackage{soul}
\usepackage{mdframed}
\newmdenv[
  topline=false,
  bottomline=false,
]{action}

\begin{document}

This is some normal text\footnote{text}.
\hl{This is some highlighted text\footnote{text}.}

\begin{action}
This is some normal text\footnote{text}.
\end{action}

\begin{action}
\hl{This is some highlighted text\footnote{text}.}
\end{action}

\end{document}

1 Answer 1

1

One possible work-around is \soulregister\footnote7 (see also How to make \hl (highlighting) to automatically place incompatible commands in \mbox?)

\documentclass{article}

\usepackage{soul}
\soulregister\footnote7 % <--
\usepackage{mdframed}
\newmdenv[
  topline=false,
  bottomline=false,
]{action}

\begin{document}

\begin{action}
This is some highlighted text\footnote{text}.
\end{action}

\begin{action}
\hl{This is some highlighted text\footnote{text}.}
\end{action}

\end{document}

enter image description here

1
  • great, thanks!!
    – Matifou
    May 11, 2022 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .