Writing a worded mathematical expression

Decide which one is better in your context.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

This is the formula using words:
\begin{equation*}
\begin{pmatrix}\begin{tabular}{@{}c@{}}
Rate of heat \\ conduction \\ at $x$
\end{tabular}\end{pmatrix}
-
\begin{pmatrix}\begin{tabular}{@{}c@{}}
Rate of heat \\ conduction \\ at $x+\Delta x$
\end{tabular}\end{pmatrix}
+
\begin{pmatrix}\begin{tabular}{@{}c@{}}
Rate of heat \\ generation \\ inside the \\ element
\end{tabular}\end{pmatrix}
=
\begin{pmatrix}\begin{tabular}{@{}c@{}}
Rate of change\\ of the energy \\ content of the \\ element
\end{tabular}\end{pmatrix}
\end{equation*}

Let's denote by $R_{\mathrm{hc}}(x)$ the rate of heat conduction at~$x$, 
by $R_{\mathrm{hgi}}$ the rate of heat generation inside the element and
by $\mathit{RC}_{\mathrm{ec}}$ the rate of change of the element's energy
content. Then
\begin{equation*}
R_{\mathrm{hc}}(x)-R_{\mathrm{hc}}(x+\Delta x)+R_{\mathrm{hgi}}
=\mathit{RC}_{\mathrm{ec}}
\end{equation*}

\end{document}

enter image description here


A new macro like \newcommand{\term}[1]{\left(\begin{tabular}{@{}c@{}}#1\end{tabular}\right)} can be very handy in this case:

\documentclass{article}

\newcommand{\term}[1]{\left(\begin{tabular}{@{}c@{}}#1\end{tabular}\right)}

\begin{document}

This is the formula using words:
\[
\term{Rate of heat\\ conduction\\ at $x$}
- \term{Rate of heat\\ conduction\\ at $x+\Delta x$}
+ \term{Rate of heat\\ generation\\ inside the\\ element} 
= \term{Rate of change\\ of the energy\\ content of the\\ element}
\]

\end{document}

enter image description here


Very simple with stackengine:

\documentclass{article}

\usepackage{amsmath}
\usepackage[usestackEOL]{stackengine} 

\begin{document}

\[ \begin{pmatrix}
  \Centerstack{Rate of heat \\ conduction \\at $x$} 
\end{pmatrix} -
 \begin{pmatrix}
  \Centerstack{Rate of heat \\ conduction \\at $x+Δx$}
\end{pmatrix} + 
\begin{pmatrix}
  \Centerstack{Rate of heat \\ generation \\ inside the \\ element} 
\end{pmatrix} =
\begin{pmatrix}
  \Centerstack{Rate of change \\ of the energy \\ content of the \\ element}
\end{pmatrix} \]%

\end{document} 

enter image description here

Tags:

Math Mode