![如何使运算符(非关系)= 符号](https://linux22.com/image/330651/%E5%A6%82%E4%BD%95%E4%BD%BF%E8%BF%90%E7%AE%97%E7%AC%A6%EF%BC%88%E9%9D%9E%E5%85%B3%E7%B3%BB%EF%BC%89%3D%20%E7%AC%A6%E5%8F%B7.png)
我正在使用 格式化一个长公式(计算结果)breqn
。如果我用 这样的运算符替换 = 符号,效果会很好\times
。但是当我输入 = 时,我不喜欢输出。
我认为我应该能够breqn
通过类似以下方式使“=”与“+”相同
\DecalareMathSymbol{\myequals}{\mathbin}{sym-font?}{slot?}
然后使用\myequals
而不是 =。不幸的是,我不知道要将 sym-font 和 slot 填入什么才能得到 = 符号。
我怎样才能做到这一点?
这是一个 MWE(有点长,但我需要公式很长才能使结果引人注目)(这是一个示例链接):
\documentclass{amsart}
\usepackage{breqn}
\newcommand{\longformula}{
1 + \left(-\frac{1}{6} r^{3} + \frac{1}{6} r\right)z^{2} +
\left(\frac{17}{40} r^{5} - \frac{5}{8} r^{3} + \frac{1}{5}
r\right)z^{3} + \left(-\frac{631}{630} r^{7} + \frac{1}{72} r^{6} +
\frac{88}{45} r^{5} - \frac{1}{36} r^{4} - \frac{209}{180} r^{3} +
\frac{1}{72} r^{2} + \frac{29}{140} r\right)z^{4} +
\left(\frac{171215}{72576} r^{9} - \frac{17}{240} r^{8} -
\frac{69619}{12096} r^{7} + \frac{7}{40} r^{6} + \frac{16979}{3456}
r^{5} - \frac{11}{80} r^{4} - \frac{31259}{18144} r^{3} + \frac{1}{30}
r^{2} + \frac{13}{63} r\right)z^{5} + \left(-\frac{18684667}{3326400}
r^{11} + \frac{155581}{604800} r^{10} + \frac{597209}{36288} r^{9} -
\frac{1699}{2240} r^{8} - \frac{5513891}{302400} r^{7} +
\frac{23033}{28800} r^{6} + \frac{114685}{12096} r^{5} -
\frac{2669}{7560} r^{4} - \frac{519509}{226800} r^{3} + \frac{229}{4200}
r^{2} + \frac{281}{1386} r\right)z^{6} +
\left(\frac{401297449}{29652480} r^{13} - \frac{8914439}{10886400}
r^{12} - \frac{528153667}{11404800} r^{11} + \frac{30585833}{10886400}
r^{10} + \frac{4352347}{69120} r^{9} - \frac{13405099}{3628800} r^{8} -
\frac{44899771}{1036800} r^{7} + \frac{25156259}{10886400} r^{6} +
\frac{817639}{51840} r^{5} - \frac{1859441}{2721600} r^{4} -
\frac{339287}{118800} r^{3} + \frac{1433}{18900} r^{2} + \frac{85}{429}
r\right)z^{7} + \left(-\frac{448937586017}{13621608000} r^{15} +
\frac{545510843}{223534080} r^{14} + \frac{200873307991}{1556755200}
r^{13} - \frac{4578488741}{479001600} r^{12} -
\frac{41467078967}{199584000} r^{11} + \frac{653808103}{43545600} r^{10}
+ \frac{13531857077}{76204800} r^{9} - \frac{1224530857}{101606400}
r^{8} - \frac{4709184889}{54432000} r^{7} + \frac{56484901}{10886400}
r^{6} + \frac{119034073}{4989600} r^{5} - \frac{67641247}{59875200}
r^{4} - \frac{7752863023}{2270268000} r^{3} + \frac{1123657}{11642400}
r^{2} + \frac{9949}{51480} r\right)z^{8} +
\left(\frac{1067238963813721}{13173608448000} r^{17} -
\frac{4580572146421}{653837184000} r^{16} -
\frac{1868424788136953}{5230697472000} r^{15} +
\frac{1008805230793}{32691859200} r^{14} +
\frac{992904065416223}{1494484992000} r^{13} -
\frac{101113443793}{1796256000} r^{12} -
\frac{272962348105847}{402361344000} r^{11} +
\frac{25120947101}{457228800} r^{10} +
\frac{60592820342221}{146313216000} r^{9} -
\frac{141153688681}{4572288000} r^{8} -
\frac{4423647350867}{28740096000} r^{7} + \frac{7144205161}{718502400}
r^{6} + \frac{44170826140139}{1307674368000} r^{5} -
\frac{15354074077}{9081072000} r^{4} - \frac{36013858967}{9081072000}
r^{3} + \frac{48901}{420420} r^{2} + \frac{6871}{36465} r\right)z^{9} +
\left(-\frac{174424081161393493}{868893574348800} r^{19} +
\frac{740164886921567}{37661021798400} r^{18} +
\frac{525222462909510739}{533531142144000} r^{17} -
\frac{1509433069953143}{15692092416000} r^{16} -
\frac{32583814614724447}{15692092416000} r^{15} +
\frac{250692752979619}{1255367393280} r^{14} +
\frac{16579532320075783}{6725182464000} r^{13} -
\frac{829530467198351}{3621252096000} r^{12} -
\frac{4367664389322431}{2414168064000} r^{11} +
\frac{13899331735211}{87787929600} r^{10} +
\frac{2045747884459907}{2414168064000} r^{9} -
\frac{40609260170929}{603542016000} r^{8} -
\frac{423655761620591}{1681295616000} r^{7} +
\frac{40245068798999}{2353813862400} r^{6} +
\frac{29792663200381}{653837184000} r^{5} -
\frac{96567618673}{40864824000} r^{4} - \frac{115983959747}{25729704000}
r^{3} + \frac{6135329}{45405360} r^{2} + \frac{84883}{461890}
r\right)z^{10}
+ O(z^{11})
}
\begin{document}
looks good but I want the $\times$ to be an $=$:
\begin{dmath*}
A(z) \times \longformula
\end{dmath*}
looks bad to me:
\begin{dmath*}
A(z) = \longformula
\end{dmath*}
\end{document}
答案1
答案2
由于这里没有对齐,我可能breqn
根本不会使用它
\documentclass{amsart}
%\usepackage{breqn}
\newcommand{\longformula}{
1 + \Bigl(-\frac{1}{6} r^{3} + \frac{1}{6} r\Bigr)z^{2} +
\Bigl(\frac{17}{40} r^{5} - \frac{5}{8} r^{3} + \frac{1}{5}
r\Bigr)z^{3} + \Bigl(-\frac{631}{630} r^{7} + \frac{1}{72} r^{6} +
\frac{88}{45} r^{5} - \frac{1}{36} r^{4} - \frac{209}{180} r^{3} +
\frac{1}{72} r^{2} + \frac{29}{140} r\Bigr)z^{4} +
\Bigl(\frac{171215}{72576} r^{9} - \frac{17}{240} r^{8} -
\frac{69619}{12096} r^{7} + \frac{7}{40} r^{6} + \frac{16979}{3456}
r^{5} - \frac{11}{80} r^{4} - \frac{31259}{18144} r^{3} + \frac{1}{30}
r^{2} + \frac{13}{63} r\Bigr)z^{5} + \Bigl(-\frac{18684667}{3326400}
r^{11} + \frac{155581}{604800} r^{10} + \frac{597209}{36288} r^{9} -
\frac{1699}{2240} r^{8} - \frac{5513891}{302400} r^{7} +
\frac{23033}{28800} r^{6} + \frac{114685}{12096} r^{5} -
\frac{2669}{7560} r^{4} - \frac{519509}{226800} r^{3} + \frac{229}{4200}
r^{2} + \frac{281}{1386} r\Bigr)z^{6} +
\Bigl(\frac{401297449}{29652480} r^{13} - \frac{8914439}{10886400}
r^{12} - \frac{528153667}{11404800} r^{11} + \frac{30585833}{10886400}
r^{10} + \frac{4352347}{69120} r^{9} - \frac{13405099}{3628800} r^{8} -
\frac{44899771}{1036800} r^{7} + \frac{25156259}{10886400} r^{6} +
\frac{817639}{51840} r^{5} - \frac{1859441}{2721600} r^{4} -
\frac{339287}{118800} r^{3} + \frac{1433}{18900} r^{2} + \frac{85}{429}
r\Bigr)z^{7} + \Bigl(-\frac{448937586017}{13621608000} r^{15} +
\frac{545510843}{223534080} r^{14} + \frac{200873307991}{1556755200}
r^{13} - \frac{4578488741}{479001600} r^{12} -
\frac{41467078967}{199584000} r^{11} + \frac{653808103}{43545600} r^{10}
+ \frac{13531857077}{76204800} r^{9} - \frac{1224530857}{101606400}
r^{8} - \frac{4709184889}{54432000} r^{7} + \frac{56484901}{10886400}
r^{6} + \frac{119034073}{4989600} r^{5} - \frac{67641247}{59875200}
r^{4} - \frac{7752863023}{2270268000} r^{3} + \frac{1123657}{11642400}
r^{2} + \frac{9949}{51480} r\Bigr)z^{8} +
\Bigl(\frac{1067238963813721}{13173608448000} r^{17} -
\frac{4580572146421}{653837184000} r^{16} -
\frac{1868424788136953}{5230697472000} r^{15} +
\frac{1008805230793}{32691859200} r^{14} +
\frac{992904065416223}{1494484992000} r^{13} -
\frac{101113443793}{1796256000} r^{12} -
\frac{272962348105847}{402361344000} r^{11} +
\frac{25120947101}{457228800} r^{10} +
\frac{60592820342221}{146313216000} r^{9} -
\frac{141153688681}{4572288000} r^{8} -
\frac{4423647350867}{28740096000} r^{7} + \frac{7144205161}{718502400}
r^{6} + \frac{44170826140139}{1307674368000} r^{5} -
\frac{15354074077}{9081072000} r^{4} - \frac{36013858967}{9081072000}
r^{3} + \frac{48901}{420420} r^{2} + \frac{6871}{36465} r\Bigr)z^{9} +
\Bigl(-\frac{174424081161393493}{868893574348800} r^{19} +
\frac{740164886921567}{37661021798400} r^{18} +
\frac{525222462909510739}{533531142144000} r^{17} -
\frac{1509433069953143}{15692092416000} r^{16} -
\frac{32583814614724447}{15692092416000} r^{15} +
\frac{250692752979619}{1255367393280} r^{14} +
\frac{16579532320075783}{6725182464000} r^{13} -
\frac{829530467198351}{3621252096000} r^{12} -
\frac{4367664389322431}{2414168064000} r^{11} +
\frac{13899331735211}{87787929600} r^{10} +
\frac{2045747884459907}{2414168064000} r^{9} -
\frac{40609260170929}{603542016000} r^{8} -
\frac{423655761620591}{1681295616000} r^{7} +
\frac{40245068798999}{2353813862400} r^{6} +
\frac{29792663200381}{653837184000} r^{5} -
\frac{96567618673}{40864824000} r^{4} - \frac{115983959747}{25729704000}
r^{3} + \frac{6135329}{45405360} r^{2} + \frac{84883}{461890}
r\Bigr)z^{10}
+ O(z^{11})
}
\begin{document}
Or simply
\begin{raggedright}\baselineskip2.5\baselineskip
$\displaystyle
A(z) = \longformula
$
\end{raggedright}
\end{document}
答案3
可以在命令中隐藏等号以欺骗包breqn
:
\mathchardef\EqualsSign=\mathcode`\=
这需要定义前包breqn
已加载,因为该包重新定义了数学类别代码并使等号在数学上下文中处于活动状态。
例子:
\documentclass{amsart}
\mathchardef\EqualSign=\mathcode`\=
\usepackage{breqn}
\newcommand{\longformula}{...}
\begin{document}
\begin{dmath*}
A(z) \EqualSign \longformula
\end{dmath*}
\end{document}
答案4
事先放进盒子里??特别是,
\setbox0=\hbox{${}={}$}
\begin{dmath*}
A(z) \box0 \longformula
\end{dmath*}
当然,这也可以自动化,因为
\newsavebox\sveq
\savebox\sveq{$=$}
\def\EqualSign{\mathrel{\usebox{\sveq}}}
根据\EqualSign
需要使用(如果在较小的数学样式中需要它,请告诉我,修复很简单)。这是 MWE。
\documentclass{amsart}
\usepackage{breqn}
\newcommand{\longformula}{
1 + \left(-\frac{1}{6} r^{3} + \frac{1}{6} r\right)z^{2} +
\left(\frac{17}{40} r^{5} - \frac{5}{8} r^{3} + \frac{1}{5}
r\right)z^{3} + \left(-\frac{631}{630} r^{7} + \frac{1}{72} r^{6} +
\frac{88}{45} r^{5} - \frac{1}{36} r^{4} - \frac{209}{180} r^{3} +
\frac{1}{72} r^{2} + \frac{29}{140} r\right)z^{4} +
\left(\frac{171215}{72576} r^{9} - \frac{17}{240} r^{8} -
\frac{69619}{12096} r^{7} + \frac{7}{40} r^{6} + \frac{16979}{3456}
r^{5} - \frac{11}{80} r^{4} - \frac{31259}{18144} r^{3} + \frac{1}{30}
r^{2} + \frac{13}{63} r\right)z^{5} + \left(-\frac{18684667}{3326400}
r^{11} + \frac{155581}{604800} r^{10} + \frac{597209}{36288} r^{9} -
\frac{1699}{2240} r^{8} - \frac{5513891}{302400} r^{7} +
\frac{23033}{28800} r^{6} + \frac{114685}{12096} r^{5} -
\frac{2669}{7560} r^{4} - \frac{519509}{226800} r^{3} + \frac{229}{4200}
r^{2} + \frac{281}{1386} r\right)z^{6} +
\left(\frac{401297449}{29652480} r^{13} - \frac{8914439}{10886400}
r^{12} - \frac{528153667}{11404800} r^{11} + \frac{30585833}{10886400}
r^{10} + \frac{4352347}{69120} r^{9} - \frac{13405099}{3628800} r^{8} -
\frac{44899771}{1036800} r^{7} + \frac{25156259}{10886400} r^{6} +
\frac{817639}{51840} r^{5} - \frac{1859441}{2721600} r^{4} -
\frac{339287}{118800} r^{3} + \frac{1433}{18900} r^{2} + \frac{85}{429}
r\right)z^{7} + \left(-\frac{448937586017}{13621608000} r^{15} +
\frac{545510843}{223534080} r^{14} + \frac{200873307991}{1556755200}
r^{13} - \frac{4578488741}{479001600} r^{12} -
\frac{41467078967}{199584000} r^{11} + \frac{653808103}{43545600} r^{10}
+ \frac{13531857077}{76204800} r^{9} - \frac{1224530857}{101606400}
r^{8} - \frac{4709184889}{54432000} r^{7} + \frac{56484901}{10886400}
r^{6} + \frac{119034073}{4989600} r^{5} - \frac{67641247}{59875200}
r^{4} - \frac{7752863023}{2270268000} r^{3} + \frac{1123657}{11642400}
r^{2} + \frac{9949}{51480} r\right)z^{8} +
\left(\frac{1067238963813721}{13173608448000} r^{17} -
\frac{4580572146421}{653837184000} r^{16} -
\frac{1868424788136953}{5230697472000} r^{15} +
\frac{1008805230793}{32691859200} r^{14} +
\frac{992904065416223}{1494484992000} r^{13} -
\frac{101113443793}{1796256000} r^{12} -
\frac{272962348105847}{402361344000} r^{11} +
\frac{25120947101}{457228800} r^{10} +
\frac{60592820342221}{146313216000} r^{9} -
\frac{141153688681}{4572288000} r^{8} -
\frac{4423647350867}{28740096000} r^{7} + \frac{7144205161}{718502400}
r^{6} + \frac{44170826140139}{1307674368000} r^{5} -
\frac{15354074077}{9081072000} r^{4} - \frac{36013858967}{9081072000}
r^{3} + \frac{48901}{420420} r^{2} + \frac{6871}{36465} r\right)z^{9} +
\left(-\frac{174424081161393493}{868893574348800} r^{19} +
\frac{740164886921567}{37661021798400} r^{18} +
\frac{525222462909510739}{533531142144000} r^{17} -
\frac{1509433069953143}{15692092416000} r^{16} -
\frac{32583814614724447}{15692092416000} r^{15} +
\frac{250692752979619}{1255367393280} r^{14} +
\frac{16579532320075783}{6725182464000} r^{13} -
\frac{829530467198351}{3621252096000} r^{12} -
\frac{4367664389322431}{2414168064000} r^{11} +
\frac{13899331735211}{87787929600} r^{10} +
\frac{2045747884459907}{2414168064000} r^{9} -
\frac{40609260170929}{603542016000} r^{8} -
\frac{423655761620591}{1681295616000} r^{7} +
\frac{40245068798999}{2353813862400} r^{6} +
\frac{29792663200381}{653837184000} r^{5} -
\frac{96567618673}{40864824000} r^{4} - \frac{115983959747}{25729704000}
r^{3} + \frac{6135329}{45405360} r^{2} + \frac{84883}{461890}
r\right)z^{10}
+ O(z^{11})
}
\begin{document}
looks good but I want the $\times$ to be an $=$:
\begin{dmath*}
A(z) \times \longformula
\end{dmath*}
looks bad to me:
\setbox0=\hbox{${}={}$}
\begin{dmath*}
A(z) \box0 \longformula
\end{dmath*}
\end{document}