TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to include a Mathematica code in LaTeX. To do that, I just exported the code as PDF. The thing is that when I am trying to include the PDF figure in my TeX code, the figure is printed on the next page.

The code I am using is


\nonumber W_{r\rightarrow\infty}=&-\int_{r}^{\infty}\!F\,\mathrm{d}y=-\int_r^\infty \!     \dfrac{1}{4\pi \epsilon_0} \dfrac{q^2}{\alpha^2} \dfrac{\alpha^3}{y^3}\left(1-    \dfrac{\alpha^2}{y^2}\right)^{-2}\,\mathrm{d}y\\
=&-\dfrac{1}{4\pi \epsilon_0} \dfrac{q^2}{\alpha^2}\alpha^3 \underbrace{\int_r^\infty     \! y^{-3} \left(1-\dfrac{\alpha^2}{y^2}\right)^{-2} \,\mathrm{d}y}_{I} \label{eq:WcondI}


The image can be downloaded from here https://dl.dropbox.com/u/19828093/math.pdf

Any ideas on that?

share|improve this question
The H option is defined by the float package. If you want the image there with no caption, just use the center environment and not figure. – egreg Nov 28 '12 at 16:12
@egreg:I didn't know...I should have, though...Thank you very much for the educative information! – Thanos Nov 28 '12 at 16:17
up vote 3 down vote accepted

The [H] option is only defined by the float package. In your case, the unknown option is changed into [p].

However you don't need at all a figure environment, since you don't have a caption. The \includegraphics command can go everywhere, even in math.

With the following code you will be sure that the Mathematica code will never be detached from the equation (unless you allow it with \displaybreak):




  -\int_{r}^{\infty} F \diff y=
  -\int_r^\infty \dfrac{1}{4\pi \epsilon_0} \dfrac{q^2}{\alpha^2} \dfrac{\alpha^3}{y^3}
    \left(1-\dfrac{\alpha^2}{y^2}\right)^{-2}\diff y\\
  -\dfrac{1}{4\pi \epsilon_0} \dfrac{q^2}{\alpha^2}\alpha^3
    \underbrace{\int_r^\infty y^{-3} \left(1-\dfrac{\alpha^2}{y^2}\right)^{-2} \diff y}_{I}

Notice how I corrected your input of the equation, that shows some flaws.

enter image description here

share|improve this answer

[H] is not defined by default. I'd simply recommend writing [htp] instead, works just as well, but the float will move if there is no room for it, and the rest of the page will be used for text.

share|improve this answer
Thank you very much for your answer! I replaced H with h! and it's working. What do you mean that "[H] is not defined by default"? I thought that H and h! are the same... Perhaps I am mistaken! – Thanos Nov 28 '12 at 16:08
It's not the same. AFAIR the here package defines H – Uwe Ziegenhagen Nov 28 '12 at 16:22
@UweZiegenhagen From texdoc here one learns that "The original here.sty by David Carlisle was withdrawn many years ago. The [H] modifier is now implemented in float.sty, which this here.sty simply reads." – egreg Nov 28 '12 at 16:28
@egreg, I guess it should go into L2Tabu then. I'll check it. – Uwe Ziegenhagen Nov 28 '12 at 17:17

Your Answer


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.