Set the symbol horizontally \square (and more closer) using mtpro2
You can create your own square symbol with a definable size very easily by using \fbox
, you can adjust it to your liking by changing the \fboxrule
thickness and the size of the \phantom
ed \rule
.
With this definition the size of the symbol doesn't change in sub or super script.
\documentclass[]{article}
\newlength\mysquaresize
\newcommand\mysquare
{%
\begingroup
\fboxrule=.12ex
\mysquaresize=1ex
\fboxsep=-\fboxrule
\vcenter{\hbox{\fbox{\phantom{\rule{\mysquaresize}{\mysquaresize}}}}}%
\endgroup
}
\begin{document}
\[
L'=L+\mu_{0}\mysquare\cdot (fX)
\]
\end{document}
A version in which you can also define sizes in the different math modes:
\documentclass[border=3.14,11pt]{standalone}
\newlength\mysquaresize
\newcommand\mysquare
{%
\mathchoice
{\mysquareaux{.12ex}{1ex}}
{\mysquareaux{.12ex}{1ex}}
{\mysquareaux{.11ex}{.8ex}}
{\mysquareaux{.10ex}{.7ex}}%
}
\newcommand\mysquareaux[2]
{%
\begingroup
\fboxrule=#1
\mysquaresize=#2
\fboxsep=-\fboxrule
\vcenter{\hbox{\fbox{\phantom{\rule{\mysquaresize}{\mysquaresize}}}}}%
\endgroup
}
\begin{document}
$
\displaystyle
L'=L+\mu_{0}\mysquare\cdot (fX)
$
\end{document}
You can import a symbol from another font. But the space after the square is not triggered by the square but by the binary symbol. If you would change the definition of \square to suppress this space it would give bad results if ordinary symbols are after the square:
\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{newtxtext}
\usepackage[lite]{mtpro2}
\DeclareSymbolFont{AMSm}{U}{ntxsym}{m}{n}
\DeclareMathSymbol{\ntxsquare} {\mathord}{AMSm}{131}
\begin{document}
\[
L'=L+\mu_{0}\ntxsquare\cdot (fX)
\]
\[
L'=L+\mu_{0}\ntxsquare\mathpunct{\cdot} (fX)
\]
\[
L'=L+\mu_{0}\ntxsquare\!\cdot (fX)
\]
\[
L'=L+\mu_{0}\ntxsquare\! x (fX) %bad
\]
\end{document}
Maybe just writing {\cdot}
rather than \cdot
gives you the desired spacing. I don't have mtpro2
, so this is with your original code:
\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{newtxtext}
\usepackage{newtxmath}
\begin{document}
\[
L'=L+\mu_{0}\square{\cdot} (fX)
\]
\end{document}