I'm sorry if I'm using incorrect terminology, I'm pretty new to LaTeX.
My question is: how would one recreate image such as:
That is, basically, how does one create these lines with labels?
I'm sorry if I'm using incorrect terminology, I'm pretty new to LaTeX.
My question is: how would one recreate image such as:
That is, basically, how does one create these lines with labels?
A solution with tikz.
Remember to put some \vspace{...} before and after, because with the overlay option, the tikzpicture has zero size, look at this answer for a more detailed explanation.
\documentclass{book}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{tikzmark, calc}
\begin{document}
A solution with Ti\emph{k}Z:
\vspace{4ex}
{\Large
\begin{equation*}
\tikzmark{sum}\sum_{\tikzmark{ind}i=\tikzmark{un}1}^{\tikzmark{up}n} = {x}_{i}\tikzmark{elem}
\end{equation*}}
\begin{tikzpicture}[overlay,remember picture]
\draw ($(pic cs:sum)+(.1,.15)$) -- ($(pic cs:sum)+(-.85,.15)$)
node[anchor=east]
{\footnotesize summation sign};
\draw ($(pic cs:ind)+(.07,-.08)$) |- ($(pic cs:ind)+(-1,-.3)$)
node[anchor=east,text width=3cm]
{\vspace{-1ex}
\begin{flushright}
\footnotesize
index of \\
summation
\end{flushright}};
\draw ($(pic cs:up)+(.09,.25)$) |- ($(pic cs:upb)+(6.6,2.1)$)
node[text width=7cm, anchor=west]
{\vspace{-1ex}
\begin{flushleft}
\footnotesize
stopping point \\
upper limit of summation
\end{flushleft}};
\draw ($(pic cs:elem)+(.1,.15)$) -- ($(pic cs:elem)+(.9,.15)$)
node[anchor=west, text width=3cm]
{\footnotesize typical element};
\draw ($(pic cs:un)+(.09,-.08)$) |- ($(pic cs:un)+(1,-.3)$)
node[anchor=west, text width=7cm]
{\vspace{-1ex}
\begin{flushleft}
\footnotesize
starting point\\
lower point of summation
\end{flushleft}};
\end{tikzpicture}
\vspace{7ex}
Some \textbackslash\texttt{vspace} before and after is necessary.
\end{document}
calc library, for example.
– CarLaTeX
Feb 21 '17 at 20:40
\vspace{...} before and after my code, look at the note I added to my answer.
– CarLaTeX
Feb 21 '17 at 21:44
below, right, etc. or things like that. But I'm a beginner and this solution is quicker for me... Don't forget to accept the answer you prefer!
– CarLaTeX
Feb 22 '17 at 06:23
There is also a solution based on pstricks:
\documentclass[12pt]{article}
\usepackage{amssymb,amsmath}
\usepackage{xcolor}
\usepackage[T1]{fontenc}
\usepackage{pstricks,pst-node,pst-blur}
\begin{document}
\begin{tabular}{rcl}
&
\ovalnode[shadow=true,blur=true]{stop}{\tiny\begin{tabular}{l}
stopping point\\
upper limit of summation
\end{tabular}} &\\[1cm]
\ovalnode[shadow=true,blur=true]{sign}{\tiny summation sign}
& $\rnode[c]{sum}{\displaystyle\sum\limits_{\rnode[c]{i}{\scriptstyle i}=\rnode[c]{1}{\scriptstyle 1}}
^{\rnode[c]{n}{\scriptstyle n}}} \rnode[c]{x}{x_i}$ &
\ovalnode[shadow=true,blur=true]{typ}{\tiny typical element}
\\[1cm]
\ovalnode[shadow=true,blur=true]{index}{\tiny\begin{tabular}{r}
index of\\
summation
\end{tabular}} & &
\ovalnode[shadow=true,blur=true]{start}{\tiny\begin{tabular}{l}
starting point\\
lower point of summation
\end{tabular}}
\end{tabular}
\ncarc{->}{stop}{n}
\ncarc{->}{sign}{sum}
\ncarc{->}{typ}{x}
\ncarc{->}{sign}{sum}
\ncarc{->}{start}{1}
\ncarc{->}{index}{i}
\end{document}
\endinput