我在群论中,刚刚定义了 A/B 组商,我想做同样的事情,但 A 在右上角,B 在左下角,这是我的代码:
\documentclass{article}
\usepackage{faktor}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
I'm defining something:
\begin{itemize}
\item[$-$]$\faktor{G}{H}:=\faktor{G}{\sim}=\text{ set definition}$
\item[$-$] what i want %something like B\A
\end{itemize}
\end{document}
答案1
我只是对源文件的定义做了一些修改(它足够短)。这提供了\mfaktor
实现您的目标的新命令。
\documentclass{article}
\usepackage{faktor}\usepackage{amsmath}\usepackage{amssymb}
\makeatletter
\DeclareRobustCommand*{\mfaktor}[3][]
{
{ \mathpalette{\mfaktor@impl@}{{#1}{#2}{#3}} }
}
\newcommand*{\mfaktor@impl@}[2]{\mfaktor@impl#1#2}
\newcommand*{\mfaktor@impl}[4]{
\settoheight{\faktor@zaehlerhoehe}{\ensuremath{#1#2{#3}}}%
\settoheight{\faktor@nennerhoehe}{\ensuremath{#1#2{#4}}}%
\raisebox{-0.5\faktor@zaehlerhoehe}{\ensuremath{#1#2{#3}}}%
\mkern-4mu\diagdown\mkern-5mu%
\raisebox{0.5\faktor@nennerhoehe}{\ensuremath{#1#2{#4}}}%
}
\makeatother
\begin{document}
I'm defining something: \begin{itemize} \item[$-$]$\faktor{G}{H}:=\faktor{G}{\sim}=\text{ set definition}$ \item[$-$] what i want something like B\ A \end{itemize}
$\mfaktor{B}{A}$
\end{document}
答案2
这个简单的解决方案怎么样?
我也用 替换:=
了\coloneqq
包mathtools
。
您可以根据需要调整字距。
\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{mathtools}
\begin{document}
With standard negative space as kerning:
\begin{itemize}[label=$-$]
\item $^{G}\!/\!_{H}\coloneqq {}^{G}\!/\!_{\sim} = \text{set definition}$
\item $_{B}\!\backslash\!^{A}$
\end{itemize}
With customized kerning (I think it's the best of the three):
\begin{itemize}[label=$-$]
\item $^{G}\mkern-2mu/\mkern-2mu_{H}\coloneqq {}^{G}\mkern-2mu/\mkern-2mu_{\sim} = \text{set definition}$
\item $_{B}\mkern-.5mu\backslash\mkern-2mu^{A}$
\end{itemize}
Without kerning adjustment:
\begin{itemize}[label=$-$]
\item $^{G}/_{H}\coloneqq {}^{G}/_{\sim} = \text{set definition}$
\item $_{B}\backslash^{A}$
\end{itemize}
\end{document}