如何正確裁切數學運算子?直接因子符號的命令?

如何正確裁切數學運算子?直接因子符號的命令?

如果這個問題已經得到解答,我很抱歉,但是 chatgpt 都沒有給我滿意的答案,也沒有在堆疊交換中找到我想要的東西。 我想知道是否有一種“規範”的方法來裁剪數學運算符以創建新的運算符

讓我更具體地告訴你我想要哪一個(顯然缺少)運算子:
我想要一個直接因子符號,這是一個減半的直和符號 ( \oplus)。我想保留左半部分,去掉右半部分。

有誰知道如何做到這一點?


這是 chatgpt 提供的內容:
\newcommand{\eplus}{\mathbin{\clipbox{0pt 0pt 0.5\width 0pt}{$\oplus$}}}

這已經很酷了,但是存在對齊問題並且發生錯誤: missing number, treated as zero

預先感謝您的幫忙!

PS:如果你知道一個處理這個符號的包,這也會讓我滿意:)!


這是(幾乎完整的文檔):(提前抱歉,我必須返回我的 cls 文檔,我希望它是按順序排列的):

\documentclass[a4paper,10pt]{article}


\usepackage[english]{babel}


\usepackage{graphicx}
\usepackage[utf8]{inputenc}  
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{enumitem} 

\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\@arabic\c@section}

\setitemize[1]{label=$\bullet$}
\setitemize[2]{label=-}
\setenumerate[0]{label=$(\roman*)$}

\usepackage{amsmath} 
\usepackage{stmaryrd}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{dsfont}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{faktor}
\usepackage{esint} 
\usepackage{mathdots}  
\usepackage{multirow}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

% A lot of things (essentially macros and environments + drawings things)

\usepackage{geometry}

\pagestyle{headings}
\\usepackage{caption}
\DeclareCaptionFormat{sanslabel}{#3}%


\usepackage{adjustbox}
\usepackage{multicol}

\newcommand{\eplus}{\mathbin{\clipbox{0pt 0pt 0.5\width 0pt}{$\oplus$}}}

\begin{document}

%blabla

\( A \eplus B\)

%blabla

\end{document}

答案1

首先:ChatGPT似乎提供合理的答案。但通常情況下,情況並非如此。

然而,\clipbox這確實是一個開始的事情。

您不應該以半寬進行剪輯,因為您會丟失大部分垂直條;接下來,您需要在右側添加一些側向。

係數 0.484 是透過一些嘗試「透過目視」計算出來的,顯然取決於數學字體。

\documentclass{article}
\usepackage{amsmath}
\usepackage{trimclip}

\makeatletter

\NewDocumentCommand{\eplus}{}{\mathbin{\mathpalette\eplus@\relax\mspace{1mu}}}

\newcommand{\eplus@}[2]{%
  \clipbox{0 0 {0.484\width} 0}{$\m@th#1\oplus$}%
}

\makeatother

\begin{document}

$A\eplus B$

$x_{A\eplus B}$

\end{document}

在此輸入影像描述

請注意 周圍的大括號0.484\width,否則會出現錯誤。

相關內容