Graphics, Figures & Tables ⇒ Picture not displaying?
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Picture not displaying?
Stefan
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
Re: Picture not displaying?
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}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Picture not displaying?
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.