I am trying to create two new macros:
braces: compiles some text between curly bracketssquakets: compiles text between two square brackets
I defined as follows.
\documentclass{article}
\newcommand{\braces}[2]{$\left\{\begin{tabular}{@{}c@{}}
#1\\
#2\\
\end{tabular}\right\}$}
\newcommand{\squakets}[1]{$\Big[ #1 \Big]$}
\begin{document}
\squakets{\squakets{\braces{$\sqrt{}$}{$\alpha$} \braces{$x$}{$\beta$}} \braces{$y$}{$\gamma$}} $\rightarrow$ \braces{$\sqrt{}$}{$\alpha$} -- \braces{$x$}{$\beta$} -- \braces{$y$}{$\gamma$}
\end{document}
Console still compiles, even though it warns me that:
Missing $ inserted.
I was curious of understanding how to fix this. I guess it is something related to the fact I am embedding multiple squakets command in one another, but can someone help figure that out?
squaces;o) – Bernard Jan 28 '18 at 01:22\ensuremath{..}rather than$..$. But still, if it's math, it should be in math mode, and not (ab)use\ensuremath. – Manuel Jan 28 '18 at 01:22$...$. You should either change them to\ensuremath{}or, preferably, remove them. Then use your macro inside math mode only. – Phelype Oleinik Jan 28 '18 at 01:24arrayinstead of tabular? – Bernard Jan 28 '18 at 01:24