.png)
Estou com o problema que LaTeX
não mostra o List of figures
and List of Listings
. Não sei onde está o problema.
Estou trabalhando com TeXstudio e o código foi definido da seguinte forma:
\usepackage{acl2013}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{times}
\usepackage{url}
\usepackage{latexsym}
\usepackage{listings}
\usepackage{color}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\caption{That is a pic}
\label{fig: That is a pic}
\end{figure}
\listoffigures
\lstlistoflistings
\end{document}
Ambas as listas permanecem vazias. Alguém pode me dizer qual é o problema??
EDIT: Esse é o conteúdo da minha lista de arquivos:
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
acl2013.sty
inputenc.sty 2008/03/30 v1.1d Input encoding file
utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
babel.sty 2008/07/08 v3.8m The Babel package
bblopts.cfg 2006/07/31 v1.0 MiKTeX 'babel' configuration
english.ldf 2012/08/20 v3.3p English support from the babel system
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
times.sty 2005/04/12 PSNFSS-v9.2a (SPQR)
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
latexsym.sty 1998/08/17 v2.2e Standard LaTeX package (lasy symbols)
listings.sty 2015/06/04 1.6 (Carsten Heinz)
lstmisc.sty 2015/06/04 1.6 (Carsten Heinz)
listings.cfg 2015/06/04 1.6 listings configuration
caption.sty 2015/09/17 v3.3-111 Customizing captions (AR)
caption3.sty 2015/09/20 v1.7-115 caption3 kernel (AR)
color.sty 2005/11/14 v1.0j Standard LaTeX Color (DPC)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
float.sty 2001/11/08 v1.3d Float enhancements (AL)
t1ptm.fd 2001/06/04 font definitions for T1/ptm.
supp-pdf.mkii
ulasy.fd 1998/08/17 v2.2e LaTeX symbol font definitions
t1pcr.fd 2001/06/04 font definitions for T1/pcr.
omsptm.fd
attacheddev.jpg Graphic file (type jpg)
buildapp.jpg Graphic file (type jpg)
welcomeapp.jpg Graphic file (type jpg)
devmenu.jpg Graphic file (type jpg)
content.jpg Graphic file (type jpg)
acl2013.bbl
***********
Responder1
A fonte da falta List of...
é que o acl2013
pacote usa as seguintes linhas
% We're never going to need a table of contents, so just flush it to
% save space --- suggested by drstrip@sandia-2
\def\addcontentsline#1#2#3{}
ou seja, \addcontentsline
não faz nada e não há alteração para escrever um .lof
ou .lol
etc.
Este effective
código é irritante, mas armazenar a definição antiga antes de acl2013
ser carregada e restaurar depois de carregada resolve o problema
\let\origaddcontentsline\addcontentsline
\usepackage{acl2013}
\let\addcontentsline\origaddcontentsline
Este é o MWE
\documentclass{article}
\let\origaddcontentsline\addcontentsline
\usepackage{acl2013}
\let\addcontentsline\origaddcontentsline
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{times}
\usepackage{url}
\usepackage{latexsym}
\usepackage{listings}
\usepackage{color}
\usepackage[demo]{graphicx}
\usepackage{float}
\begin{document}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\caption{That is a pic}
\label{fig: That is a pic}
\end{figure}
\listoffigures
\lstlistoflistings
\end{document}
Atualizar
\documentclass{article}
\let\origaddcontentsline\addcontentsline
\usepackage{acl2013}
\let\addcontentsline\origaddcontentsline
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{times}
\usepackage{url}
\usepackage{latexsym}
\usepackage{listings}
\usepackage{xcolor}
\usepackage[demo]{graphicx}
\usepackage{float}
\usepackage{chngcntr}
\counterwithin{figure}{section} % Adds figure numbering 1.1, 1.2, ..., 2.1 etc.
\AtBeginDocument{%
\counterwithin{lstlisting}{section} % Adds figure numbering 1.1, 1.2, ..., 2.1 etc.
}
\begin{document}
\section{My first section}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\caption{That is a pic}
\label{fig: That is a pic}
\end{figure}
\listoffigures
\lstlistoflistings
\end{document}
Responder2
você tem que executar o documento duas vezes. No entanto, use package caption
e \captionof
se não quiser que a imagem flutue.
\listfiles
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}
\usepackage{listings}
\usepackage{caption}
\begin{document}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{center}
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\captionof{figure}{That is a pic}\label{fig: That is a pic}
\end{center}
\listoffigures
\lstlistoflistings
\end{document}
A lista de arquivos:
*File List*
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
graphics.sty 2016/01/03 v1.0q Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
listings.sty 2015/06/04 1.6 (Carsten Heinz)
lstmisc.sty 2015/06/04 1.6 (Carsten Heinz)
listings.cfg 2015/06/04 1.6 listings configuration
caption.sty 2016/02/02 v3.3-136 Customizing captions (AR)
caption3.sty 2016/02/02 v1.7-136 caption3 kernel (AR)
supp-pdf.mkii
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
luatex-loader.sty 2010/03/09 v0.4 Lua module loader (HO)
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
grfext.sty 2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live