Open Benjamin-Loison opened 9 months ago
\newcommand{\myLabel}[2]{\label{#1:#2}#2}
\subsection{\myLabel{section}{Motivation}}
is a first working iteration.
\caption{\label{figure:Simplified image processing pipeline, and noise curve associated with each step}Simplified image processing pipeline, and noise curve associated with each step~\cite{bayer}.}
\caption{\myLabel{figure}{Simplified image processing pipeline, and noise curve associated with each step}~\cite{bayer}.}
looks like an interesting second iteration.
Avoiding specifying first argument would be nice.
grep '\myLabel{' article.tex
grep -vE '\\(caption\{\\myLabel\{(|sub)figure|(|sub(|sub))section\{\\myLabel\{section)\}\{' article.tex | grep '\myLabel{'
is exhaustive.
So:
Parent node name | What I would like to get |
---|---|
caption |
figure or subfigure |
{,{,sub}}section |
section |
Maybe better \label
prefix could be used.
I am looking for a function, command or variable that returns the parent node name for instance \section{My \getParentNodeName}
would be equivalent to \section{My section}
and \caption{My \getParentNodeName}
would be equivalent to \caption{My caption}
.
LaTeX get parent node does not seem to return interesting results on DuckDuckGo and Google.
The Tex Stack Exchange question 464119 is about getting the parent section name so not what I am looking for.
How to deal with
$x=1$
,\cite{...}
and\emph{...}
?Related to #3.
Brief outline of the enhancement
LaTeX2e generally cannot add new features without an extreme amount of care to accommodate backwards compatibility. Please do not be offended if your request is closed for being infeasible.
Minimal example showing the current behaviour
Minimal example showing the desired new behaviour