Graphics, Figures & TablesPicture not displaying?

Information and discussion about graphics, figures & tables in LaTeX documents.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Picture not displaying?

Post by Stefan Kottwitz »

Btw. in general I prefer to give more positioning options to the figure environment to allow more placement possibilities, like [ht] or [!htb] or even [!htbp], depending on what is needed.

Stefan
LaTeX.org admin

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Re: Picture not displaying?

Post by bazman »

One last point how can I change the figure number?

Currently it reads figure 1, but I would like it to be figure 2.1?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Picture not displaying?

Post by localghost »

bazman wrote:[...] Currently it reads figure 1, but I would like it to be figure 2.1?
Please get used to providing a MWE (see Section 2.2 of the Board Rules). Nobody knows the setup of your document. That especially concerns the document class. From your request I can only assume that you are using the article class. Loading the caption package allows also to customize figure numbering.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage[%
  font=small,
  labelfont=bf,
  figurewithin=section,
  tablewithin=section,
  tableposition=top
]{caption}
\usepackage{blindtext}

\begin{document}
  \section{One}
  \blindtext

  \begin{figure}[!ht]
    \centering
    \rule{6.4cm}{3.6cm}
    \caption{Dummy figure}\label{fig:dummy-1}
  \end{figure}

  \blindtext

  \section{Two}
  \blindtext

  \begin{figure}[!ht]
    \centering
    \rule{6.4cm}{3.6cm}
    \caption{Dummy figure}\label{fig:dummy-2}
  \end{figure}

  \blindtext
\end{document}
Refer to the manuals of the used packages to learn more.
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Re: Picture not displaying?

Post by bazman »

will do thank again
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Picture not displaying?

Post by gmedina »

bazman wrote:...The code you see was generated automatically by the TeXnicCenter package. I do not have any \caption command to put \label after? can you clarify please?
I see that you are already including the \caption command in your code. Normally a figure or a table has a caption that consists of a name ("Figure" or "Table") and a number, and a brief description of the figure or table; this is accomplished by using the \caption command inside the corrseponding floating environment. The \caption command also will be responsible for the inclusion of the object in the corresponding List of Figures or List of Tables.

As I said before, the \label command that will generate the string to be used to cross-reference the figure or table should appear right after the \caption command; otherwise, the \label command will pick up the wrong string and the reference number will be wrong.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply