Graphics, Figures & Tables ⇒ \ref to figure problem
-
- Posts: 3
- Joined: Mon Sep 06, 2010 2:24 pm
\ref to figure problem
Hi
When Im using the command \numberwithin{figure}{chapter}
everything is O.K, I get for example FIGURE 3.1
BUT when Im trying to use \ref to the figure I get only FIG. 3
Is anybody can help me?
Thanks
When Im using the command \numberwithin{figure}{chapter}
everything is O.K, I get for example FIGURE 3.1
BUT when Im trying to use \ref to the figure I get only FIG. 3
Is anybody can help me?
Thanks
NEW: TikZ book now 40% off at Amazon.com for a short time.

\ref to figure problem
We're going to need to see a minimal working example per the Board Rules; see also the Post on Avoidable Mistakes.
-
- Posts: 3
- Joined: Mon Sep 06, 2010 2:24 pm
Re: \ref to figure problem
Hi
Here is the code I used for the figure:
\begin{center}
\begin{figure}[h]
\begin{picture}(130,220)
\put(-125,-180){\includegraphics[scale=0.65]{PS_3d.pdf}}
\end{picture}
\put(-240,-80){\caption{Pseudospectra of Orr-Sommerfeld operator}}
\label{PS2}
\put(-30,-40){Real$\;\;\lambda$}
\put(-180,10){Imag$\;\;\lambda$}
\put(-240,140){$||(zI-A)^{-1}||_2$}
\end{figure}
\end{center}
%%%%%%%%%%%%%%%%%%%%%%%%
Now, I used The \numberwithin command and the caption of the figure was :
FIGURE 3.1. Pseudospectra of Orr-Sommerfeld operator
When I do Fig.(\ref{PS2}) The result is --> Fig.(3)
There is a problem with the \ref
If somebody know what to do with this problem
please tell me
Thanks
kobi
Here is the code I used for the figure:
\begin{center}
\begin{figure}[h]
\begin{picture}(130,220)
\put(-125,-180){\includegraphics[scale=0.65]{PS_3d.pdf}}
\end{picture}
\put(-240,-80){\caption{Pseudospectra of Orr-Sommerfeld operator}}
\label{PS2}
\put(-30,-40){Real$\;\;\lambda$}
\put(-180,10){Imag$\;\;\lambda$}
\put(-240,140){$||(zI-A)^{-1}||_2$}
\end{figure}
\end{center}
%%%%%%%%%%%%%%%%%%%%%%%%
Now, I used The \numberwithin command and the caption of the figure was :
FIGURE 3.1. Pseudospectra of Orr-Sommerfeld operator
When I do Fig.(\ref{PS2}) The result is --> Fig.(3)
There is a problem with the \ref
If somebody know what to do with this problem
please tell me
Thanks
kobi
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\ref to figure problem
I strongly recommend to read the topics frabjous referred to. Do that very careful and follow the instructions unexceptionally (especially regarding the tagging of code in posts, building a minimal example, …). This is in your own interest if you expect instant help.
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
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
\ref to figure problem
Since figure is a floating environment, it will "float" out of the center environment, so it does not make sense putting a figure environment inside a center environment.kobinissim wrote:\begin{center}
\begin{figure}[h]
The \label should be on the same level as \caption, so you should write either\put(-240,-80){\caption{Pseudospectra of Orr-Sommerfeld operator}}
\label{PS2}
Code: Select all
\put(-240,-80){\caption{Pseudospectra of Orr-Sommerfeld operator}\label{PS2}}
Code: Select all
\put(-240,-80){\caption{Pseudospectra of Orr-Sommerfeld operator\label{PS2}}}
Axel
P.S.: Please read http://www.minimalbeispiel.de/mini-en.html
-
- Posts: 3
- Joined: Mon Sep 06, 2010 2:24 pm
Re: \ref to figure problem
Hi sommerfee
Thanks a lot
The problem is solved
Thanks a lot
The problem is solved
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\ref to figure problem
Now that the problem is solved, please be so kind and mark the topic accordingly as clearly written in Section 3 of the Board Rules (to be read before posting).
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
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