\Sigma 和 \sqrt 的镜像

\Sigma 和 \sqrt 的镜像

如何获得\Sigma(Σ) 的镜像以进行求和,\sqrt对于根,我想用阿拉伯数字从右到左写出阿拉伯方程式。我已经使用过: \reflectbox{\sqrt},但没有用。有人能帮帮我吗?

答案1

编辑 3(包括 sin 函数)

包括 sin 函数的输出

% Run in XeLaTeX
\documentclass[12pt]{article}

% Make sure you import your packages before fontspec, polyglossia, etc.
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{mathtools}

%\usepackage{showframe} % Not needed! To show the borders of paper
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Arabic font
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.0,Mapping=arabicdigits]{Amiri}
% Note Mapping=arabicdigits will change all the numbers 
% to arabic numbers to ٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩.

% The following fixes the parentheses around the equation numbers.
\newtagform{arabicparentheses}{)}{(}
\usetagform{arabicparentheses}

% Flips the text about the y axis by 180 degrees.
\newcommand{\adj}[1]{\rotatebox{180}{\scalebox{1}[-1]{#1}}}

% In-text sqrt with the nth root option
\newcommand{\arabicsqrt}[2][]{%
    \adj{\ensuremath{\sqrt[\leftroot{0}\uproot{2}\adj{#1}]{\adj{#2}}}}%
}%
% larger sqrt with the nth root option
\newcommand{\arabicSqrt}[2][]{%
    \adj{\ensuremath{\displaystyle\sqrt[\leftroot{0}\uproot{2}\adj{#1}]{\adj{#2}}}}%
}%
% In-text summation
\newcommand{\arabicsigma}[3]{%
   \adj{\ensuremath{\sum_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% larger summation
\newcommand{\arabicSigma}[3]{%
   \adj{\ensuremath{\displaystyle\sum_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% In-text integral
\newcommand{\arabicint}[3]{%
   \adj{\ensuremath{\int_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% Larger summation
\newcommand{\arabicInt}[3]{%
   \adj{\ensuremath{\displaystyle\int_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%

% Sin
\DeclareMathOperator{\arabicSin}{\textup{\textbf{جا}}}
\newcommand{\SIN}[2][]{\ensuremath{\text{\begin{Arabic}#2‎\end{Arabic}}^\text{\begin{Arabic}#1\end{Arabic}}\arabicSin}}

\begin{document}
% random text!
$\SIN[3]{س}$
بحث في للصين مهمّات, دول و ووصف أهّل. بحشد اللازمة شيء مع,
 أي إعلان ويتّفق كان, دأبوا والفرنسي قد لها.
  وترك لغات الحيلولة أن بال, واحدة الخاطفة المعاهدات لكل عل.
  من تلك يطول أجزاء بالسيطرة, بحق انتهت الشتاء وتنصيب قد.\\
\arabicsqrt[4]{\arabicsqrt[2]{س + 3}}\\
    \begin{minipage}[t]{0.45\textwidth}\vspace{0pt}
        \centerline{text-mode}
        \begin{tabular}{cc}\\
            arabicsqrt  & \arabicsqrt{42}\\[1.4em]
            arabicSqrt  & \arabicSqrt{31}\\[1.4em]
            arabicsqrt  & \arabicsqrt[3]{42}\\[1.4em]
            arabicSqrt  & \arabicSqrt[3]{31}\\[1.4em]
            arabicsigma & \arabicsigma{a}{b}{f(x)}\\[1.4em]
            arabicSigma & \arabicSigma{a}{b}{f(x)}\\[2.2em]
            arabicint   & \arabicint{a}{b}{f(x)}\\[1.8em]
            arabicInt   & \arabicInt{a}{b}{f(x)}\\[2.5em]
            SIN         & Non-existence
        \end{tabular}
    \end{minipage}\begin{minipage}[t]{0.45\textwidth}\vspace{0pt}
        \centerline{mathmode}\vspace{-17pt}
        \begin{align}
            \text{arabicsqrt}       &= \arabicsqrt{42}\\[1.2em]
            \text{arabicSqrt}       &= \arabicSqrt{31}\\[1.2em]
            \text{arabicsqrt}       &= \arabicsqrt[3]{42}\\[1.2em]
            \text{arabicSqrt}       &= \arabicSqrt[3]{31}\\[1.2em]
            \text{arabicsigma}  &= \arabicsigma{س}{ب}{f(x)}\\[1.2em]
            \text{arabicSigma}  &= \arabicSigma{س}{ب}{f(x)}\\[1.2em]
            \text{arabicint}        &= \arabicint{س}{ب}{f(x)}\\[1.2em]
            \text{arabicInt}        &= \arabicInt{س}{ب}{f(x)}\\[1.2em]
            \text{SIN}              &= \SIN[3]{س}
        \end{align}
    \end{minipage}
\end{document}

编辑 2(完整的阿拉伯语示例)

我收集了一个不错的、最小的工作示例,它可以满足基本需求。首先,我添加了和\leftroot{0}\uproot{2}的定义以更改 n 次方根的位置。其次,带括号的阿拉伯文本/数字根本无法正常工作。因此,它已得到解决。顺便显示了随机复制和粘贴的阿拉伯文本 :)。\arabicsqrt\arabicSqrt

阿拉伯语输出

\documentclass[12pt]{article}

% Make sure you import your packages before fontspec, polyglossia, etc.
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{mathtools}
%\usepackage{showframe} % Not needed! To show the borders of paper
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Arabic font
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.0,Mapping=arabicdigits]{Amiri}
% Note Mapping=arabicdigits will change all the numbers 
% to arabic numbers to ٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩.

% The following fixes the parentheses around the equation numbers.
\newtagform{arabicparentheses}{)}{(}
\usetagform{arabicparentheses}

% Flips the text about the y axis by 180 degrees.
\newcommand{\adj}[1]{\rotatebox{180}{\scalebox{1}[-1]{#1}}}

% In-text sqrt with the nth root option
\newcommand{\arabicsqrt}[2][]{%
    \adj{\ensuremath{\sqrt[\leftroot{0}\uproot{2}\adj{#1}]{\adj{#2}}}}%
}%
% larger sqrt with the nth root option
\newcommand{\arabicSqrt}[2][]{%
    \adj{\ensuremath{\displaystyle\sqrt[\leftroot{0}\uproot{2}\adj{#1}]{\adj{#2}}}}%
}%
% In-text summation
\newcommand{\arabicsigma}[3]{%
   \adj{\ensuremath{\sum_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% larger summation
\newcommand{\arabicSigma}[3]{%
   \adj{\ensuremath{\displaystyle\sum_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% In-text integral
\newcommand{\arabicint}[3]{%
   \adj{\ensuremath{\int_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% Larger summation
\newcommand{\arabicInt}[3]{%
   \adj{\ensuremath{\displaystyle\int_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%

\begin{document}
% random text!
بحث في للصين مهمّات, دول و ووصف أهّل. بحشد اللازمة شيء مع,
 أي إعلان ويتّفق كان, دأبوا والفرنسي قد لها.
  وترك لغات الحيلولة أن بال, واحدة الخاطفة المعاهدات لكل عل.
  من تلك يطول أجزاء بالسيطرة, بحق انتهت الشتاء وتنصيب قد.\\
\arabicsqrt[4]{\arabicsqrt[2]{س + 3}}\\
    \begin{minipage}[t]{0.45\textwidth}\vspace{0pt}
        \centerline{In text-mode}
        \begin{tabular}{cc}
            arabicsqrt  & \arabicsqrt{42}\\[1.2em]
            arabicSqrt  & \arabicSqrt{31}\\[1.2em]
            arabicsqrt  & \arabicsqrt[3]{42}\\[1.2em]
            arabicSqrt  & \arabicSqrt[3]{31}\\[1.2em]
            arabicsigma & \arabicsigma{a}{b}{f(x)}\\[1.2em]
            arabicSigma & \arabicSigma{a}{b}{f(x)}\\[1.2em]
            arabicint   & \arabicint{a}{b}{f(x)}\\[1.2em]
            arabicInt   & \arabicInt{a}{b}{f(x)}
        \end{tabular}
    \end{minipage}\begin{minipage}[t]{0.45\textwidth}\vspace{0pt}
        \centerline{In math mode}\vspace{-17pt}
        \begin{align}
            \text{arabicsqrt}   &= \arabicsqrt{42}\\[1.2em]
            \text{arabicSqrt}   &= \arabicSqrt{31}\\[1.2em]
            \text{arabicsqrt}   &= \arabicsqrt[3]{42}\\[1.2em]
            \text{arabicSqrt}   &= \arabicSqrt[3]{31}\\[1.2em]
            \text{arabicsigma}  &= \arabicsigma{س}{ب}{f(x)}\\[1.2em]
            \text{arabicSigma}  &= \arabicSigma{س}{ب}{f(x)}\\[1.2em]
            \text{arabicint}    &= \arabicint{س}{ب}{f(x)}\\[1.2em]
            \text{arabicInt}    &= \arabicInt{س}{ب}{f(x)}
        \end{align}
    \end{minipage}
\end{document}

编辑1

我已经更改了\arabicsqrt实现以接受 n 次方根,因为它非常简洁(因此更容易理解和更改)。另外,我添加了积分符号以及两种模式:文本模式和数学模式。

更新输出

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}

% Flips the text about the y axis by 180 degrees.
\newcommand{\adj}[1]{\rotatebox{180}{\scalebox{1}[-1]{#1}}}

% In-text sqrt with the nth root option
\newcommand{\arabicsqrt}[2][]{%
    \adj{\ensuremath{\sqrt[\adj{#1}]{\adj{#2}}}}%
}%
% larger sqrt with the nth root option
\newcommand{\arabicSqrt}[2][]{%
    \adj{\ensuremath{\displaystyle\sqrt[\adj{#1}]{\adj{#2}}}}%
}%
% In-text summation
\newcommand{\arabicsigma}[3]{%
   \adj{\ensuremath{\sum_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% larger summation
\newcommand{\arabicSigma}[3]{%
   \adj{\ensuremath{\displaystyle\sum_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% In-text integral
\newcommand{\arabicint}[3]{%
   \adj{\ensuremath{\int_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%
% Larger summation
\newcommand{\arabicInt}[3]{%
   \adj{\ensuremath{\displaystyle\int_{\adj{#1}}^{\adj{#2}}\adj{\ensuremath{#3}}}}%
}%

\begin{document}
    \begin{minipage}[t]{0.45\textwidth}\vspace{0pt}
        \centerline{In text-mode}
        \begin{tabular}{cc}
            \verb|\arabicsqrt|  & \arabicsqrt{42}\\[1.2em]
            \verb|\arabicSqrt|  & \arabicSqrt{31}\\[1.2em]
            \verb|\arabicsqrt|  & \arabicsqrt[3]{42}\\[1.2em]
            \verb|\arabicSqrt|  & \arabicSqrt[3]{31}\\[1.2em]
            \verb|\arabicsigma| & \arabicsigma{a}{b}{f(x)}\\[1.2em]
            \verb|\arabicSigma| & \arabicSigma{a}{b}{f(x)}\\[1.2em]
            \verb|\arabicint|   & \arabicint{a}{b}{f(x)}\\[1.2em]
            \verb|\arabicInt|   & \arabicInt{a}{b}{f(x)}
        \end{tabular}
    \end{minipage}\begin{minipage}[t]{0.45\textwidth}\vspace{0pt}
        \centerline{In math mode}\vspace{-17pt}
        \begin{align*}
            \texttt{arabicsqrt}     &= \arabicsqrt{42}\\[1.2em]
            \texttt{arabicSqrt}     &= \arabicSqrt{31}\\[1.2em]
            \texttt{arabicsqrt}     &= \arabicsqrt[3]{42}\\[1.2em]
            \texttt{arabicSqrt}     &= \arabicSqrt[3]{31}\\[1.2em]
            \texttt{arabicsigma}    &= \arabicsigma{a}{b}{f(x)}\\[1.2em]
            \texttt{arabicSigma}    &= \arabicSigma{a}{b}{f(x)}\\[1.2em]
            \texttt{arabicint}      &= \arabicint{a}{b}{f(x)}\\[1.2em]
            \texttt{arabicInt}      &= \arabicInt{a}{b}{f(x)}
        \end{align*}
    \end{minipage}
\end{document}

原来的

这是一个起点,您可以从头开始实现这些功能。

输出

\documentclass{article}
\usepackage{graphicx}
\newcommand{\arabicsqrt}[1]{
    \scalebox{1}[-1]{%
        \rotatebox{180}{%
            \ensuremath{%
                \sqrt{\rotatebox{180}{\scalebox{1}[-1]{#1}}}%
            }%
        }%
    }%
}%

\newcommand{\arabicsigma}[3]{%
    \scalebox{1}[-1]{%
        \rotatebox{180}{%
            \ensuremath{%
                \sum_{\rotatebox{180}{\scalebox{1}[-1]{#1}}}^{\rotatebox{180}{\scalebox{1}[-1]{#2}}}
                {\rotatebox{180}{\scalebox{1}[-1]{\ensuremath{#3}}}}
            }%
        }%
    }%
}%
\begin{document}
    \noindent
    \arabicsqrt{42}\\[2em]
    \arabicsigma{a}{b}{f(x)}
\end{document}

答案2

我认为我没有理解你的问题。阿拉伯语中的符号和方程式不会改变方向。平方根保持不变。但如果你真的需要这样的转换,你可以使用 中的\reflectboxgraphicx此答案中给出了一个例子:

egreg 的回答

相关内容