答案1
用更粗的线条绘制一个正方形,其大小与 相同\square
:
\documentclass{article}
\usepackage{amsmath,amssymb}
\makeatletter
\newcommand{\dalembertian}{\mathop{\mathpalette\dalembertian@\relax}}
\newcommand{\dalembertian@}[2]{%
\begingroup
\sbox\z@{$\m@th#1\square$}%
\dimen0=\fontdimen8
\ifx#1\displaystyle\textfont\else
\ifx#1\textstyle\textfont\else
\ifx#1\scriptstyle\scriptfont\else
\scriptscriptfont\fi\fi\fi3
\makebox[\wd\z@]{%
\hbox to \ht\z@{%
\vrule width \dimen0
\kern-\dimen0
\vbox to \ht\z@{
\hrule height \dimen0 width \ht\z@
\vss
\hrule height 2\dimen0
}%
\kern-2.5\dimen0
\vrule width 2.5\dimen0
}%
}%
\endgroup
}
\makeatother
\begin{document}
$\dalembertian = \mathop{{}\Delta}-\partial_0^2$
$\scriptstyle\dalembertian = \mathop{{}\Delta}-\partial_0^2$
$\scriptscriptstyle\dalembertian = \mathop{{}\Delta}-\partial_0^2$
{\Large$\dalembertian = \mathop{{}\Delta}-\partial_0^2$}
\end{document}
答案2
答案3
只需使用\rule
s。然后,\scalerel
使其与 的高度相匹配\Delta
。
\documentclass{article}
\usepackage{stackengine,scalerel}
\newcommand\dAlaux{%
\Shortstack{\rule{12pt}{.6pt}\\
\rule{.6pt}{10pt}\kern10pt\rule{1.4pt}{10pt}\\
\rule{12pt}{1.4pt}}%
}
\newcommand\dAl{%
\setstackgap{S}{0pt}%
\setstackEOL{\\}%
\scalerel*{\kern1pt\dAlaux\kern1pt}{\Delta}%
}
\begin{document}
$\dAl = \Delta - \partial_0^2,\quad \phi\dAl\phi e^{\phi\dAl\phi}$
\end{document}
通过调整尺寸,可以得到稍微厚一点的版本\rule
……
\documentclass{article}
\usepackage{stackengine,scalerel}
\newcommand\dAlaux{%
\Shortstack{\rule{11pt}{.7pt}\\
\rule{.7pt}{9pt}\kern9pt\rule{1.3pt}{9pt}\\
\rule{11pt}{1.35pt}}%
}
\newcommand\dAl{%
\setstackgap{S}{0pt}%
\setstackEOL{\\}%
\scalerel*{\kern1pt\dAlaux\kern1pt}{\Delta}%
}
\begin{document}
$\dAl = \Delta - \partial_0^2,\quad \phi\dAl\phi e^{\phi\dAl\phi}$
\end{document}
答案4
scalebox
这是使用和重叠的三个副本的版本\square
,以便可以调整厚度。可以通过增加或减少第二个参数来更改厚度\add@dalemb
。
例如,使用03
和06
:
以及05
和10
:
如果比这更厚的话,\add@dalemb
就需要另一种方法来避免 s 之间的空白\square
。
\documentclass[a4paper,12pt]{article}
\usepackage{amssymb}
\usepackage{graphicx}
\makeatletter
\DeclareRobustCommand\dalemb{\mathpalette\inner@dalemb{}}
\def\inner@dalemb#1{%
\add@dalemb#1{03}%
\add@dalemb#1{06}%
\square
}
\def\add@dalemb#1#2{%
\sbox0{\scalebox{1.#2}{$#1\square$}}%
\rlap{\lower0.#2\ht0\box0}%
}
\makeatother
\begin{document}
\[ \Delta\dalemb \]
\[ \partial^{\Delta\dalemb} \]
\[ \partial^{\partial^{\Delta\dalemb}} \]
\end{document}