2

I am trying to put 3 minipages right next to each other, but since the text for n=8 is so wide, it is going to the next line. How would I fix this so that they are all side by side, and they all align "topwise", so that the n=6, n=7 and n=8 are all on the same line? Here is the latex code

\begin{figure}[h]
    \centering
\begin{minipage}{.3\textwidth}
    \centering
   \begin{flalign} 
   &\textrm{\underline{$n=6$}} \nonumber \\
   &000000111111 \nonumber \\
   &010100101011 \nonumber \\
   &010000101111 \nonumber \\
   &0011 \nonumber \\
   &001000110111 \nonumber \\
   &000100111011 \nonumber 
   \end{flalign}   
\end{minipage}%
\begin{minipage}{0.3\textwidth}
    \centering 
\begin{flalign}
   &\textrm{\underline{$n=7$}} \nonumber \\
   &00000001111111 \nonumber \\
   &01 \nonumber \\
   &01010001010111 \nonumber \\
   &01000001011111 \nonumber \\
   &00110001100111 \nonumber \\
   &00101001101011 \nonumber \\
   &00100001101111 \nonumber \\
   &00010001110111 \nonumber \\
   &00001001111011 \nonumber \\
   &01001001011011 \nonumber 
\end{flalign}
\end{minipage}%

\begin{minipage}{0.3\textwidth}
    \centering
    \begin{flalign}
   &\textrm{\underline{$n=8$}} \nonumber \\
   &0000000011111111 \nonumber \\
   &0101010010101011 \nonumber \\
   &0101000010101111 \nonumber \\
   &0100100010110111 \nonumber \\
   &0100000010111111 \nonumber \\
   &0011100011000111 \nonumber \\
   &0011010011001011 \nonumber \\
   &0011000011001111 \nonumber \\
   &0010100011010111 \nonumber \\
   &0010000011011111 \nonumber \\
   &0001010011101011 \nonumber \\
   &0001000011101111 \nonumber \\
   &0000100011110111 \nonumber \\
   &0000010011111011 \nonumber \\
   &0100010010111011 \nonumber \\
   &0010010011011011 \nonumber 
   \end{flalign}

    \end{minipage}
    \label{fig:prob3}
    \caption{Decomposition of Huang's de Bruijn sequence}
\end{figure}

Valid XHTML

6

There was an error and 3 omissions. The error was a blank line after the second minpage which inserted therefore a paragraph break. The omission was the [t] optional argument on all 3 minipages to get top alignment.

\documentclass{article}
%\usepackage[margin=5.5cm]{geometry}
\usepackage{amsmath}
\begin{document}
\begin{figure}[h]
    \centering
\begin{minipage}[t]{.3\textwidth}
    \centering
   \begin{flalign} 
   &\textrm{\underline{$n=6$}} \nonumber \\
   &000000111111 \nonumber \\
   &010100101011 \nonumber \\
   &010000101111 \nonumber \\
   &0011 \nonumber \\
   &001000110111 \nonumber \\
   &000100111011 \nonumber 
   \end{flalign}   
\end{minipage}%
\begin{minipage}[t]{0.3\textwidth}
    \centering 
\begin{flalign}
   &\textrm{\underline{$n=7$}} \nonumber \\
   &00000001111111 \nonumber \\
   &01 \nonumber \\
   &01010001010111 \nonumber \\
   &01000001011111 \nonumber \\
   &00110001100111 \nonumber \\
   &00101001101011 \nonumber \\
   &00100001101111 \nonumber \\
   &00010001110111 \nonumber \\
   &00001001111011 \nonumber \\
   &01001001011011 \nonumber 
\end{flalign}
\end{minipage}%
\begin{minipage}[t]{0.3\textwidth}
    \centering
    \begin{flalign}
   &\textrm{\underline{$n=8$}} \nonumber \\
   &0000000011111111 \nonumber \\
   &0101010010101011 \nonumber \\
   &0101000010101111 \nonumber \\
   &0100100010110111 \nonumber \\
   &0100000010111111 \nonumber \\
   &0011100011000111 \nonumber \\
   &0011010011001011 \nonumber \\
   &0011000011001111 \nonumber \\
   &0010100011010111 \nonumber \\
   &0010000011011111 \nonumber \\
   &0001010011101011 \nonumber \\
   &0001000011101111 \nonumber \\
   &0000100011110111 \nonumber \\
   &0000010011111011 \nonumber \\
   &0100010010111011 \nonumber \\
   &0010010011011011 \nonumber 
   \end{flalign}

    \end{minipage}
    \label{fig:prob3}
    \caption{Decomposition of Huang's de Bruijn sequence}
\end{figure}
\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.