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
Graphics, Figures & Tables ⇒ Picture not displaying?
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Picture not displaying?
LaTeX.org admin
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Picture not displaying?
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?
Currently it reads figure 1, but I would like it to be figure 2.1?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Picture not displaying?
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.bazman wrote:[...] Currently it reads figure 1, but I would like it to be figure 2.1?
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}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Picture not displaying?
will do thank again
Picture not displaying?
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.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?
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,...