I'm using the package soulpos, but run into a problem when I use a soulpos command in a footnote. The following MWE reproduces the behavior :

Code when executed


    % Simple example of a soulpos command named \ulp
   The formatting of soulpos works \ulp{here}. However\footnote{Because of this footnote containing \ulp{soulpos}}
   the formatting breaks \ulp{here}.

So, as soon as a soulpos command is used in a footnote, all the following soulpos commands get either deactivated, or don't highlight the right words. This problem also seems to appear on this GitHub issue for soulpos inside captions, so it's probably more generally a problem of using soulpos in floats.

I've tried many things to try to make it work. For example using \footnotemark and \footnotetext instead of \footnote. I also tried using the command \FloatBarrier of the package placeins.

Something that kinda makes it work is to have a \clearpage right after the footnote command. With that, all soulpos commands are rightly formatted, but now the problem is that there is a pagebreak. I also tried things like using the \afterpage command of the afterpage package to do this : \afterpage{\clearpage} but it doesn't work either.

This is the description of the soulpos package :

The package combines the use of soul with the savepos mechanism of current pdfTeX so that the user can create (almost) arbitrary underlining and similar “decorations”, including rules, leaders and even pictures (pgf, pstricks, etc.). Unlike soul underlines, which are built by repeating small elements, here each chunk of text to be underlined is a single element.

Maybe this issue could be solved by patching the code of soulpos ? The code of the package isn't very long, but I don't understand how it works so I wouldn't know where to start. Or maybe the problem comes from the soul package that soulpos uses ?

Thanks in advance for any help

  • well as I wrote in the deleted answer, soulpos closes the output files too early. But while repairing that make the highlighting appear, the order and (so the widths) is wrong. I would drop that and use lualatex and the lua-ul package. Commented Jun 24 at 21:56


You must log in to answer this question.

Browse other questions tagged .