Zeichnen Sie einen Pfeil von der Gleichung zum Text außerhalb der Gleichung

Zeichnen Sie einen Pfeil von der Gleichung zum Text außerhalb der Gleichung

Ich möchte einen Pfeil von einem Kästchen innerhalb einer Gleichung
zu einem bestimmten Teil (z. B. dem =Vorzeichen) im Text außerhalb der Gleichung zeichnen.
Der Pfeil sollte nicht durch den Text hindurchgehen.

Mein Code:

\documentclass[
    pdftex,a4paper,11pt,oneside,fleqn,
    bibliography=totoc,listof=totoc,
    headlines=2.1,headsepline,
    numbers=noenddot
]{scrreprt}


%%%----- Mathe ----------------------------------
\usepackage{amsmath,amsfonts,amssymb,bm}
\usepackage[squaren,textstyle]{SIunits}
\usepackage{icomma}
    
\usepackage{mathtools}
\usepackage[makeroom]{cancel}
\usepackage{trfsigns}
    
    
    
%%% ------ Formel schöner darstellen ------------
\usepackage{tcolorbox}
\tcbuselibrary{listings,theorems}
\def\mathunderline#1#2{\color{#1}\underline{{\color{black}#2}}\color{black}}

%%%--------------------------------------------------------
%%%----- Beginn Dokument ----------------------------------
\begin{document}

    \begin{equation}
\tcbset{fonttitle=\scriptsize}
 \begin{split}
    \sigma_{\mathrm{n}} &= \sigma_{\mathrm{n}, \nu = 1} + \sigma_{\mathrm{n}, \nu = 1, \mu = 1} + \sigma_{\mathrm{n}, \mu = 1}\\
    &= \Bigg( \dfrac{\hat{B}_{\delta \mathrm{s}, \nu = 1}^{2} + \hat{B}_{\delta \mathrm{r}, \mu = 1}^{2}}{4 \cdot \mu_{0}} + \dfrac{\hat{B}_{\delta \mathrm{s}, \nu = 1} \cdot \hat{B}_{\delta \mathrm{r}, \mu = 1}}{2 \cdot \mu_{0}} \Bigg) \cdot \Big( 1 + \cos \left(2 p \alpha - 2 \omega_{\mathrm{el}} t \right) \Big)\\
    &= \dfrac{\hat{B}_{\delta \mathrm{s}, \nu = 1}^{2} + \hat{B}_{\delta \mathrm{r}, \mu = 1}^{2} + 2 \cdot \hat{B}_{\delta \mathrm{s}, \nu = 1} \cdot \hat{B}_{\delta \mathrm{r}, \mu = 1}}{4 \cdot \mu_{0}} \cdot \Big( 1 + \cos \left(2 p \alpha - 2 \omega_{\mathrm{el}} t \right) \Big)\\
    &= \dfrac{\left( \hat{B}_{\delta \mathrm{s}, \nu = 1} + \hat{B}_{\delta \mathrm{r}, \mu = 1} \right)^{2}}{4 \cdot \mu_{0}} \cdot \Big( 1 + \cos \big(2 p \alpha - \tcboxmath[boxsep=1pt,left=2pt,right=2pt,top=1pt,bottom=1pt, colback=white,colframe=red]{2 \omega_{\mathrm{el}}} \, t \big) \Big) \, \text{.}
 \end{split}
 \label{eq: Radialkraftwelle_Grundwelle}
\end{equation}

Das Ergebnis für das Grundwellen-Luftspaltfeld ist eine Radialkraftwelle, die sich mit einer Frequenz von $f_{\mathrm{h}} = 2f_{\mathrm{el}}$ (1. Hauptordnung) ausbreitet.

\end{document}

Das gewünschte Ergebnis: Bildbeschreibung hier eingeben

Antwort1

Sie können tikzmarksdies erreichen, indem Sie verwenden. Es kommt als Bibliothek für TikZ, das automatisch geladen wird, wenn Sie die skinsBibliothek laden tcolorbox, die Sie sowieso benötigen, damit dies funktioniert. Mit dieser Bibliothek können Sie Markierungen oder Knoten in Ihren Text setzen und auf diese Markierungen und Knoten mithilfe von verweisen, tikzpicturedas die Optionen hat remember picture, overlay. Wenn Sie beispielsweise \tikzmarknode{mynode}{some text}in Ihren Text setzen, können Sie später eine Linie zu diesem Knoten zeichnen, indem Sie etwas wie verwenden . Mit dieser Technik können Sie einen Pfeil von der in Ihrer Gleichung zum relevanten Teil der Formel im Text darunter \tikz \draw (mynode) -- +(0,1);zeichnen .\tcboxmath

Um auf die verweisen zu können \tcboxmath, müssen Sie die Optionen hinzufügen enhanced, remember as=[name], die nur verfügbar sind, wenn Sie die skinsBibliothek vorher laden.

Damit der Pfeil um den Text auf der Seite herumläuft, kann man mit dem Paket tikzpagenodesauf den rechten Textrand verweisen. Der Einfachheit halber habe ich zunächst einige Koordinaten erstellt, die das Ausrichten des Pfeils erleichtern.

\documentclass[
    pdftex,a4paper,11pt,oneside,fleqn,
    bibliography=totoc,listof=totoc,
    headlines=2.1,headsepline,
    numbers=noenddot
]{scrreprt}

%%%----- Mathe ----------------------------------
\usepackage{amsmath,amsfonts,amssymb,bm}
\usepackage[squaren,textstyle]{SIunits}
\usepackage{icomma}
    
\usepackage{mathtools}
\usepackage[makeroom]{cancel}
\usepackage{trfsigns}

%%% ------ Formel schöner darstellen ------------
\usepackage{tcolorbox}
\tcbuselibrary{listings,theorems,skins}
\def\mathunderline#1#2{\color{#1}\underline{{\color{black}#2}}\color{black}}

\usepackage{tikzpagenodes}
\usetikzlibrary{tikzmark}

%%%--------------------------------------------------------
%%%----- Beginn Dokument ----------------------------------
\begin{document}

\begin{equation}
\tcbset{fonttitle=\scriptsize}
 \begin{split}
    \sigma_{\mathrm{n}} &= \sigma_{\mathrm{n}, \nu = 1} + \sigma_{\mathrm{n}, \nu = 1, \mu = 1} + \sigma_{\mathrm{n}, \mu = 1}\\
    &= \Bigg( \dfrac{\hat{B}_{\delta \mathrm{s}, \nu = 1}^{2} + \hat{B}_{\delta \mathrm{r}, \mu = 1}^{2}}{4 \cdot \mu_{0}} + \dfrac{\hat{B}_{\delta \mathrm{s}, \nu = 1} \cdot \hat{B}_{\delta \mathrm{r}, \mu = 1}}{2 \cdot \mu_{0}} \Bigg) \cdot \Big( 1 + \cos \left(2 p \alpha - 2 \omega_{\mathrm{el}} t \right) \Big)\\
    &= \dfrac{\hat{B}_{\delta \mathrm{s}, \nu = 1}^{2} + \hat{B}_{\delta \mathrm{r}, \mu = 1}^{2} + 2 \cdot \hat{B}_{\delta \mathrm{s}, \nu = 1} \cdot \hat{B}_{\delta \mathrm{r}, \mu = 1}}{4 \cdot \mu_{0}} \cdot \Big( 1 + \cos \left(2 p \alpha - 2 \omega_{\mathrm{el}} t \right) \Big)\\
    &= \dfrac{\left( \hat{B}_{\delta \mathrm{s}, \nu = 1} + \hat{B}_{\delta \mathrm{r}, \mu = 1} \right)^{2}}{4 \cdot \mu_{0}} \cdot \Big( 1 + \cos \big(2 p \alpha - \tcboxmath[enhanced,remember as=from,boxsep=1pt,left=2pt,right=2pt,top=1pt,bottom=1pt,colback=white,colframe=red,]{2 \omega_{\mathrm{el}}} \, t \big) \Big) \, \text{.}
 \end{split}
 \label{eq:Radialkraftwelle_Grundwelle}
\end{equation}

Das Ergebnis für das Grundwellen-Luftspaltfeld ist eine Radialkraftwelle, die sich mit einer Frequenz von $f_{\mathrm{h}} = \tikzmarknode{to}{2f_{\mathrm{el}}}$ (1. Hauptordnung) ausbreitet.

\begin{tikzpicture}[overlay, remember picture]
    \coordinate (south of from) at ([yshift=-0.25cm]from.south);
    \coordinate (south of to) at ([yshift=-0.25cm]to.south);
    \coordinate (text margin right) at ([xshift=0.5cm]current page text area.east);
    \draw[thick, red, -stealth, rounded corners=2.5pt] (from.south) -- (south of from) -- 
    (south of from -| text margin right) -- (south of to -| text margin right) -- (south of to) -- (to.south);
\end{tikzpicture}

\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen