Graphics, Figures & TablesQuestions Marks instead of Figure References

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Kimpossible
Posts: 5
Joined: Wed Sep 19, 2012 4:33 pm

Questions Marks instead of Figure References

Post by Kimpossible »

Hi guys!

Been trying to sort out for the past two hours why my figure referencing won't work and coming up with nothing. Any ideas? I've included my work so far.

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc} % and not inputence
\usepackage[T1]{fontenc} % [T1]
\usepackage{lmodern}
\usepackage[swedish]{babel}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{float}
\usepackage{caption}
\graphicspath{{./MATLABimages/}}

\begin{document}

\title{Design of a haptic system\\Mekatronik Ak HT-12}
\date{20120919}
\maketitle
\newpage

\chapter{} %Kapitelindelning så att numreringen fungerar som den ska

\section{Task 2}
Verify by simulation that the DC-motor model works as intended by applying a reasonable voltage step (considering motor specifications) on the input and studying the time-domain response in terms of current, angular acceleration and angular velocity.

This was achieved by comparing model data for stall torque, no-load speed, angular acceleration and mechanical time constant to the numbers given in the data sheet.

\subsection{Stall torque}
The load, $T_L$, was set to zero, the system simulated in Simulink and the stall torque received (see figure~\ref{fig:torque} below) compared to the data sheet number of $0,718 Nm$.

\begin{figure}[H]
\centerline{\includegraphics[scale=0.05]{Task_2_stall_torque}}
\caption{Stall torque when no load is applied, $T_L=0$}
\label{fig:torque}
\end{figure}

\subsection{No-load speed}
The angular velocity of the system was simulated when the load was set to zero, $T_L=0$. As seen in figure~\ref{fig:velocity} below, the data received, $\dot{\phi}=552rad/s$, corresponded well to the given information in the data sheet.

\begin{figure}[H]
\centerline{\includegraphics[scale=0.05]{Task_2_angular_velocity}}
\caption{Stall torque when no load is applied $T_L=0$}
\label{fig:velocity}
\end{figure}

\subsection{Angular acceleration}
The angular acceleration of the system should peak instantly and then as the speed becomes constant decrease to zero. This scenario is depicted in the figure~\ref{fig:acceleration} below.

\begin{figure}[H]
\centerline{\includegraphics[scale=0.05]{Task_2_angular_acceleration}}
\caption{Angular acceleration with no load applied, $T_L=0$}
\label{fig:acceleration}
\end{figure}

\section{Task 3}
Yadiyadi


\section{Task 4}
Derive the gear ratio for the two planetary gears. Motivate your choice.

\end{document}
The three figure references show up in the text as figure "??" when I try to use \ref{fig:torque} for example.

Thanx in advance!

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Questions Marks instead of Figure References

Post by localghost »

The »article« class does not support chapters. You get a corresponding error message in the log file (*.log). Delete the \chapter command, compile again at least two times and it will work.


Best regards and welcome to the board
Thorsten
Kimpossible
Posts: 5
Joined: Wed Sep 19, 2012 4:33 pm

Re: Questions Marks instead of Figure References

Post by Kimpossible »

I removed the chapter, compiled twice and still no difference :/
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Questions Marks instead of Figure References

Post by localghost »

Works fine for me. Attach the corresponding log file (*.log) to your next post by upload to the forum server.
Kimpossible
Posts: 5
Joined: Wed Sep 19, 2012 4:33 pm

Re: Questions Marks instead of Figure References

Post by Kimpossible »

Here is the attached log-file. Thank you so much for your help!
Attachments
TSWLatexianTemp_Report.log
(32.43 KiB) Downloaded 302 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Questions Marks instead of Figure References

Post by localghost »

This is not the log file of the example you presented earlier. In that log there are multiple errors which you have to fix first. The log tells you exactly the lines where you have to do that.
Kimpossible
Posts: 5
Joined: Wed Sep 19, 2012 4:33 pm

Questions Marks instead of Figure References

Post by Kimpossible »

I've gone over all the errors I could understand and as far as I know understand the only "errors" are the undefined references (which was my original problem). These are the error messages left:

Code: Select all

LaTeX Warning: Reference `sec:diff' on page 2 undefined on input line 42.

<./MATLABimages/Task1_model.jpg, id=9, 1122.1925pt x 414.54875pt>
File: ./MATLABimages/Task1_model.jpg Graphic file (type jpg)
 <use ./MATLABimages/Task1_model.jpg>
Package pdftex.def Info: ./MATLABimages/Task1_model.jpg used on input line 45.
(pdftex.def)             Requested size: 448.86905pt x 165.81656pt.
 [2 <./MATLABimages/Task1_model.jpg>]

LaTeX Warning: Reference `fig:velocity' on page 3 undefined on input line 109.

<./MATLABimages/Task_2_angular_velocity.jpg, id=23, 9323.83376pt x 4661.415pt>
File: ./MATLABimages/Task_2_angular_velocity.jpg Graphic file (type jpg)
 <use ./MATLABimages/Task_2_angular_velocity.jpg>
Package pdftex.def Info: ./MATLABimages/Task_2_angular_velocity.jpg used on input line 112.
(pdftex.def)             Requested size: 466.21901pt x 233.0844pt.
 [3]

LaTeX Warning: Reference `fig:acceleration' on page 4 undefined on input line 118.

<./MATLABimages/Task_2_angular_acceleration.jpg, id=27, 9323.83376pt x 4586.13374pt>
File: ./MATLABimages/Task_2_angular_acceleration.jpg Graphic file (type jpg)
 <use ./MATLABimages/Task_2_angular_acceleration.jpg>
Package pdftex.def Info: ./MATLABimages/Task_2_angular_acceleration.jpg used on input line 121.
(pdftex.def)             Requested size: 466.21901pt x 229.32011pt.
 [4 <./MATLABimages/Task_2_angular_velocity.jpg> <./MATLABimages/Task_2_angular_acceleration.jpg>] <./MATLABimages/Task_2_time_constant.jpg, id=31, 9323.83376pt x 4493.78876pt>
File: ./MATLABimages/Task_2_time_constant.jpg Graphic file (type jpg)
 <use ./MATLABimages/Task_2_time_constant.jpg>
Package pdftex.def Info: ./MATLABimages/Task_2_time_constant.jpg used on input line 140.
(pdftex.def)             Requested size: 466.21901pt x 224.7026pt.
 [5 <./MATLABimages/Task_2_time_constant.jpg>] (./TSWLatexianTemp_Report.aux)

LaTeX Warning: There were undefined references.


LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
I will also include the whole .log file.
Attachments
TSWLatexianTemp_Report.log
(27.82 KiB) Downloaded 424 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Questions Marks instead of Figure References

Post by localghost »

And you did compile twice (or more) as recommended earlier?
Kimpossible
Posts: 5
Joined: Wed Sep 19, 2012 4:33 pm

Re: Questions Marks instead of Figure References

Post by Kimpossible »

Yes. Just to be absolutely clear: I use Latexian on a mac-computer and compile by previewing the current document in pdf-form. Is this the correct way to do it or am I missing a step?
Post Reply