2

enter image description here

I have not tried this yet and have no ideas for this? could anyone can help? Thank you very much in advance!!

Zarko
  • 296,517
Timj
  • 45
  • 4
    If you search the site for "highlight equation", "highlight equation with arrows" (that are sensible titles for a question; your title helps little here ;-) ) and browse the tag tikzmark you'll find plenty of examples. – Rmano Feb 10 '21 at 08:13
  • For example: https://tex.stackexchange.com/questions/140529/graphics-equations-put-text-on-equations https://tex.stackexchange.com/questions/450135/tikzmark-arrows-exponents-and-bases – Rmano Feb 10 '21 at 08:16
  • yes, many thanks! I have had no keyword for searching! – Timj Feb 10 '21 at 08:44
  • I took a liberty and change title of your question that bow better correspond to your problem. If you not liked, you can revert my edition. – Zarko Feb 10 '21 at 11:46

1 Answers1

6

This could be a solution combining tcolorbox and TiKZ.

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{mathtools}
\usetikzlibrary{decorations.pathreplacing}

\tcbset{ boxmath/.style 2 args={% enhanced, sharp corners, colback=white, colframe=#1, remember as=#2, size=fbox} }

\begin{document} [ e^x=\tcboxmath[boxmath={blue}{approx}]{1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\dots++\frac{x^n}{n!}}+\tcboxmath[boxmath={red}{trunc}]{\frac{x^{n+1}}{{n+1}!}+\dots} ]

\begin{tikzpicture}[remember picture, overlay, font=\sffamily] \draw[blue,->] (approx.north) --++(120:5mm) node[anchor=south]{Approximation}; \draw[red,->] (trunc.north) --++(70:5mm) node[anchor=south]{Truncation Errors}; \draw[decorate, decoration={brace, mirror, raise=3pt, amplitude=2mm}] (approx.south west)--(trunc.south east) node[below=3mm, midway]{Exact mathematical formulation}; \end{tikzpicture} \end{document}

enter image description here

Ignasi
  • 136,588