I'm trying to write a lab manual. Because of this I need a consistent and generalized method to label a new page heading (not header) with the title of the section (the activity name).
\documentclass[12pt]{report}
\usepackage{nameref}
\usepackage{tabularx}
\newcolumntype{J}{>{\centering\arraybackslash}X}
\makeatletter
\newcommand*{\currentname}{\@currentlabelname}
\makeatother
\newcommand{\handinhead}{%
\begin{center}
\begin{table}[!h]
\begin{tabularx}{\textwidth}{X J X}
& \currentname & \\
Name:~\hrulefill & & Date:~\hrulefill \\
\end{tabularx}
\end{table}
\end{center}
\hrule
}
\begin{Document}
\chapter{Lab Activities}
\section{Lab1 Title}
Here is the activity introduction.
\subsection{Objective}
Objective of the activity.
\subsection{Equipment}
A list of equipment needed.
\subsection{Theory}
Explanation of the theory.
\newpage
\handinhead
The following is the hand in portion of the activity.
\end{document}
I have tried the solutions Here using
\makeatletter
\newcommand*{\currentname}{\@currentlabelname}
\makeatother
but this returns the current subsection title "Theory" when I need it to return the section title "Lab1 Title". Is there any way to call the current lable 1 level up?

\chapteror\sectiondoing what you want? How did you try to use\currentname? I'm trying to figure out where the new thing should be and what its content should be. – cfr Feb 23 '18 at 03:24\labelafter the\sectionand then using thenamerefpackage to insert its name again to make the repeat in the table? – cfr Feb 23 '18 at 03:38