## LaTeX forum ⇒ TeXworks ⇒ How to refer my figure?

Information and discussion about TeXworks, an integrated LaTeX environment for several platforms
yaozhao
Posts: 37
Joined: Sat Oct 27, 2018 10:38 pm

### How to refer my figure?

\section{Research Hypothesis}\begin{figure}[h] \centering \includegraphics[width=1\textwidth]{"box-image"}\caption{Main effect}\label{Figure 1}\end{figure}  Like \ref{image-myimage} showed,

The outcome is "Like 1 figure showed". My idea is to show up "Like Figure 1 showed". I don't know where does 1 come from.

Many thanks in advance!

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
You always reference the label, in your case this is Figure 1. That is a very bad label. A better label would be mainEffectBoxImage, which would result in
Like Figure~\ref{mainEffectBoxImage} shows, ...

Package autoref can be helpful here as well.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

yaozhao
Posts: 37
Joined: Sat Oct 27, 2018 10:38 pm
Thanks! What does ~ mean? A space between words?

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
The tilde in LaTeX is an unbreakable space. That means, the word figure and the final number stick together.

Reason: There is a chance that the word figure is at the end of a line and the number printed on the start of the next. This would disrupt the flow of reading. To prevent that, use the tilde so they stick together.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Return to “TeXworks”

### Who is online

Users browsing this forum: No registered users and 2 guests