Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How to customize list of figures, adding word FIGURA to appears in the table of contents? I changed \newcommand{\cftfigfont}{Figura }, but in the summary, it's not linked (hyperref). How to solve it?

\renewcommand*{\l@figure}[2]{%
  \ifnum \c@lofdepth >\z@
    \vskip \cftbeforefigskip
    {\leftskip \cftfigindent\relax
     \rightskip \@tocrmarg
     \parfillskip -\rightskip
     \parindent \cftfigindent\relax\@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima \cftfignumwidth\relax
     \let\@cftbsnum \cftfigpresnum
     \let\@cftasnum \cftfigaftersnum
     \let\@cftasnumb \cftfigaftersnumb
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {\cftfigfont #1}\nobreak
     \cftfigfillnum{#2}}
   \fi
  }
\newlength{\cftbeforefigskip}
  \setlength{\cftbeforefigskip}{\z@ \@plus.2\p@}
\newlength{\cftfigindent}
  \setlength{\cftfigindent}{1.5em}
\newlength{\cftfignumwidth}
  \setlength{\cftfignumwidth}{2.3em}
\newcommand{\cftfigfont}{Figura }
\newcommand{\cftfigpresnum}{}
\newcommand{\cftfigaftersnum}{}
\newcommand{\cftfigaftersnumb}{}
\newcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}}
\newcommand{\cftfigdotsep}{\cftdotsep}
\newcommand{\cftfigpagefont}{\normalfont}
\newcommand{\cftfigafterpnum}{}
\newcommand{\cftfigfillnum}[1]{%
  {\cftfigleader}\nobreak
  \hb@xt@\@pnumwidth{\hfil\cftfigpagefont #1}\cftfigafterpnum\par}
share|improve this question
    
Why is this tagged with beamer? –  Martin Scharrer Jun 16 '11 at 15:28
    
@Martin It can't really be for beamer, so I retagged it –  Martin H Jun 16 '11 at 15:58
1  
Please make sure that the next time you ask a question you provide a fully working example. From what you show in your code it is impossible to reproduce your problem. A good question is hard to ask but always the basis to a good answer. –  Martin H Jun 16 '11 at 16:07
add comment

1 Answer

(Assuming the real question is "how do I convince tocloft to put the word 'Figura' ahead of entries in my List of Figures?")

\cftfigfont is for setting the font to typeset the List of Figures entries. \cftfigpresnum is for adding arbitrary text to the beginning on the entries. Both of these are described in section 2.3 of the tocloft manual. You'll probably also need to increase the \cftfignumwidth length to accommodate your extra text. Try something like:

\documentclass{article}

\usepackage{tocloft}
\usepackage{hyperref}
\renewcommand{\cftfigpresnum}{Figura }
\setlength{\cftfignumwidth}{5em}

\begin{document}
\listoffigures
\begin{figure}[htbp]
\centering (Figure goes here)
\caption{The first figure}
\label{fig:first}
\end{figure}
\begin{figure}[htbp]
\centering (Figure goes here)
\caption{The second figure}
\label{fig:second}
\end{figure}
\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.