这真让我抓狂.
我想把一个名单集中在LaTeX中.
3小时后尝试这里的一些代码:
\lstset{ %
caption=Descriptive Caption Text,
label=lst:descr_capti_text,
basicstyle=\ttfamily\footnotesize\bfseries,
frame=tb,
linewidth=0.6\textwidth
}
\centering\begin{tabular}{c}
\begin{lstlisting}
printf("this should be centered!");
\end{lstlisting}
\end{tabular}
Run Code Online (Sandbox Code Playgroud)
这是将赌注放在中心,而不是它的标题,这是右边的.如果我取出表格,那么标题会居中,但代码会向左移动!:(
谢谢.