这真让我抓狂。
我想在 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}
这将 lstlisting 放在中心,但不是它的标题,它向右。如果我取出表格,则标题居中,但代码向左!:(
谢谢你。