Graphics, Figures & Tablestable 1 is table 3.1

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
eisegal
Posts: 10
Joined: Fri Nov 02, 2012 12:40 pm

table 1 is table 3.1

Post by eisegal »

hello all together,

I'm having some trouble.. i want to ref to a table with a label called payoff. its called table one for the listoftables and in the capture.

but in the text where there is a \ref{payoff} its called 3.1 i d likte to have: "table 1". how can i change this?

thanks and greetings

Code: Select all

\documentclass[12pt,oneside,a4paper,english]{article}

%packages
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{framed}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{fancyref}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage[hidelinks]{hyperref}
\usepackage{cite}
\usepackage{natbib}

\linespread{1.3}
\label{labeltname}
\geometry{a4paper, top=30mm, left=25mm, right=33mm, bottom=20mm,
headsep=10mm, footskip=12mm}
\setlength{\parindent}{0mm}
\newcommand{\cchapter}[1]

\begin{document}

\pagestyle{fancy}

\newpage
\pagenumbering{Roman}
\tableofcontents

\newpage 

\section{Introduction}
here will be a introduction

\section{literature}
main sources

\section{section about the model}

\subsection{Our model} 
\begin{description}
\item[agents]...where they get a higher return (see table \ref{payoff}).
\begin{table}[h]
\center
\label{payoff}
\begin{tabular}{ r | r | r | r}
$T=0 $ & $T=1$ & $T=2$ & decision\\ \hline
-1 & 1 & 0 & short-term investment\\
-1 & 0 & R & long-term investment\\
\end{tabular}
\caption{Payoff depending on withdrawal}
\end{table}


\end{description}

\end{document}

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

table 1 is table 3.1

Post by cgnieder »

The \label needs to be placed (preferably immediately) after \caption. Right now you're actually referring to subsection 3.1.

Regards
site moderator & package author
eisegal
Posts: 10
Joined: Fri Nov 02, 2012 12:40 pm

Re: table 1 is table 3.1

Post by eisegal »

pefect, thank you!

\problemsolved
Post Reply