# Vertical spacing problems with a custom math symbol in LaTeX

I need to have a few custom math symbols by adding different number of dots on top of the standard \preceq math symbol. So, I have done this as follows:

\newcommand{\orderC}{\stackrel{\therefore}{\preceq}}
\newcommand{\orderB}{\stackrel{..}{\preceq}}
\newcommand{\orderA}{\stackrel{.}{\preceq}}


Now, the problem is that \orderC occupies too much vertical space. In particular if I used it in an inline equation, that line will look way too much separated from the main paragraph. I was wondering if I am creating the symbols correctly and if there is a way to avoid this?

Thanks in advance,

## 3 Answers

I would use horizontal triple dot as defined in Gonzalo Medina's answer to another question, and stick with \dot and \ddot for the others:

\documentclass{article}

\usepackage{mathtools}

\usepackage{lipsum} % only for demonstration purposes

\makeatletter
\newcommand*\scaleddot{\scalebox{.9}{.}}
\renewcommand*\dddot[1]{%
{\mathop{\kern\z@#1}\limits^{\makebox[0pt][c]{\vbox to-2.2\ex@{\kern-\tw@\ex@
\hbox{\normalfont\scaleddot\kern-0.5pt\scaleddot\kern-0.5pt\scaleddot}\vss}}}}}
\makeatother

\newcommand*\preceqdot{\mathrel{\dot{\preceq}}}
\newcommand*\preceqddot{\mathrel{\ddot{\preceq}}}
\newcommand*\preceqdddot{\mathrel{\dddot{\preceq}}}

\begin{document}

\lipsum[3]
$A \preceq B \preceqdot C \preceqddot D \preceqdddot E$
\lipsum[2]

\end{document}


However, I think that distinction between those three is too small, and both the author and the reader can confuse themselves easily. Couldn't you use another symbol, e.g. \trianglelefteq ?

• I'm not sure about redefining \dddot; why should you do it? If you want smaller dots for this case, just define a new command for them. – egreg Feb 10 '14 at 9:58

You can use the curve of \preceq for putting the dots in.

\documentclass{article}

\usepackage{lipsum} % just for the example

\newcommand\preceqdots[1]{%
\mathrel{
\vbox{\offinterlineskip
\ialign{##\cr
#1\crcr
\noalign{\vskip-.2ex}
$\preceq$\cr
}
}
}
}
\newcommand{\threedots}{%
\hidewidth..\hidewidth\kern.1em\cr
\hidewidth.\hidewidth\kern.1em\cr
\noalign{\vskip-\fontcharht\font.}
}

\newcommand\preceqdot{\preceqdots{\hidewidth.\hidewidth\kern.1em}}
\newcommand\preceqddot{\preceqdots{\hidewidth..\hidewidth\kern.1em}}
\newcommand\preceqdddot{\preceqdots{\threedots}}

\begin{document}
\lipsum*[3]%
$A \preceq B \preceqdot C \preceqddot D \preceqdddot E$
\lipsum[2]

\end{document}


Less typing in the definitions with stacks:

\documentclass{article}
\usepackage{stackengine}
\usepackage[nopar]{lipsum}
\renewcommand\stacktype{L}
\stackMath
\def\preceqdot{\mathrel{\stackon[0pt]{\preceq}{\dot{}}}}
\def\preceqddot{\mathrel{\stackon[0pt]{\preceq}{\ddot{}}}}
\def\preceqdddot{\mathrel{\stackon[0pt]{\stackon[-1pt]{\preceq}{\dot{}}}{\ddot{}}}}
\def\preceqdddotALT{\mathrel{\stackon[0pt]{\stackon[0pt]{\stackon[0pt]{%
\preceq}{\dot{}}}{\kern3pt\dot{}}}{\kern-3pt\dot{}}}}
\begin{document}
\lipsum[1]
$A \preceq B \preceqdot C \preceqddot D \preceqdddot E \preceqdddotALT F$
\lipsum[2]
\end{document}
`