有没有办法获得相似的\hourglass
(⧖) 和\lozengeminus
(⟠) 符号,即具有相同的三角形?
同时具有fdsymbol
和stix
包,\lozengeminus
比大得多\hourglass
。
目标是获得两个“相反”的运算符,即下上三角形和上下三角形,即通过交换三角形获得第二个运算符。
答案1
也许你可以将 定义tikzpicture
为命令。然后你就可以控制要创建的两个符号的大小。
\documentclass{article}
\usepackage{tikz}
\newcommand{\hour}[1]{%
\begin{tikzpicture}
\draw (0,0) -- (6pt,0) -- (0,12pt) -- (6pt,12pt) -- (0,0);
\end{tikzpicture}
}
\newcommand{\loz}[1]{%
\begin{tikzpicture}
\draw (0,6pt) -- (3pt,12pt) -- (6pt,6pt);
\draw (0,6pt) -- (6pt,6pt);
\draw (0,6pt) -- (3pt,0) -- (6pt,6pt);
\end{tikzpicture}
}
\begin{document}
This is an example of \hour.
This is an example of \loz.
\end{document}
这些具体定义如下:
答案2
答案3
另一个版本具有picture
随数学样式缩放的模式。根据您的喜好修改宽度/高度(显示宽度设置为 0.33333em)。
\documentclass{article}
\usepackage{amsmath}
\usepackage{pict2e}
\makeatletter
\newcommand{\lozengeminus}{%
\mathbin{% a binary operation symbol
\mspace{1mu}% some sidebearing
\mathpalette\vinc@lozengeminus\relax}% the symbol
\mspace{1mu}% some sidebearing
}
\newcommand{\vinc@lozengeminus}[2]{%
\begingroup
\settowidth{\unitlength}{$\m@th#1\mspace{6mu}$}% 1/3 of an em
\begin{picture}(1,1.732)
\vinc@linethickness{#1}
\roundcap\roundjoin
\Line(0.5,0)(1,0.866)(0.5,1.732)(0,0.866)(0.5,0)
\Line(0,0.866)(1,0.866)
\end{picture}%
\endgroup
}
\newcommand{\hourglass}{%
\mathbin{% a binary operation symbol
\mspace{1mu}% some sidebearing
\mathpalette\vinc@hourglass\relax}% the symbol
\mspace{1mu}% some sidebearing
}
\newcommand{\vinc@hourglass}[2]{%
\begingroup
\settowidth{\unitlength}{$\m@th#1\mspace{6mu}$}% 1/3 of an em
\begin{picture}(1,1.732)
\vinc@linethickness{#1}
\roundcap\roundjoin
\Line(0,0)(1,1.732)(0,1.732)(1,0)(0,0)
\end{picture}%
\endgroup
}
\newcommand{\vinc@linethickness}[1]{%
\linethickness{%
\ifx#1\displaystyle 0.8\fontdimen8\textfont3\else
\ifx#1\textstyle 0.8\fontdimen8\textfont3\else
\ifx#1\scriptstyle0.8\fontdimen8\scriptfont3\else
1\fontdimen8\scriptscriptfont3\fi\fi\fi
}%
}
\makeatother
\begin{document}
$x+a\lozengeminus b$
$\scriptstyle x+a\lozengeminus b$
$\scriptscriptstyle x+a\lozengeminus b$
$x+a\hourglass b$
$\scriptstyle x+a\hourglass b$
$\scriptscriptstyle x+a\hourglass b$
\end{document}
答案4
包裹oplotsymbl
中提供的\rhombuslineh
东西可能接近您想要的东西。
\documentclass{article}
\usepackage{stix}
\usepackage{oplotsymbl}
\begin{document}
$\hourglass \rhombuslineh$
\end{document}