I would like to create a new section-type heading called assumption. The header must also appear in the Table of contents. So far I have managed to create the heading, but I ma failing to find a way to have it appear in the table of contents. I would like it to appear as a section would in the toc: Chapter number.headercounter-number, for example: 1.2 Assumption Header 1 Also, I created a new label format and would like the chapter number to also appear. See the attached MWE and kindly advise:

\documentclass[a4paper,12pt]{report}
\usepackage[english]{babel}

\newcounter{assumption}[section]
\newenvironment{assumption}[1][\unskip]{\large\refstepcounter{assumption}\medskip
\newcommand{\assumptionlabel}[2]{%
\protected@write \@auxout {}{\string \newlabel {#1}{{#2}{}}}
\hypertarget{#1}{#2}}

\begin{document}
\tableofcontents
\chapter{Assumptions Chapter}
\label{assumptionlabel:some-assumption}
Some assumption text.

\label{assumptionlabel:some-assumption2}
Some assumption text with reference to Assumption \ref{assumptionlabel:some-assumption}.\\
Some assumption text with reference to Assumption 1.1
\end{document}


The line

\addcontentsline{toc}{assumption}


does not work, since assumption is no known ToC entry type like section etc, i.e. there is no \l@assumption macro yet, but this can be solved by

\makeatletter
\let\l@assumption\l@section
\makeatother


in order to use the relevant \l@section instead.

Now

\addcontentsline{toc}{assumption}{\protect\numberline{\theassumption}#1}


will provide the number and the title of the assumption in the ToC on section level.

Now for the label issue: Redefine \@currentlabel to make the cross-referencing format as desired, without explicit \hypertarget - statements -- hyperref is sophisticated enough to 'guarantee' correct hyper anchors if there are correct labels.

\documentclass[a4paper,12pt]{report}
\usepackage[english]{babel}
\usepackage{hyperref}

\newcommand{\assumptionname}{Assumption}
\newcounter{assumption}[section]
\makeatletter
\let\toclevel@assumption\toclevel@section% Providing bookmark support
\let\l@assumption\l@section

\newenvironment{assumption}[1][\unskip]{%
\large\refstepcounter{assumption}%
% Specific label format
\protected@edef\@currentlabel{\csname p@assumption\endcsname\assumptionname\ \thechapter.\csname theassumption\endcsname}%
\medskip%
\noindent\textbf{\assumptionname~\thechapter.\theassumption.\ \large #1}
\medskip% % Empty line here!!!
\parindent0em

\rmfamily%
}{\medskip}%
\makeatother

\begin{document}
\tableofcontents
\chapter{Assumptions Chapter}
\label{assumptionlabel:some-assumption}%
Some assumption text. \ref{assumptionlabel:some-assumption2}
\end{assumption}

\clearpage

• @TNP: As it stands, your \assumptionlabel command is not used yet. I don't know what you want to achieve with that, actually. In a normal setup, applying \label and hyperref should do what you want, without explicit \hypertarget calls – user31729 Jun 5 '17 at 14:34
• Also you're misusing the \assumption -- it should be \begin{assumption}...\end{assumption} rather – user31729 Jun 5 '17 at 14:40