3

I prepared the following document

\documentclass[12 pt]{report}
\usepackage{tikz,amsmath}
\begin{document}
     \begin{tikzpicture}[]
            $De = Re\sqrt{\frac{D}{2R_C}}$
            \draw[->] (-1.35,0.4) ..controls (-1.2,1) and (-0.5,1.5) .. (-0.2,1.5) node[right] {Reynolds number};
            \draw[->] (-2.35,0.4) .. controls (-2.35,0.9) and (-2.75,1)   .. (-3.5,0.3) node[left] {Dean number};
            \draw[->] (-0.15,0.3) .. controls (0.3,0.7) and (0.25,-0.4) .. (0.6,-0.3) node[right] {Hydraulic diameter};
            \draw[->] (-0.25,-0.275) .. controls (-0.5,-1)  .. (-1.5,-1) node[left] {Path curvature radius};
    \end{tikzpicture}
\end{document}

Which gives, enter image description here

But due to the math mode 'De' and 'Re' becomes italic, I don't want that. But if I try \text{} for 'De' and 'Re', it is not working. Please help me to change 'De' and 'Re' into a normal text instead of italic.

Also, I am new to tikz. So, is there any other way to create the pictorial definition of each term in a equation as shown in the picture above?

4
  • 2
    You can try \mathrm: $\mathrm{De} = \mathrm{Re}\sqrt{\frac{D}{2R_C}}$. May 2, 2021 at 16:33
  • 2
    Not related but you could have used tikzmark to create nodes and draw your arrows.
    – SebGlav
    May 2, 2021 at 17:09
  • I surprised that works at all, text placed directly inside a tikzpicture is normally ignored. You should place the equation in a node, like the other text you have in there. May 2, 2021 at 17:25
  • @JuanCastaño Thanks, it works and it is simple and easy! May 3, 2021 at 3:05

1 Answer 1

5

A solution using tikzmark library and accepting \text{}.

tikzmark equation

\documentclass[12pt]{report}
\usepackage{tikz,amsmath}
\usetikzlibrary{tikzmark,calc}

\begin{document}
    \tikzset{every node/.style={outer sep=2pt}}

    \[
    \tikzmarknode{De}{\text{De}} = \tikzmarknode{Re}{\text{Re}}\sqrt{\frac{{\tikzmarknode{D}{D}}}{\tikzmarknode{2RC}{2R_C}}}
    \]
    
    \begin{tikzpicture}[remember picture,overlay]
        \draw[->] (De.north) to[out=90,in=45,looseness=1.5] ($(De)+(-1,0)$) node[left] {Dean number};
        \draw[->] (Re.north) to[out=90,in=180] ($(Re)+(1.2,1.2)$) node[right] {Reynolds number};
        \draw[->] (D.east) to[out=45,in=190] ($(D)+(1.5,-1)$) node[right] {Hydraulic diameter};
        \draw[->] (2RC.south) to[out=-90,in=0] ($(2RC)+(-1.5,-1)$) node[left] {Path curvature radius};
    \end{tikzpicture}
    
\end{document}

Note that you may need two compilations to make it right, since the nodes have to be computed before arrows could be drawn.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .