I'm searching for a way to automatically set labels depending on in which chapter the labeled item is in. Something like a variable that contains the current chapter number, is what I'm looking for. I want to use a selfmade section, that is automatically labeled, so that I can reference it by:[chapternumber . sectionnumber] (In which the sectionnumber is the by me given number). It should look something like this, if \currentchapter contained the current chapter number:
Code: Select all
\documentclass[11pt,titlepage,a4]{report}\usepackage{hyperref}\newcommand{\ownsection}[1]{\section{Definition #1}\label{\currentchapter.#1}}\begin{document}\chapter{Exponential Equations}\ownsection{1}something\chapter{Next}Exponential Equations are defined as in \hyperref[1.1]{Definition 1}.\end{document}
Chapter 1
Exponential Equations
Definition 1
something
Chapter 2
Next
Exponential Equations are defined as in Definition 1.
I'm looking forward to any help

Thanks a lot!