I link two questions below because I use their solution, to number my equations and generate a list of my equations.
- My question about numbering equations: Number of Equation: 1, 1a, 1b
- Generate a list of equations: Table of equations like list of figures
Although they might not be directly relevant, I mention I use them because I am not sure if this messes up possible solutions.
Below my MWE. This works fine so far (Figures attached).
But I want the "list name" of my equation (in this case: \myequations{PDE of the diffsion process}
) to be available as a kind of variable so that
I can refer to it as "The \XXX
is given by", where \XXX
is a command giving me the Name (\myequations{...}
) of the equation I refer to (e.g., \tag{\ref{eq:litdiff}}
).
I hope my equation is clear, if not, please tell.
MWE:
\documentclass[12pt]{report}
\usepackage{tocloft}
\usepackage{amsmath}
\usepackage{physics}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}
\setlength{\cftmyequationsnumwidth}{2.5em}
\newcommand{\subs}{\text{s}}
\begin{document}
\listofmyequations
\chapter{Diffsion}
The PDE of the diffsion process is given by
\begin{subequations}\label{eq:litdiff}
\begin{equation}
\pdv{}{t} (\widetilde{c}_{\subs}(r,z,t)+c_{\subs,0})=\frac{D_{\subs}}{r^{2}}\pdv{}{r} \left(r^{2}\frac{\partial (\widetilde{c}_{\subs}(r,z,t)+c_{\subs,0})}{\partial r}\right)
\tag{\ref{eq:litdiff}}
\end{equation}
\myequations{PDE of the diffsion process}
\noindent The boundary conditions of Eq.~\eqref{eq:litdiff} are given by
\begin{align}
D_{\subs}\pdv{}{r} \widetilde{c}_{\subs}(0,z,t) &= 0 \label{eq:diffusionpartialdiff_boundaries0}\\
D_{\subs}\pdv{}{r} \widetilde{c}_{\subs}(R_{\subs},z,t) &= -j(z,t)\label{eq:diffusionpartialdiff_boundariesRs}
\end{align}
and the initial condition is given by
\begin{equation}
\widetilde{c}_{\subs}(r,z,0) = 0 \quad r\in [0;R_{\subs}].
\label{eq:diffusionpartialdiff_init}
\end{equation}
\end{subequations}
\end{document}
Best Answer
Here is one way to incorporate \mylabel into \myequation. The \makeatletter...\makeatother is needed due to the @ symbols used in \protected@write and \@auxout.