Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I write some equation with pen and paper I usually do something like in the following picture: enter image description here

Is there a way to do something similar in Lyx (my working environment) /Tex ? That is: having an arrow or something like that that refers to the $=$ sign and have some (short) text near

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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

share|improve this answer
add comment

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

share|improve this answer
    
Nice. And for many other LaTeX solutions like this, see tex.stackexchange.com/questions/42613/… –  scottkosty Oct 31 '12 at 8:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.