这让我疯狂。Centre Latex lstlisting
我想在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但不是它的标题,即转到正确的。如果我拿出表格,那么标题会居中,但代码会在左边! :(
谢谢。
只是想我会提[乳胶StackExchange建议(http://area51.stackexchange.com/proposals/2148/tex-latex-and-朋友?referrer = 5z6F4dAmVScN5QfMOt5KEg2),因为一旦起飞,它将成为这类问题的最佳场所。 – 2010-06-24 01:25:29