4

I am trying to create a table of two columns and in each column I would have two matrices aligned by the equal sign. But every time I try to compile I get the same error.

Here is my mwe:

\documentclass[10pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{array}
\usepackage{enumitem}
\usepackage[mathscr]{euscript}
\let\euscr\mathscr \let\mathscr\relax% just so we can load this and rsfs
\usepackage[scr]{rsfso}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}

% <========Start defined commands===========>
\newcommand{\Tdot}{\ensuremath{\dot{T}}}
\newcommand{\tdot}{\ensuremath{\dot{t}}}
\newcommand{\lambdadot}{\ensuremath{\dot{\lambda}}}
\newcommand{\varnothingdot}{\ensuremath{\dot{\varnothing}}}
\newcommand{\stardot}{\ensuremath{\dot{\star}}}
\newcommand{\plusdot}{\ensuremath{\dot{+}}}
\newcommand{\dotdot}{\ensuremath{\dot{\bullet}}}
\newcommand{\st}{\ensuremath{\ | \ }}
\newcommand{\re}{\ensuremath{RegExp }}
\newcommand{\pre}{\ensuremath{PrimRegExp }}
% <========End defined commands===========>

\section{Test 1 Review}

\section{Test 2 Review}
\subsection{Definitions}
% <========Start the definitions===========>
\begin{itemize}[label={-}]
    \item \textbf{Rules for Operations}
        \begin{enumerate}
            \item Every \pre \ is declared as \re. 
            \item $If \alpha, \beta \in \re \ then$\\ \\
                \begin{tabular}{cc}
                        \begin{align*}
                            \alpha \plusdot \beta = \alpha \cdot \langle \plusdot \rangle \cdot \beta \\
                            \alpha \dotdot \beta = \alpha \cdot \langle \plusdot \rangle \cdot \beta \\
                            \alpha^{\stardot} = \alpha \cdot \langle \stardot \rangle \\
                        \end{align*}
                        & 
                        \begin{align*}
                            lh(\alpha \cdot \langle \plusdot \rangle \cdot \beta) = lh(\alpha) + 1 + lh(\beta) \\ 
                            lh(\alpha \cdot \langle \dotdot \rangle \cdot \beta) = lh(\alpha) + 1 + lh(\beta) \\ 
                            lh(\alpha \cdot \langle \stardot \rangle) = lh(\alpha) + 
                        \end{align*} \\
                \end{tabular}
        \end{enumerate}

\end{itemize} 
% <========End the definitions===========>
\end{document}
5

align* tries to create a displayed equation, which is not correct inside a tabular. Use $\begin{aligned}...\end{aligned}$ instead:

            \begin{tabular}{cc}
                    $\begin{aligned}
                        \alpha \plusdot \beta = \alpha \cdot \langle \plusdot \rangle \cdot \beta \\
                        \alpha \dotdot \beta = \alpha \cdot \langle \plusdot \rangle \cdot \beta \\
                        \alpha^{\stardot} = \alpha \cdot \langle \stardot \rangle \\
                    \end{aligned}$
                    & 
                    $\begin{aligned}
                        lh(\alpha \cdot \langle \plusdot \rangle \cdot \beta) = lh(\alpha) + 1 + lh(\beta) \\ 
                        lh(\alpha \cdot \langle \dotdot \rangle \cdot \beta) = lh(\alpha) + 1 + lh(\beta) \\ 
                        lh(\alpha \cdot \langle \stardot \rangle) = lh(\alpha) + 
                    \end{aligned}$
            \end{tabular}
|improve this answer|||||
  • Thanks a lot for the answer @Boris This is exactly what I was looking for. – user128193 Mar 21 '17 at 6:36
3

There is no need for align within the tabular. Inside, just list the content in another array:

enter image description here

\documentclass{article}

\usepackage{amsmath,enumitem}

\newcommand{\stardot}{\mathbin{\dot{\star}}}
\newcommand{\plusdot}{\mathbin{\dot{+}}}
\newcommand{\dotdot}{\mathbin{\dot{\bullet}}}
\newcommand{\re}{\text{RegExp}}
\newcommand{\pre}{\text{PrimRegExp}}

\begin{document}

\section{Test 1 Review}

\section{Test 2 Review}
\subsection{Definitions}

\begin{itemize}[label={-}]
  \item \textbf{Rules for Operations}
    \begin{enumerate}
      \item Every \pre \ is declared as \re. 
      \item If $\alpha, \beta \in \re$ then \\ \\
        \begin{tabular}{cc}
          $\begin{array}{c}
            \alpha \plusdot \beta = \alpha \cdot \langle \plusdot \rangle \cdot \beta \\
            \alpha \dotdot \beta = \alpha \cdot \langle \plusdot \rangle \cdot \beta \\
            \alpha^{\stardot} = \alpha \cdot \langle \stardot \rangle
          \end{array}$
          & 
          $\begin{array}{c}
            lh(\alpha \cdot \langle \plusdot \rangle \cdot \beta) = lh(\alpha) + 1 + lh(\beta) \\ 
            lh(\alpha \cdot \langle \dotdot \rangle \cdot \beta) = lh(\alpha) + 1 + lh(\beta) \\ 
            lh(\alpha \cdot \langle \stardot \rangle) = lh(\alpha) + 1 + lh(\beta)
          \end{array}$
        \end{tabular}
    \end{enumerate}

\end{itemize}

\end{document}

I've made some suggestions to your definitions.

|improve this answer|||||
2

Maybe you like to have something like this:

enter image description here

Since table contain only equations, it is sensible to write it as array in displaymath environment:

\documentclass[10pt,letterpaper]{article}
\usepackage{mathtools}
\usepackage{enumitem}

\usepackage{lipsum} % for dummy text

\newcommand{\stardot}{\mathbin{\dot{\star}}}
\newcommand{\plusdot}{\mathbin{\dot{+}}}
\newcommand{\dotdot}{\mathbin{\dot{\bullet}}}
\newcommand{\re}{\text{RegExp}}
\newcommand{\pre}{\text{PrimRegExp}}

\begin{document}
\lipsum*[11]
    \begin{itemize}[label={-}]
\item \textbf{Rules for Operations}
    \begin{enumerate}
\item   Every \pre \ is declared as \re.
\item   If $\alpha, \beta \in \re$ then 
    \[\setlength\arraycolsep{1pt}
    \begin{array}{rl c rl}
    \alpha \plusdot \beta   & = \alpha \cdot \langle \plusdot \rangle \cdot \beta 
        & \quad & 
    lh(\alpha \cdot \langle \plusdot \rangle \cdot \beta) 
                    & = lh(\alpha) + 1 + lh(\beta)              \\
    \alpha \dotdot \beta    & = \alpha \cdot \langle \plusdot \rangle \cdot \beta 
        & \quad &
    lh(\alpha \cdot \langle \dotdot \rangle \cdot \beta) 
                            & = lh(\alpha) + 1 + lh(\beta)      \\
    \alpha^{\stardot}       & = \alpha \cdot \langle \stardot \rangle
        & \quad &
    lh(\alpha \cdot \langle \stardot \rangle) 
                            & = lh(\alpha) + 1 + lh(\beta)
          \end{array}
    \]
    \end{enumerate}
\end{itemize}
\end{document}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy