ifthenelse的新命令,缺少文本的前几个字符

问题描述

我的小例子如下:

\documentclass{article}
\usepackage{xifthen}

\newcommand{{\xx}}[2][]{
    \ifthenelse{\isempty{#1}}{
        \underline{\makeBox[20mm][c]{}}
    }{\underline{\makeBox[#1mm][c]{#2}}}
}

\begin{document}

\xx world peace

\xx[30] world peace

\xx{hello world} world peace

\xx[30]{hello world} world peace

\end{document}

\xx world peace\xx[30] world peace出现问题,单词的相应第一个字符丢失或放置错误。好吧,我们可以通过将其替换为\xx{} world peace\xx[30]{} world peace解决此问题。但是,如果我坚持使用\xx world peace\xx[30] world peace怎么解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)