是否有任何我不应该与 ifthen 包一起使用的包

是否有任何我不应该与 ifthen 包一起使用的包

我是 TeX 新手,我开始添加包文件来准备文档,而不必担心冲突。我问这个主观问题,因为我不确定我是否可以在这里发布整个文档序言。任何通用提示都会有很大帮助。

我上传了我的包定义到谷歌文档

\ifthenelse我在附图中用圆圈突出显示了多余的空白。我尝试只使用 ifthen 包和命令,效果很好。

\documentclass[fleqn,12pt,a4paper]{article}
\usepackage{mypackage}
\begin{document}
\Vibhakti{11} \& \Vibhakti{52} \& \Vibhakti{73}
\end{document}

(这应该用 进行编译xelatex。)

例子

我不确定我是否正在使用任何不应该使用的包......

答案1

线条

\ifthenelse{\equal{#1}{11}}{\underline{\textcolor{blue}{प्रथमा एकवचनम्}} }{}
                                                                    ^   ^

在标记的位置产生两个空格。请注意,换行符会为每行引入一个空格。因此,您应该删除第一个空格,并%在每行的最后一个右括号后立即添加注释字符 ( )。这将删除换行符引入的空格。

简而言之,你应该用以下代码替换整个命令定义

\newcommand{\Vibhakti}[1]%
{%
%\ifthenelse{\equal{#1}{1}}{}{}%
\ifthenelse{\equal{#1}{11}}{\underline{\textcolor{blue}{प्रथमा एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{12}}{\underline{\textcolor{blue}{प्रथमा द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{13}}{\underline{\textcolor{blue}{प्रथम बहुवचनम्}}}{}%
\ifthenelse{\equal{#1}{21}}{\underline{\textcolor{blue}{द्वितीया एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{22}}{\underline{\textcolor{blue}{द्वितीया द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{23}}{\underline{\textcolor{blue}{द्वितीया बहुवचनम्}}}{}%
\ifthenelse{\equal{#1}{31}}{\underline{\textcolor{blue}{तृतीया एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{32}}{\underline{\textcolor{blue}{तृतीया द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{33}}{\underline{\textcolor{blue}{तृतीया बहुचनम्}}}{}%
\ifthenelse{\equal{#1}{41}}{\underline{\textcolor{blue}{चतुर्थी एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{42}}{\underline{\textcolor{blue}{चतुर्थी द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{43}}{\underline{\textcolor{blue}{चतुर्थी बहुचनम्}}}{}%
\ifthenelse{\equal{#1}{51}}{\underline{\textcolor{blue}{पञ्चमी एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{52}}{\underline{\textcolor{blue}{पञ्चमी द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{53}}{\underline{\textcolor{blue}{पञ्चमी बहुचनम्}}}{}%
\ifthenelse{\equal{#1}{61}}{\underline{\textcolor{blue}{षष्ठी एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{62}}{\underline{\textcolor{blue}{षष्ठी द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{63}}{\underline{\textcolor{blue}{षष्ठी बहुचनम्}}}{}%
\ifthenelse{\equal{#1}{71}}{\underline{\textcolor{blue}{सप्तमी एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{72}}{\underline{\textcolor{blue}{सप्तमी द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{73}}{\underline{\textcolor{blue}{सप्तमी बहुचनम्}}}{}%
\ifthenelse{\equal{#1}{81}}{\underline{\textcolor{blue}{सम्बोधन प्रथमा एकवचनम्}}}{}%
\ifthenelse{\equal{#1}{82}}{\underline{\textcolor{blue}{सम्बोधन प्रथमा द्विवचनम्}}}{}%
\ifthenelse{\equal{#1}{83}}{\underline{\textcolor{blue}{सम्बोधन प्रथमा बहुचनम्}}}{}%
}

相关内容