我想在一个图中将列表放在示意图旁边。我撰写文章的期刊模板建议使用子浮点数。
这是我的乳胶源代码,
\lstset{
numbers=left,
firstnumber=1,
numberfirstline=true
numbers=left,% display line numbers on the left side
numberstyle=\scriptsize,% use small line numbers
numbersep=10pt,% space between line numbers and code
breaklines=true,% automatic line breaking
columns=flexible,
frame=tb,
mathescape=true,
xleftmargin=2em,
framexleftmargin=2em,
morekeywords={input, output, clb, pinlist, subblock, tcon, parameter}
}
\newsavebox{\tconlist}
\begin{lrbox}{\tconlist}% Store first listing
\small
\begin{lstlisting}
.parameter $sel_0$
.parameter $sel_1$
.input i0
pinlist: i0p
.input i1
pinlist: i1p
.input o0
pinlist: o0p
.output o1
pinlist: o1p
.tcon i0p o0p $\neg sel_0$
.tcon i0p o1p $\neg sel_1$
.tcon i1p o0p $sel_0$
.tcon i1p o1p $sel_1$
\end{lstlisting}
\end{minipage}
\end{lrbox}
\begin{figure}
\subfloat{\usebox{\tconlist}}
\hfill
\subfloat{\includegraphics[width=0.25\textwidth, trim = 60mm 80mm 145mm 35mm, clip]{2x2crossbar_schema}}
\caption{A schematic of a $2{\times}2$~crossbar switch functionality represented by 4 TCONs and the corresponding TCON netlist}
\label{fig:2x2crossbar}
\end{figure}
结果如下图所示,
我怎样才能将两个浮点数对齐到页面顶部?
答案1
默认情况下,minipage
s 垂直居中。也就是说,它们的锚点位于 的上/下半部分minipage
。由于您将 放在lstlisting
内部minipage
,因此将其锚定在中间是合理的。
您正在寻找的是[t]
op 或[b]
ottom-aligned minipage
:
\newsavebox{\tconlist}
\begin{lrbox}{\tconlist}% Store first listing
\small\begin{minipage}[b]{<len>}% Perhaps also try [t]
\begin{lstlisting}
%...
\end{lstlisting}
\end{minipage}
\end{lrbox}