我试图将 3 个小页面并排放置,但由于 n=8 的文本太宽,它将移到下一行。我该如何解决这个问题,使它们并排放置,并全部“向上”对齐,这样 n=6、n=7 和 n=8 都在同一行上?以下是 latex 代码
\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}
答案1
有一个错误和 3 个遗漏。错误是第二行后有一个空白行,minpage
因此插入了段落分隔符。遗漏是[t]
所有 3 个minipage
行上的可选参数,以实现顶部对齐。
\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}