playground/latex/figs-side-by-side.tex

42 lines
1.4 KiB
TeX

\documentclass{article}
\usepackage{mathpartir}
\begin{document}
% NOTE: The figure captions probably doesn't line up if height of figures are
% different. subfig package might be of help in such a scenario.
% https://tex.stackexchange.com/questions/282869/putting-two-figures-side-by-side
\begin{figure}
\begin{minipage}[c]{0.5\linewidth}
\begin{mathpar}
\begin{array}{rcll}
r & := & \O & \ \ (Empty \ language) \\
& | & \varepsilon & \ \ (Empty \ string) \\
& | & b & \ \ (Atom) \\
& | & r ; r & \ \ (Concatenation) \\
& | & r + r & \ \ (Choice) \\
& | & r* & \ \ (Kleene \ star) \\
\end{array}
\end{mathpar}
\caption{Regular expression syntax}
\label{fig:re-syntax}
\end{minipage}
\hfill
\begin{minipage}[c]{0.4\linewidth}
\begin{mathpar}
\begin{array}{rcl}
L(\O) & = & \{ \} \\
L(\varepsilon) & = & \{\varepsilon\} \\
L(c) & = & \{c\} \\
L(r_1; r_2) & = & L(r_1); L(r_2) \\
L(r_1 + r_2) & = & L(r_1) \ \cup \ L(r_2) \\
L(r*) & = & \{\varepsilon\} \ \cup \ L(r; r*) \\
\end{array}
\end{mathpar}
\caption{Regular languages}
\label{fig:re-lang}
\end{minipage}%
\end{figure}
\end{document}