[tex] place 2 images side by side

This commit is contained in:
Julin S 2024-02-21 10:57:47 +05:30
parent aadedfcc89
commit c2463a5eb4
2 changed files with 46 additions and 0 deletions

5
latex/README.org Normal file
View File

@ -0,0 +1,5 @@
- figs-side-by-side.tex: Place two figures side by side
- long-brackets.tex: Label a table with long braces spanning multiple rows
- nfa-rules.tex: Typing rules for an NFA
- misc.tex: Miscellaneous
+ Antimirov derivatives

View File

@ -0,0 +1,41 @@
\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}