Graphics, Figures & TablesCharts not in the List of Figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Michael
Posts: 1
Joined: Sat Feb 19, 2011 4:04 am

Charts not in the List of Figures

Post by Michael »

Hello everyone,

I am writing my master thesis and I need some help with charts and figures.
In my thesis I have both figures (mainly frameworks with bubbles and arrows, made in Word, saved as .png and then transferred into Latex) and charts (like pie charts, istograms, made with Excel, saved as .png and then transferred into Latex), but I want them to be two different categories.

The problem is that Latex names "Figure 8" what I want to be "Chart 1" (i.e. the first chart that appears in my thesis), and "Figure 8" is automatically included in the List of Figures. How can I have Latex recognizing the difference between my charts and my figures?

If I create a floated environment called 'Chart' I manage to change the name in the caption and have "Chart 8", but still it's not Chart "1" and it's included in the List of Figures.

If this helps: I am using a minipage environment with landscape orientation, and I have 3 charts aligned that I would like to be named "Chart 1", "Chart 2" and "Chart 3".

Many thanks for your help!

Michael
Last edited by Michael on Thu Feb 24, 2011 1:08 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Charts not in the List of Figures

Post by sommerfee »

Michael wrote:How can I have Latex recognizing the difference between my charts and my figures?
Just define a new floating environment called "chart" and use this one for charts. You can either use \DeclareCaptionType{chart} by the caption package, or \newfloat by the float package, or -whatever- by the trivfloat package, or \DeclareNewFloat by the floatrow package, or...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Charts not in the List of Figures

Post by localghost »

Michael wrote:[…] In my thesis I have both figures (mainly frameworks with bubbles and arrows, made in Word, saved as .png and then transferred into Latex) and charts (like pie charts, istograms, made with Excel, saved as .png and then transferred into Latex) […]
How ugly. Not very good for the consistency of your document.
Michael wrote:[…] The problem is that Latex names "Figure 8" what I want to be "Chart 1" (i.e. the first chart that appears in my thesis), and "Figure 8" is automatically included in the List of Figures. How can I have Latex recognizing the difference between my charts and my figures? […]
Use the caption package to declare a new float environment as shown in the code below. The figure comes from my archive. The pie chart was taken from the tikZ Example Gallery.
Michael wrote:[…] If I create a floated environment called 'Chart' I manage to change the name in the caption and have "Chart 8", but still it's not Chart "1" and it's included in the List of Figures. […]
Would be interesting how you did that to make the problem comprehensible.
Michael wrote:[…] If this helps: I am using a minipage environment with landscape orientation, and I have 3 charts aligned that I would like to be named "Chart 1", "Chart 2" and "Chart 3". […]
No, it doesn't help. A minimal example would be much more helpful. But the code below might give some inspiration. It is compilable as is. The output is in the attachment.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[includeheadfoot,margin=3cm]{geometry}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{tikz}
\usetikzlibrary{automata,positioning,shapes.geometric}
\usepackage{blindtext}

\DeclareCaptionType[fileext=loc]{chart}[Chart][List of Charts]

\newcommand{\slice}[4]{%
  \pgfmathparse{0.5*#1+0.5*#2}
  \let\midangle\pgfmathresult
  \draw[thick,fill=black!10] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle;  % slice
  \node[label=\midangle:#4] at (\midangle:1) {};                      % outer label
  \pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}                         % inner label
  \let\temp\pgfmathresult
  \pgfmathparse{max(\temp,-0.5) + 0.8}
  \let\innerpos\pgfmathresult
  \node at (\midangle:\innerpos) {#3};
}

\begin{document}
  \blindtext
	
  \begin{figure}[!ht]
    \centering
    \begin{tikzpicture}[%
      ->,
      shorten >=2pt,
      >=stealth,
      auto,
      node distance=1cm,
      noname/.style={%
        ellipse,
        minimum width=5em,
        minimum height=3em,
        draw
      }
    ]
      \node[noname] (1)                                             {1};
      \node[noname] (2) [below=of 1]                                {2};
      \node[noname] (4) [node distance=1cm and 3mm,below left=of 2] {4};
      \node[noname] (3) [left=of 4]                                 {3};
      \node[noname] (5) [below=of 4]                                {5};
      \node[noname] (6) [node distance=2cm,right=of 5]              {6};

      \path (1) edge                   node       {a} (2)
            (2) edge                   node[swap] {b} (3)
            (2) edge                   node       {c} (4)
            (2) edge                   node       {d} (6)
            (3) edge                   node       {f} (5)
            (4) edge                   node       {g} (5)
            (5) edge [bend right=20pt] node[swap] {h} (2);
    \end{tikzpicture}
    \caption{Dummy figure}\label{fig:dummy}
  \end{figure}
	
  \blindtext[3]

  \begin{chart}[!ht]
    \centering
    \begin{tikzpicture}[scale=3,thick]
      \newcounter{a}
      \newcounter{b}
      \foreach \p/\t in {20/type A, 4/type B, 11/type C,49/type D, 16/other}
      {
        \setcounter{a}{\value{b}}
        \addtocounter{b}{\p}
        \slice{\thea/100*360}{\theb/100*360}{\p\%}{\t}
      }
    \end{tikzpicture}
    \caption{Dummy chart}\label{cht:dummy}
  \end{chart}
	
  \blindtext

  \listoffigures
  \listofcharts
\end{document}

Best regards and welcome to the board
Thorsten
Attachments
newfloat.pdf
The resulting output from the above given code.
(68.8 KiB) Downloaded 256 times
Post Reply