# How to write the definition of each term in an equation with pointing arrows?

Can someone help me in writing equation as given below

UTMThesis.sty is given here

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The package UTMthesis.sty will produce the output    %
% of a thesis according to UTM Thesis Manual,          %
% School of Graduate Studies, 2007.                    %
% Yusof Yaacob, Department of Mathematical Sciences,             %
% Faculty of Science,  Universiti Teknologi Malaysia   %
% 81310 Johor Bahru, Malaysia                          %
% e-mail: yusofby@utm.my                               %
% 24 December 2009                                     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX cod for chapter header
\makeatletter
%\vspace*{20\p@}   %  \vspace*{15\p@}
{\parindent \z@
\centering
\normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter

\normalsize
\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 1.4\baselineskip
\fi
\fi
\interlinepenalty\@M
\normalsize
\bfseries #1\par\nobreak
\vskip 1.4\baselineskip %
}}
\def\@schapter#1{\if@twocolumn
\else
\fi}
%\vspace*{20\p@} % \vspace*{20\p@} %
{\parindent \z@
\centering
\normalfont
\interlinepenalty\@M
\normalsize
\bfseries  #1\par\nobreak
\vskip 1.4\baselineskip
}}
\makeatother
\renewcommand{\chaptername}{CHAPTER}
%------------------------------------------------------------
% Commands for layout
%\setlength{\topmargin}{-1.2cm}
%\setlength{\oddsidemargin}{1.7cm}   %\setlength{\oddsidemargin}{1.46cm}
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{24.5cm} %  \setlength{\textheight}{24.5cm}
%-------------------------------------------------------------
% Command for 1.5 spacing
%\renewcommand{\baselinestretch}{1.5}
\usepackage{doublespace}
\setstretch{1.5}
%-------------------------------------------------------------
% Command for  indentation
\setlength\parindent{.5in}
\usepackage{indentfirst} %1st line indented after section...
%-------------------------------------------------------------
% Command for space between paragraph
\makeatletter
%\setlength{\parskip}{1.5\baselineskip \@plus 3ex
%  \@minus 2.0ex}
\setlength{\parskip}{2\baselineskip \@plus .01ex
\@minus .01ex}
\makeatother
%-------------------------------------------------------------
% Commands for no hyphenation and right justified
\hyphenpenalty=10000 \sloppy
\raggedbottom
%-------------------------------------------------------------
% Command to get rid of default running head
%-------------------------------------------------------------
% Command for  page number
%  \makeatletter
%    \renewcommand{\ps@plain}{%
%    \renewcommand{\@evenfoot}{}
%    \renewcommand{\@oddfoot}{}  }
%   \makeatother
%-----------------------------------------------------------------

