[Tex/LaTex] overlay symbols

stacking-symbolssymbols

I would like to overload some symbols. Basically they would take no space so

\symbol1\symbol2\symbol3

would exist on the page in the same position as either one of the symbols.

Ideally I'd like position/offset to them relative to the first but I don't wanna go through a bunch of trouble to do so. (not setup a tikz environment just to draw a few unique symbols)

Note that I want the symbols to overlap.

e.g.,

\ and / would create an x like symbol, etc.

Because the symbols might not align perfectly the way I would like, I will probably need to position them slightly.

Best Answer

EDITED to condense the syntax.

Here I provide \mo[<alignment>]{<symbol list>}. I have set it up to use a space as a symbol list separator (though note that a macro as a symbol will require a trailing {} in order for the subsequent space to be recognized). Alignment can be l, c, or r (default c).

The macros X{<horizontal shift in ex>} and \Y{<vertical shift in ex>}{} are also provided.

BY POPULAR DEMAND, additional macros are provided: \FH[<scale>]{<symbol>} for horizontal flipping, \FV[<scale>]{<symbol>} for vertical flipping in the same footprint as the original glyph, \R{<angle>}{<symbol>} for rotating the symbol about its center, and \SC{<scale>}{<symbol>} for scaling a symbol. The 2nd and 4th lines of the output demonstrate these new capabilities.

\documentclass{article}
\usepackage{stackengine,graphicx}
\newcommand\X[1]{\kern#1ex}
\newcommand\Y[2]{\raisebox{#1ex}{#2}}
\newcommand\FH[2][1]{\scalebox{-#1}[#1]{#2}}
\newcommand\FV[2][1]{\R{180}{\FH[#1]{#2}}}
\newcommand\R[2]{\rotatebox[origin=c]{#1}{#2}}
\newcommand\SC[2]{\scalebox{#1}{#2}}
\newcommand\mo[2][c]{%
  \bgroup%
  \setstackEOL{ }% 
  \setstackgap{L}{0pt}%
  \Longstack[#1]{#2}%
  \egroup%
}
\begin{document}
\newcommand\sd{\makebox[1pt]{.}}
\def\tmp{
\mo{/ \textbackslash}
\mo{O \sffamily I \Y{.23}{$-$}}
\mo[l]{$|$ \X{.21}=}
\mo{$-$ )\X{.1} \X{.1}(}
\mo{. \Y{.1}{\sd\X{.2}\sd} \Y{.4}{\sd\X{.4}\sd} \Y{.9}{\sd\X{.6}\sd} \Y{1.6}{\sd\X{.8}\sd}}

\mo{\FH{b} b}
\mo{\FH[.7]{b} \SC{.7}{b}}
\mo{\R{45}{b} \R{-45}{\FH{b}}}
\mo{Q \FV{Q}}
\mo{\R{90}{j} \FV{j}}}
\tmp\par\LARGE\tmp
\end{document}

enter image description here