I have found that highlighting mathematical formulas with soul package does not work if the nag package is used with l2tabu option. A minimal (not) working example is:


\RequirePackage[l2tabu, orthodox]{nag}


However, if l2tabu option is omitted, everything works fine. Note that if not highlighting math, but normal text, my minimal example will work. The question is why such behavior and how can this be improved?


Short answer: soul is not compatible with nag.

Preferred answer: avoid nag, it does nothing that can't be obtained by using correct style to begin with; avoid soul, too.

Longer answer: if you really need both packages

\RequirePackage[l2tabu, orthodox]{nag}

%\usepackage{hyperref} % try with and without it

  {\ifcat$\noexpand\SOUL@@}% old test
  {\ifx\nag@maybedispmath\SOUL@@}% new test

% the argument of \SOUL@addmath must be delimited by active $
}{}% end of \@ifpackageloaded



Remember that nag must be loaded before \documentclass.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.