Within the bookmarks of PDF files, I'd like to be able to divide the output from the \listoffigures command into a few sections.
In general \listoffigures gives a listing of all the figures in the document. The "pdflatex" command produces a PDF file with a list of bookmarks on the left side of the document. The bookmarks come from the table of contents.
The section, subsection, and subsubsections appear in the bookmarks, but they're displayed in a tree. I.E.: You won't see these subsections unless you open the tree via clicking on the "+" sign next to the chapter name.
In the bookmarks, what I would like to be able to have is (instead of just creating a single link to a list of all the figures in the document) divide the output from the \listoffigures command in a tree-like layout just like sections, subsections are displayable via a tree.
FYI: I add the list of figures to the table of contents using the following code:
...
\phantomsection\label{listoffig}
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
...
So, I get one link in the bookmarks of the PDF file.
Thanks,
Graphics, Figures & Tables ⇒ How To Breakup List Of Figures For Bookmarks In PDF File
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
Re: How To Breakup List Of Figures For Bookmarks In PDF File
Is there an easier way to bookmark (sections of figures) then the following implied technique:
\usepackage{tocloft}
...
\newcommand{\listlemmaname}{List of Lemmas}
\newlistof{lemma}{lem}{\listlemmaname}
\newcommand{\lemma}[1]{%
\refstepcounter{lemma}
\par\noindent\textbf{Lemma \thelemma. #1}
\addcontentsline{lem}{lemma}
{\protect\numberline{\thechapter.\thelemma}#1}\par
}
...
\listoflemma
...
\lemma{My first lemma}
\label{lem:lemma1}
Reference:
http://texblog.org/2011/09/09/10-ways-t ... tocloflot/
\usepackage{tocloft}
...
\newcommand{\listlemmaname}{List of Lemmas}
\newlistof{lemma}{lem}{\listlemmaname}
\newcommand{\lemma}[1]{%
\refstepcounter{lemma}
\par\noindent\textbf{Lemma \thelemma. #1}
\addcontentsline{lem}{lemma}
{\protect\numberline{\thechapter.\thelemma}#1}\par
}
...
\listoflemma
...
\lemma{My first lemma}
\label{lem:lemma1}
Reference:
http://texblog.org/2011/09/09/10-ways-t ... tocloflot/
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
Re: How To Breakup List Of Figures For Bookmarks In PDF File
If I cannot do what I want to do which is to add more links to the bookmarks area then is it possible to put horizontal lines across sections of the list of figures, themselves. I.E.: Could I alternately visually isolate specific parts of the list of figures via a horizontal line.
Thanks,
Thanks,
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
How To Breakup List Of Figures For Bookmarks In PDF File
Michael, again there are some important information missing. Usually the chapter command introduces a little skip (known as the chapter gap) to separate the figures of different chapters.
Please provide a minimal working example this time. Follow the link and read how to do it.
Please provide a minimal working example this time. Follow the link and read how to do it.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
How To Breakup List Of Figures For Bookmarks In PDF File
Per the reference, this code should do two things:
And, this gives an error when I add lines to the list of figures in my actual (real) document. It tells me, "! Argument of \contentsline has an extra }."
Reference:
http://texblog.org/2013/07/16/how-to-ad ... nd-tables/
- Add sections to the list of figures.
- Add line to the list of figures.
And, this gives an error when I add lines to the list of figures in my actual (real) document. It tells me, "! Argument of \contentsline has an extra }."
Reference:
http://texblog.org/2013/07/16/how-to-ad ... nd-tables/
Code: Select all
Code, edit and compile here:
\documentclass[11pt]{article}\usepackage{blindtext}\usepackage{caption}\usepackage{etoolbox}\begin{document}\tableofcontents\preto\figure{%\ifnum\value{figure}=0\addtocontents{lof}{{\bfseries Section\thesection\vskip10pt}}\fi}\listoffigures\addtocontents{lof}{\contentsline{section}{\protect\rule{\linewidth}{.5pt}}{}}\section{First section}\begin{minipage}{\linewidth}\begin{center}\rule{5cm}{4cm}\captionof{figure}{this is my 1st caption}\end{center}\end{minipage}\begin{minipage}{\linewidth}\begin{center}\rule{5cm}{4cm}\captionof{figure}{this is my 2nd caption}\end{center}\end{minipage}\blindtext\addtocontents{lof}{\contentsline{section}{\protect\rule{\linewidth}{.5pt}}{}}\section{Second section}\begin{minipage}{\linewidth}\begin{center}\rule{5cm}{4cm}
How To Breakup List Of Figures For Bookmarks In PDF File
This is a possible solution, I used it from an answer of my own, I posted on TeX.SX yesterday (see List of tables (or figures) by section for more details)
I added the bookmark feature for figure (and table) captions to the code.
It needs three runs of (pdflatex) to complete the correct ToC/LoT/LoF files.
I added the bookmark feature for figure (and table) captions to the code.
It needs three runs of (pdflatex) to complete the correct ToC/LoT/LoF files.
Code: Select all
Code, edit and compile here:
\documentclass[paper=a4,12pt]{scrartcl}%\usepackage[demo]{graphicx}%\usepackage{etoolbox}%\usepackage{xpatch}%\usepackage{blindtext}%\usepackage{caption}%\usepackage{placeins}%\usepackage{morewrites}%\usepackage{assoccnt}%\usepackage{letltxmacro}%\usepackage[bookmarksopen=true,bookmarksopenlevel=4]{hyperref}%\makeatletter% Get some file handles first\newwrite\figurecountsout%\newwrite\tablecountsout%\newread\figurecountsin%\newread\tablecountsin%%%% `Unique` bookmarks\newcounter{totalsections}\DeclareAssociatedCounters{section}{totalsections}%%% Redefine \caption\LetLtxMacro\LaTeXStandardCaption\caption%\newcommand{\caption@@noopt}[1]{%\caption@@opt[#1]{#1}%}%\apptocmd{\refstepcounter}{\gdef\LastRefSteppedCounter{#1}}{}{}%