如何在乳胶中的方程式中正确显示文本

如何在乳胶中的方程式中正确显示文本

如何在乳胶中的方程式中正确显示文本

 \def\DevnagVersion{2.15}  
 \documentclass[conference]{IEEEtran}  
 \usepackage[lined,ruled,vlined,resetcount]{algorithm2e}  
 \renewcommand{\thealgocf}{}  
 \usepackage{csquotes}  
 \usepackage{wfrac}  
 \usepackage{array}  
 \usepackage{caption}  
 \providecommand{\SetAlgoLined}{\SetLine}  
 \hyphenation{op-tical net-works semi-conduc-tor}  
 \usepackage{filecontents}  
 \usepackage{cite}  
 \usepackage{devanagari}  
 \begin{document}
 \begin{equation}  
    PMI({\dn u(pAd} + {\dn \7{K}f}) \\  
    = Round(LOG((F({\dn u(pAd} + {\dn \7{K}f})/TotalBigrams)/( (F({\dn u(pAd})/TotalUnigrams)*(F({\dn \7{K}f})/TotalUnigrams)))\\  
    = Round(LOG( (1/1298) / (20/1299)*(6/1299))),2)\\  
    = Round(Log(0.000770416/(0.0153964588*0.0046189376)),2)\\  
    = Round(Log(10.8333397535),2)\\  
    = Round(1.0347623636,2)\\  
    = 1.03\\  
    \end{equation}
\end{document

它显示的输出是

 PMI(u Ú +)
 = Round(LOG((F (u Ú + )/TotalBigrams)/((F(u Ú)/TotalUnigrams)*(F()/TotalUnigrams)))
 = Round(LOG((1/1298)/(20/1299) ∗ (6/1299))), 2)
 = Round(Log(0.000770416/(0.0153964588∗0.0046189376)), 2)
 = Round(Log(10.8333397535), 2)
 = Round(1.0347623636, 2)
 = 1.03

答案1

您必须隐藏梵文部分\text

\def\DevnagVersion{2.15}  
\documentclass[conference]{IEEEtran}
\usepackage{amsmath,mleftright}
\usepackage[lined,ruled,vlined,resetcount]{algorithm2e}
\renewcommand{\thealgocf}{}
\usepackage{csquotes}
%\usepackage{wfrac}
\usepackage{array}
\usepackage{caption}
\providecommand{\SetAlgoLined}{\SetLine}
\hyphenation{op-tical net-works semi-conduc-tor}
\usepackage{filecontents}
\usepackage{cite}
\usepackage{devanagari}

\DeclareMathOperator{\Round}{Round}
\DeclareMathOperator{\Log}{Log}

\begin{document}
\begin{equation}
\begin{aligned}
&\mathrm{PMI}(\text{\dn u(pAd} + \text{\dn \7{K}f}) \\
  &= \Round\mleft(\Log
       \frac{\dfrac{F(\text{\dn u(pAd} + \text{\dn \7{K}f}))}{\mathrm{TotalBigrams}}}
            {\dfrac{F(\text{\dn u(pAd}))}{\mathrm{TotalUnigrams}}*
             \dfrac{F(\text{\dn \7{K}f})}{\mathrm{TotalUnigrams}}}
     \mright)\\
  &= \Round\mleft(\Log
       \frac{\dfrac{1}{\mathstrut 1298}}
            {\dfrac{\mathstrut 20}{1299}*\dfrac{6}{1299}}
     ,2\mright)\\  
  &= \Round\mleft(\Log\frac{0.000770416}{0.0153964588*0.0046189376},2\mright)\\
  &= \Round(\Log(10.8333397535),2)\\
  &= \Round(1.0347623636,2)\\
  &= 1.03
\end{aligned}
\end{equation}

\end{document}

我将其保存为jha.dn并运行

rm -f jha.tex && devnag jha.dn > jha.tex && pdflatex jha

得到以下结果,适合一列

在此处输入图片描述

注意:我注释掉了wfrac我的系统上没有的包。

答案2

您的方程式几乎不可能计算出来……所以我猜您会喜欢这样的东西:

在此处输入图片描述

上图是我通过以下方式获得的:

\documentclass[border=3mm,
               preview]{standalone}%preview enable showing math
\usepackage{mathtools} % loads amsmath too

\begin{document}
    \begin{flalign*}
PMI(A + B) 
    & = \mathrm{Round}\bigl(\log(F(A + Bf)\mathrm{/TotalBigrams/}
            (F(A)\mathrm{/TotalUnigrams/}*F(Bf)\mathrm{/TotalUnigrams/})\bigr)\\
    & = \mathrm{Round}\bigl(\log(1/1298 /(20/1299)*(6/1299)),2\bigr)\\
    & = \mathrm{Round}\bigl(\log(0.000770416/(0.0153964588*0.0046189376)),2\bigr)\\
    & = \mathrm{Round}\bigl(\log(10.8333397535),2\bigr)\\
    & = \mathrm{Round}\bigl(1.0347623636,2\bigr)\\
    & = 1.03
   \end{flalign*}
\end{document}

在方程式中,我省略了所有用您的语言定义的字符/符号。要将它们重新插入,您需要\text{...}按照其他人在其评论中所建议的那样将其括起来。我也不介意您介意符号\,所以我保留了它的原样。

相关内容