# How do you superimpose two symbols over each other?

I want to superimpose two symbols, e.g. I want to superimpose \vee and \wedge and > and < symbols over each other (not above each other as in stackrel) and Q with a horizontal strike through like bar across it. I am using LyX 2.0.

\rlap and \llap can be used to print a symbol without a width. Similar, the mathtools package provides commands \mathrlap, \mathclap, \mathllap. These commands offer a quick way for overlapping symbols.

Example, overlapping \vee, \wedge and Q like desired in your question:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
$\mathrlap{\vee}\wedge$
\rlap{Q}---
\end{document}


While \rlap produces a zero-width box where the content sticks out to the right, \llap does the same but to the left. \mathclap centers to the current position.

\makeatletter
\newcommand{\superimpose}[2]{%
{\ooalign{$#1\@firstoftwo#2$\cr\hfil$#1\@secondoftwo#2$\hfil\cr}}}
\makeatother

\newcommand{\veewedge}{\mathpalette\superimpose{{\vee}{\wedge}}}
\newcommand{\lessgreater}{\mathpalette\superimpose{{<}{>}}}
\newcommand{\strikeQ}{\mathpalette\superimpose{{\text{---}}{Q}}}

$\veewedge_{\veewedge}\lessgreater_{\lessgreater}\strikeQ_{\strikeQ}$


The wider symbol must go first in the argument to \superimpose, which must consist of two braced objects. Of course \text requires amsmath.

If, say, \veewedge is to be considered as a relation symbol, the definition should be

\newcommand{\veewedge}{\mathrel{\mathpalette\superimpose{{\vee}{\wedge}}}}

• @Mankka You could indeed use \newcommand*{\superimpose}[2]{...} in order to have a check for no end of paragraph in the argument. But as the macro is used as an auxiliary for defining other macros, it's not really important. For parameterless macros, * or no * makes no essential difference. Aug 20, 2020 at 15:32
• @Mankka I think you want the symbol to be a relation symbol, so \newcommand{\at}{\mathrel{\mathpalette\superimpose{{\diamond}{|}}}} should do. Aug 21, 2020 at 9:57
• @Mankka I disagree. Anyway, I see no misalignment with 1mu at either side. Aug 21, 2020 at 12:20