带标题行的方程式

带标题行的方程式

如果我使用的术语不正确,我很抱歉,我对 LaTeX 还很陌生。

我的问题是:如何重新创建如下图像:

在此处输入图片描述

也就是说,基本上如何创建带有标签的这些线条?

答案1

一个解决方案tikz

\vspace{...}记得在前面和后面放一些,因为有了overlay选项,tikzpicture大小为零,看看这个答案以获得更详细的解释。

\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}

在此处输入图片描述

答案2

还有一种基于 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

在此处输入图片描述

相关内容