Graphics, Figures & Tablescounter modification of "listoftables"...

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
0.8.15
Posts: 16
Joined: Mon May 26, 2008 10:39 am

counter modification of "listoftables"...

Post by 0.8.15 »

hi ya all,
how can i change the "listoftables" and "listoffigures" counter.
i want to generate them separately in the "tableofcontents" like:

Abb."2.Kapitel" and "erstes Bild/Tabelle in diesem Kapitel"
for instance:
Abb.2-1 or Tab.2-1

i am already able to generate:
Abb. and Tab.
==============================================================
documentclass"article"
...
\usepackage{tocloft}
\renewcommand{\cftfigpresnum}{Abb.}
\renewcommand{\cfttabpresnum}{Tab.}
%\renewcommand{\cftfigaftersnum}{:}
%\renewcommand{\cfttabaftersnum}{:}
\setlength{\cftfignumwidth}{3cm}
\setlength{\cfttabnumwidth}{3cm}
\setlength{\cftfigindent}{0cm}
\setlength{\cfttabindent}{0cm}

%==============================================================
\begin{document}

\setcounter{tocdepth}{3}
\addcontentsline{toc}{subsection}{Inhaltsverzeichnis}
\tableofcontents
\newpage
\setcounter{page}{5}
\listoffigures
\addcontentsline{toc}{subsection}{Abbildungsverzeichnis}
\newpage
\setcounter{page}{6}
\listoftables
\addcontentsline{toc}{subsection}{Tabellenverzeichnis}

\pagestyle{headings}
\pagestyle{fancy}
--------------------------------
\begin{figure}[h!]
\centering
\includegraphics[width=1.00\textwidth]{link xyz.jpg}
\caption{\textbf{Bildnahme \cite{bib-14}}}
\label{fig:Bildnahme}
\end{figure}

..in the same way i am not able to generate a right counter for the "Tabellenverzeichnis".
thank^s in advance for a helpfull answer. ;)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
0.8.15
Posts: 16
Joined: Mon May 26, 2008 10:39 am

Re: counter modification of "listoftables"...

Post by 0.8.15 »

I solved my problem:

\usepackage[bf]{caption2}
\renewcommand{\captionfont}{\small\slshape}
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\makeatletter \@addtoreset{figure}{section} \makeatother
\renewcommand{\thetable}{\arabic{section}.\arabic{table}}
\makeatletter \@addtoreset{table}{section} \makeatother

\usepackage{tocloft} % die Benennung im Abbildungs-und Tabellenverzeichnis kann geändert werden:
\renewcommand{\cftfigpresnum}{\textbf{Abb.}} % gibt "`Abb."' in "`Abbildungsverzeichnis aus.
\renewcommand{\cfttabpresnum}{\textbf{Tab.}}
\setlength{\cftfignumwidth}{3cm} % alternative Abstandeinstellung zw. Abb.X.X und caption{Beschriftung}
\setlength{\cfttabnumwidth}{3cm}
\setlength{\cftfigindent}{0cm}
\setlength{\cfttabindent}{0cm}

%Tabellen im "appendix" werden mit römischen Zahlen in das Tabellenverzeicnis geschrieben:

\newpage
\renewcommand{\thetable}{\Roman{part}.\arabic{table}}
\makeatletter \@addtoreset{table}{part} \makeatother

\appendix
\part{Anhang}
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

counter modification of "listoftables"...

Post by localghost »

Do not use the caption2 package. It is obsolete and superseded by the caption package. Using the current version makes your modifications much easier.

Code: Select all

\usepackage[%
  figurewithin=section,
  tablewithin=section,
  font=small,
  labelfont=bf,
  tableposition=top
]{caption}
Please use the code environment to tag code a such. It keeps a post clear and legible.


Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply