Fix equation references

This commit is contained in:
2024-09-20 09:03:53 +02:00
parent 27f635afe4
commit 65453e0605
3 changed files with 17 additions and 18 deletions

View File

@@ -30,12 +30,20 @@
\renewcommand{\secref}[2][\labelprefix]{Section~\ref{#1:#2}}
\renewcommand{\tabref}[2][\labelprefix]{Table~\ref{#1:tab:#2}}
\NewEnvironmentCopy{oldequation}{equation}
\RenewDocumentEnvironment{equation}{m}{%
\begin{oldequation}%
\label{\labelprefix:eq:#1}%
}{%
\end{oldequation}%
}
% Images
% example: \fig[1]{universe}{The Universe}[Additional caption text, not shown in the list of figures]
% reference later with: \figref{universe}
% 1 = \linewidth = 150 mm
\RenewDocumentCommand{\fig}{O{1} O{htbp} m m O{}}{% #1 = width, #2 = position, #3 = filename, #4 = caption, #5 = additional caption
\begin{figure}[#2]
\begin{figure}[#2]%
\centering%
\includegraphics[width=#1\linewidth]{#3}%
\caption[#4]{#4#5}