jbezos / soulpos

MIT License
0 stars 1 forks source link

Cannot use commands with arguments inside soulpos commands #6

Open LinqLover opened 1 month ago

LinqLover commented 1 month ago

MWE 1:

\documentclass{article}

\usepackage{soulpos}

\newcommand{\mycmdA}[1]{(#1)}
\newcommand{\mycmdB}[2]{(#1) (#2)}

\begin{document}

hi \mycmdA{foo} bye

hi \mycmdB{foo}{baz} bye

\st{hi \mycmdA{foo} bye}

\st{hi \mycmdB{foo}{baz} bye}

\end{document}

image

MWE 2:

\documentclass{article}

\usepackage{soulpos}

\newcommand{\mycmdA}[1]{(#1)}
\newcommand{\mycmdB}[2]{(#1) (#2)}

\begin{document}

hi \mycmdA{foo} bye

hi \mycmdB{foo}{baz} bye

\st{hi {\mycmdA{foo}} bye}

\st{hi {\mycmdB{foo}{baz}} bye}

\end{document}

image

LinqLover commented 1 month ago

Workaround: Wrap \mycmdB{...}{...} into an \mbox. However, this prevents the contents of the command from being proper line-wrapped.

LinqLover commented 1 month ago

\protect\mycmdB also does the trick. But I don't want to rewrite all users of \st in my document ...