%For section font
% \usepackage{sectsty}
%  \chapterfont{\centering\normalsize\uppercase}
%  \sectionfont{\normalsize\uppercase}
% \subsectionfont{\normalsize}
% \subsubsectionfont{\itshape\normalsize}
%---------------------------------------------------------
%--------------------------------------------------------------
% Commands for REFERENCES name
\renewcommand{\bibname}{REFERENCES}
%--------------------------------------------------------------
% Commands to change vertical space in section and subsection
\makeatletter
\renewcommand{\section}{\@startsection
{section}%      % the name
{1}             % the level
{0cm}           % the indent
{1.0cm}         % the beforeskip
{0.01cm}    %{0.5cm}    % the afterskip
{\normalfont\normalsize\bfseries} } % the style
\renewcommand{\subsection}{\@startsection
{subsection}%   % the name
{2}             % the leve2
{0cm}           % the indent
{1.0cm}         % the beforeskip
{0.01cm} %{0.5cm}        % the afterskip
{\normalfont\normalsize\bfseries} } % the style
\makeatother
%--------------------------------------------------------------
% Commands to change horizontal space in section and subsection
% for times romans
\renewcommand{\thesection} % space between sect. etc.
{\thechapter.\arabic{section}\hspace{.12in}}
\renewcommand{\thesubsection}
{\thesection\hspace{-.3cm}.\arabic{subsection} \hspace{-.135cm}}
%--------------------------------------------------------------
% Commands for  TocLoFT
\usepackage{tocloft}
%\cftsetrmarg{2.75cm} %
\cftsetrmarg{1.5cm} %
\cftsetpnumwidth{1.25cm}
%\cftsetpnumwidth{1.25cm}
\renewcommand{\cftdot}{} % get rid of dots
\renewcommand{\contentsname}{}        % off tocname
\setlength{\cftchapindent}{.8cm}      % chapter indent
\setlength{\cftsecindent}{2.3cm}      % section indent
\setlength{\cftsubsecindent}{3.25cm}  % subsection indent
\setlength{\cftchapnumwidth}{1.45cm}  % chp number width
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  \renewcommand{\cftchapafterpnum}{\rule{1.75ex}{0ex}}
%   \renewcommand{\cftsecafterpnum}{\rule{1.75ex}{0ex}}
%   \renewcommand{\cftsubsecafterpnum}{\rule{1.75ex}{0ex}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftchapafterpnum}{\rule{0.75ex}{0ex}}
\renewcommand{\cftsecafterpnum}{\rule{0.75ex}{0ex}}
\renewcommand{\cftsubsecafterpnum}{\rule{0.75ex}{0ex}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftchappagefont}{\normalfont}
%-------------------------------------------------------------
%List of Table
\setlength{\cfttabnumwidth}{2.5cm}  %\setlength{\cfttabnumwidth}{2.5cm}
\renewcommand{\listtablename}{} % off lotname
%\setlength{\cfttabindent}{-.015cm}      % table indent %%%%%%%%%%%%%%%%%%
\setlength{\cfttabindent}{-.1cm}      % table indent %%%%%%%%%%%%%%%%%%
\renewcommand{\cfttabafterpnum}{\rule{2ex}{0ex}}
\cftsetrmarg{3cm}
%------------------------------------------------------------
%List of Figure
\setlength{\cftfignumwidth}{2.5cm}
\renewcommand{\listfigurename}{} % off lofname
\setlength{\cftfigindent}{-.1cm}      % figure indent %%%%%%%%%%%%%%%%%%
\renewcommand{\cftfigafterpnum}{\rule{2ex}{0ex}}
%-------------------------------------------------------------
%-------------------------------------------------------------
% Command for bold caption
\makeatletter
\long\def\@makecaption#1#2{\vskip 10\p@   % caption parameter
\setbox\@tempboxa\hbox{{#1\,\,\,\,\,} #2} %%%%%
\ifdim \wd\@tempboxa >\hsize         % caption parameter
{#1\,\,\,\,\,}  #2\par  % caption parameter
\else                                   % caption parameter
\hbox to\hsize{\hfil\box\@tempboxa\hfil}  % caption parameter
\fi}                                            % caption parameter
\makeatother
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
%--------------------------------------------------------------
\usepackage{paralist} %refine list item
%--------------------------------------------------------------
\usepackage{latexsym,amsmath,amssymb} % math symbols
%--------------------------------------------------------------
\usepackage{graphicx} % .eps graphic
%--------------------------------------------------------------
\usepackage{lscape} % for landscape
%--------------------------------------------------------------
\usepackage{times}
%--------------------------------------------------------------
% Theorem-Like-Environment
\usepackage{theorem}
{\theorembodyfont{\upshape}
\newtheorem{lemma}{Lemma}[chapter]
\newtheorem{theorem}{\rule{0ex}{5ex}Theorem}[chapter]
\newtheorem{corollary}{Corollary}[chapter]
\newtheorem{proposition}{Proposition}[chapter]
\newtheorem{definition}{\rule{0ex}{5ex}Definition}[chapter]
\newtheorem{example}{Example}[chapter] }
%--------------------------------------------------------
\newenvironment{proof}{\begin{paragraph}
{Proof}\vspace{-1cm}}{\end{paragraph}}
\newenvironment{solution}{\begin{paragraph}
{Solution}\vspace{-1cm}}{\end{paragraph}}
%-----------------------------------------------------------

• I can't see an underprice, but perhaps this thread allows you to get what you want. – user194703 Feb 13 '20 at 4:26
• @Schrödinger'scat thank you for the correction. I changed it. kind regards, Bibigul – Bibigul Feb 13 '20 at 4:30
• with forest and colortbl – js bibra Feb 13 '20 at 5:48
• – Steven B. Segletes Feb 16 '20 at 3:19

It is not difficult to create something like this except for punching in the text.

\documentclass[fleqn]{article}
\usepackage{amssymb}
\usepackage{relsize}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{tikzmark,positioning}
\begin{document}
\lipsum[1]

\begingroup\larger[4]
$\tikzmarknode{n1}{\rho\frac{D\vec V}{Dt}}~=~\tikzmarknode{n2}{-\nabla p} + \tikzmarknode{n3}{\rho\vec g}+\tikzmarknode{n4}{\mu\nabla^2\vec V}$
\endgroup
\noindent
\begin{tikzpicture}[remember picture,shorten <=1mm,font=\footnotesize\sffamily]
\begin{scope}[nodes={text width=6.5em,align=left},node distance=1ex]
\node (e1) {\underline{Total derivative}};
\node[right=of e1.north east,anchor=north west] (e2) {\underline{Pressure gradient}\1em] Fluid flows in the direction\dots}; \node[right=of e2.north east,anchor=north west] (e3) {\underline{Body force term}\\[1em] External forces\dots}; \node[right=of e3.north east,anchor=north west] (e4) {\underline{Diffusion term}\\[1em] For a Newtonian fluid\dots}; \end{scope} \node[below=0.5ex of e1.south] (eq){=}; \node[below=0.5ex of eq] (tot) {\rho\left[\frac{\partial \vec V}{\partial t} +\left(\vec V\cdot\vec\nabla\right)\vec V\right]}; \path (tot.south west) -- (tot.south east) coordinate[pos=0.25] (tot1) coordinate[pos=0.75] (tot2); \node[below left=2ex and 0ex of tot.south,text width=4em,align=left] (c1) {Change of velocity}; \node[below right=2ex and 0ex of tot.south,text width=4em,align=left] (c2) {Convective term}; \draw[cyan,-stealth] (c1) -- (tot1); \draw[cyan,-stealth] (c2) -- (tot2); \begin{scope}[overlay] \foreach \X in {1,...,4} {\draw[cyan,-stealth] (e\X) -- (n\X);} \end{scope} \end{tikzpicture}\par \lipsum[2] \end{document}  • I tried but it is not working, It gives an error : Undefined control sequence. \usetikzlibrary – Bibigul Feb 13 '20 at 5:58 • @Bibigul Did you compile the above example as is? – user194703 Feb 13 '20 at 5:59 • @Bibigul If you have a standard TeX installation containing tikz, it should work. – user194703 Feb 13 '20 at 6:18 • @Sebastiano I know. It looks like Vincent has edited the code and fixed the typo (Thanks!) in the code. – user194703 Feb 13 '20 at 17:07 • @Bibigul I think this should not happen with any normal style file. It is very hard to debug this because I do not know how you are using this style file. When I add \usepackage{UTMThesis} to the above code it crashes regardless of whether I have any of the TikZ stuff in. You will get the most competent answer if you ask a separate question and attract some package-writing expert to your problem. – user194703 Feb 16 '20 at 2:47 Attempting with a combination of maths + colortbl + forest The first part is to get maths + colortbl on board And we get --- ## MWE for the first part \documentclass[fleqn]{article} \usepackage{amssymb} \usepackage{xcolor} \usepackage{graphicx} \usepackage{tcolorbox} \tcbuselibrary{skins} \definecolor{boxTitle}{HTML}{fff79a} \definecolor{boxBackground}{HTML}{fffce0} \definecolor{boxFrame}{HTML}{f1e2b8} \tcbset{my box/.style={ enhanced, fonttitle=\bfseries, colback=boxBackground, colframe=boxFrame, coltitle=black, colbacktitle=boxTitle, attach boxed title to top left={xshift=0.3cm, yshift*=-\tcboxedtitleheight/2}, boxed title style={ before upper=\hspace*{0.5cm}, % reserve space for the image overlay={ \node at ([xshift=0.5cm]frame.west) {\includegraphics[scale=0.65]{bc-dodecaedre}}; } } } } \newtcolorbox{mybox}[1][]{my box, #1} \begin{document} \begin{mybox}[title=Momentum Equation] \[ {\rho\frac{D\vec V}{Dt}}~=~{-\nabla p} + {\rho\vec g}+{\mu\nabla^2\vec V }
\end{mybox}
\end{document}


Will now integrate with forest for the definitions

Requires some study of the book methinks --let me see and revert

## With forest

MWE

\documentclass[fleqn]{article}
\usepackage{forest}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{tcolorbox}

\begin{document}
\begin{forest}
for tree= {math content,
parent anchor=children,
child anchor=parent,
},
before typesetting nodes={where n children=0{
no edge,
draw,
densely dotted,
content/.wrap value={\strut#1},
rounded corners,
replace by ={[,circle,fill,no edge,inner sep=0pt,minimum size=5pt,append]}  }{}
}
[
{\rho\frac{D\vec V}{Dt}}~=~{-\nabla p} + {\rho\vec g}+{\mu\nabla^2\vec V}
[Total\ Derivative[,phantom]]
]
\end{forest}
\end{document}


The entire equation does not reproduce in the compiled output--only the first derivative comes through--any ideas? -- but was able to get the label part under the eqn-- that made me happy

## EDIT2

I got the entire equation into the forest environ by surrounding the = with braces {}

Before--

{\rho\frac{D\vec V}{Dt}}~=~{-\nabla p} + {\rho\vec g}+{\mu\nabla^2\vec V}


After--

{\rho\frac{D\vec V}{Dt}}{~=~}{-\nabla p} + {\rho\vec g}+{\mu\nabla^2\vec V}


• "The first part is to get maths + colortbl" : currently there is no use of colortbl in your MWE and to be honest I can't imagine how it should help here. Probably you meant tcolorbox? Please comment on that. – leandriis Feb 13 '20 at 6:49
• @leandriis yes you are right - actually I meant colortable and used the short form colortbl but the actual code used is for tcolorbox - good obsesrvation-- now how to integrate with forest --any suggestions please – js bibra Feb 13 '20 at 6:51