I'd like to make a list of headings with their font sizes:
I envision something like the following:
\documentclass{article}
\begin{document}
\section{{\textbackslash}section \makeatletter\f@size pt\makeatother}
\subsection{{\textbackslash}subsection\makeatletter\f@size pt\makeatother}
\subsubsection{{\textbackslash}subsubsection\makeatletter\f@size pt\makeatother}
\paragraph{{\textbackslash}paragraph\makeatletter\f@size pt\makeatother}
\end{document}
I suspect this is an expansion problem. I saw this question: How could I check what font size is in pt for \section, \subsection, and \subsubsection?
But I would like to know why my code does not work.

\makeatletterand\makeatother. That solidified my understanding. I assume the reason why the other code is better is to keep all category code changes out of the body? – Jonathan Komar Jan 21 '16 at 07:53