如何从我的 lstlistings 代码中删除“Listing 1”?

如何从我的 lstlistings 代码中删除“Listing 1”?

这是我的乳胶代码:

\documentclass[12pt]{article}
\usepackage{listings}

\begin{document}
\begin{lstlisting}[caption=Figure 3]
      Source |       SS       df       MS              Number of obs =     198
-------------+------------------------------           F(  3,   194) =    0.62
       Model |  2.71676158     3  .905587193           Prob > F      =  0.6030
    Residual |  283.499771   194  1.46133902           R-squared     =  0.0095
-------------+------------------------------           Adj R-squared = -0.0058
       Total |  286.216532   197   1.4528758           Root MSE      =  1.2089

------------------------------------------------------------------------------
squared_re~s |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     locati  |   .0029432   .0148768     0.20   0.843    -.0263978    .0322841
density      |  -.0731895   .1233527    -0.59   0.554    -.3164739    .1700949
strike_price |  -.0157999   .0161732    -0.98   0.330    -.0476978     .016098
       _cons |   1.742112   .7439907     2.34   0.020     .2747632    3.209461
------------------------------------------------------------------------------
\end{lstlisting}

\end{document}

当我编译它时,它显示“清单 1:图 3”。我该如何删除它?如果这是一个基本问题,我很抱歉,但这很紧急。谢谢。

答案1

将“caption”替换为“title”。

\documentclass[12pt]{article}
\usepackage{listings}

\begin{document}
\begin{lstlisting}[title=Figure 3]
      Source |       SS       df       MS              Number of obs =     198
-------------+------------------------------           F(  3,   194) =    0.62
       Model |  2.71676158     3  .905587193           Prob > F      =  0.6030
    Residual |  283.499771   194  1.46133902           R-squared     =  0.0095
-------------+------------------------------           Adj R-squared = -0.0058
       Total |  286.216532   197   1.4528758           Root MSE      =  1.2089

------------------------------------------------------------------------------
squared_re~s |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     locati  |   .0029432   .0148768     0.20   0.843    -.0263978    .0322841
density      |  -.0731895   .1233527    -0.59   0.554    -.3164739    .1700949
strike_price |  -.0157999   .0161732    -0.98   0.330    -.0476978     .016098
       _cons |   1.742112   .7439907     2.34   0.020     .2747632    3.209461
------------------------------------------------------------------------------
\end{lstlisting}

\end{document}

相关内容