How can I add an explanation under an equal sign in Lyx (/Tex)?

Using an underbrace or the like might do what you want. To prevent the text in the underbrace from affecting the spacing of your equation, you could use \mathclap, which is not currently supported in LyX 2.0.x. It will be supported in LyX 2.1 though and instructions are below. If you use Ubuntu, there is a PPA for LyX 2.1 that makes it very easy to install. Ask if you would like instructions.

  1. Add the underbrace: enter image description here

  2. Press the right arrow once so that you are just to the right of the underbrace.

  3. Enter a subscript (in cua binding it is the underscore).
  4. Enter "\mathclap" and press space or "{" after the p. You will see an empty red box show up with two arrows pointing at each other.
  5. Press "ctrl+m" to make a text box.
  6. Enter your text.

enter image description here

If you want, select the other math inset and go to Insert > Preview. If you have preview turned on in the preferences, you will get:

enter image description here


For very short things (without arrow) you could use the \underset (or \stackrel) command. For more fancy annotations you could mix equations with tikz, as shown here: http://www.texample.net/tikz/examples/beamer-arrows/ see also https://sites.google.com/site/kaarebmikkelsen/in-the-news/fancyequationsinlatexbeamerwithtikz

To provide a minimal example:

\documentclass{article} %

\usepackage{tikz}
\usepackage{amsmath}

\usetikzlibrary{arrows,shapes,calc}


\begin{document}
\tikzstyle{every picture}+=[remember picture]
\everymath{\displaystyle}

Using tikz:

\begin{equation*}
   x
   \tikz[baseline=-1pt]{
     \node (eq)
     {$=$};
   }
   y
\end{equation*}


\begin{tikzpicture}[overlay]
   \node (t) at ($(eq) + (-0.5,-0.5)$) {\footnotesize Explanation};
   \path[->,shorten >= 6pt] (eq.base) edge [bend left=10] (t.mid) ;
\end{tikzpicture}


Using underset:

\begin{equation*}
   x \underset{\mathrm{def}}{=} y
\end{equation*}

\end{document}

Output

output


This is rather an improvement of students answer. You can combine underset or overset with TikZ and lapping. Look at this:

\documentclass{article}
\usepackage{tikz,mathtools}
\begin{document}

\begin{equation*}
  x
  % with tikzpicture environment
  \underset{\mathllap{
    \begin{tikzpicture}
      \draw[->] (-0.3, 0) to[bend right=20] ++(0.3,2ex);
      \node[below left] at (0,0) {because $x = y$};
    \end{tikzpicture}
  }}{=}
  y + x - x
  % with tikz command
  \overset{\mathclap{\tikz \node {$\downarrow$} node [above=1ex] {trivial};}}{=}
  y + y - y
\end{equation*}

\end{document}

Output: LaTeX output as picture showing formula and reasoning

Tags:

Lyx

Equations