is there any particular way to get something similar to that in tikz with or without any packages?
Asked
Active
Viewed 3,299 times
9
-
2Yes. What have you tried so far? – fractal Jan 01 '20 at 10:54
-
Nothing really since I never used tikz for more then using \addplot. But I searched the site for help and found some questions with arrows between textboxes which is not exactly what I need but made me think that there might be a way to get an equation annotated as well. – Nadine Jan 01 '20 at 10:59
-
Related: https://tex.stackexchange.com/q/522441/134144 – leandriis Jan 01 '20 at 11:10
-
1Does this answer your question? Explain formula using beamer – STJ Nov 22 '22 at 10:25
2 Answers
12
This is a start.
\documentclass{article}
\usepackage[charter]{mathdesign}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usetikzlibrary{arrows.meta}
\begin{document}
\[\tikzmarknode{int}{}\int\limits
_{\tikzmarknode[inner sep=.2em]{a}{a}}
^{\tikzmarknode{b}{b}}\tikzmarknode{f}{f(x)}
\,\tikzmarknode{d}{\mathrm{d}}\tikzmarknode{x}{x}\]
\begin{tikzpicture}[overlay,remember picture,cyan,>=Stealth]
\draw[<-] (int) -- ++ (-1,0) node[left] {{\bfseries Integral}};
\draw[<-] (a) -- ++ (0,-1) node[anchor=168,align=left]
{{\bfseries Some bold text}\\Some lighter text about something};
\end{tikzpicture}
\end{document}
fractal
- 1,500
11
This is a continuation of Fractal's nice answer the purpose of which is to make the formulae fit in the document without overlapping.
\documentclass{article}
\usepackage[charter]{mathdesign}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usetikzlibrary{calc}
\begin{document}
Blah blah blah blah blah blah blah blah blah\dots
\[\int\limits
_{\tikzmarknode{a}{a}}
^{\tikzmarknode{b}{b}}\tikzmarknode{f}{f}(\tikzmarknode{x1}{x})
\,\tikzmarknode{d}{\mathrm{d}}\tikzmarknode{x2}{x}
\begin{tikzpicture}[overlay,remember picture,cyan,>=stealth,shorten
<=0.2ex,nodes={font=\tiny,align=left,inner ysep=1pt},<-]
\draw ([xshift=-0.3ex]b.west|-x2) -- ++ (-1.5em,0) node[left] (l) {\textbf{Integral}};
\draw (a.south) -- ++ (0,-1.5em) node[anchor=north west,align=left,xshift=-1.2ex]
(u) {\textbf{Untergrenze}\\ Untere integrationsgrenze};
\draw (b.north) -- ++ (0,1.5em) node[anchor=south west,align=left,xshift=-1.2ex]
(o) {\textbf{Obergrenze}\\ Obere integrationsgrenze};
\path (x1.north) ++ (0,1.5em) node[anchor=south west,xshift=-1.2ex] (il)
{\textbf{Integrand}\\ Funktion \"uber die integriert werden soll};
\draw (x1.north) |- ([xshift=0.3ex]il.south east);
\path (d.south) ++ (0,-1.5em) node[anchor=north west] (diff)
{\textbf{Differtential}};
\draw (d.south) |- ([xshift=0.3ex]diff.south east);
\draw ([xshift=0.3ex]x2.east) -- ++ (1.5em,0) node[right] (r)
{\textbf{Integrationsvariable}\\ Der Integrand wird \"uber $x$ integriert};
\path let \p1=($(o.north)-(u.south)$),\p2=($(r.east)-(x2.east)$),
\p3=($(a.west)-(l.west)$),\n1={\x2-\x3} in
\pgfextra{\xdef\tmpvspace{\y1}\xdef\tmphspace{\n1}};
\end{tikzpicture}\vcenter{\vspace{\tmpvspace}}
\hspace{\tmphspace}
\]
Blah blah blah blah blah blah blah blah blah\dots
\[E=m\,c^2\]
\end{document}
If you comment out \hspace{\tmphspace} you get
-
1Thank you so much! This is perfect! I was trying do edit Fractal's answer to add the snaped arrows but could not get the text above the line. That really helps. Thanks again and happy New Year. – Nadine Jan 01 '20 at 12:55
-
-
1@jsbibra forest is great for trees, and not necessarily ideal for what is asked here. – Feb 14 '20 at 03:52
-
@Schrödinger'scat agreed-- just wanted to know if there was a way to choose different anchor points on a parent like its done with tikzmarknode – js bibra Feb 14 '20 at 03:54



