## LaTeX forum ⇒ LyX ⇒ Rotated floating Figure Error

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Brukernavn
Posts: 8
Joined: Mon Jul 11, 2011 3:27 pm

### Rotated floating Figure Error

Hi,

I'm using Lyx 2.0, and tried to rotate a floating figure by checking the "rotate 90 deg" box in the float settings. But when I wanted to view the output I got the following error:
LaTeX Error: File rotfloat.sty' not found.

I've had the same error with the *.sty files units.sty, nicefrac.sty and rotating.sty. They were all solved by:
- Placing them in the correct MikTex folder (C:\Documents and Settings\User\Application Data\MikTex\tex\latex\contrib\)
- Refreshing the MikTex file name database
- Reconfiguring Lyx and restarting it.

By this approach the problems with the other *.sty files were solved. But when I did the same with rotfloat.sty (placed in C:\Documents and Settings\User\Application Data\MikTex\tex\latex\contrib\rotfloat\rotfloat.sty) I got the following error for all the included graphics in the document:
LaTex Error: Cannot determine size of graphic in 0F_FolderName_GraphicName.pdf (no BoundingBox).
Floating graphic works fine, I can even rotate the graphic itself, but I get this error when I rotate only one of the floats.

Anyone have a solution?
I've attached an example lyx file with an *.eps graphic that gives me this error (but works great when the float is not rotated). I've also included the rotfloat.sty file that I donwloaded.
Attachments
Example file.zip
Last edited by Brukernavn on Tue Jul 12, 2011 2:53 pm, edited 1 time in total.

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm
The .eps file is missing. Please attach it to your next post. I tested the file you provided using an .eps image created in Inkscape, no problems. You might also want to try converting .eps file to .pdf and try with it instead.

Brukernavn
Posts: 8
Joined: Mon Jul 11, 2011 3:27 pm
Thanks for the quick reply! I've attached the .eps file.
I tried converting the file to pdf, but I got the same error. Did you use the attached rotfloat.sty file? I think that's what causing my problem. I'm having trouble with MikTex package manager not being able to connect, so I have to install the .sty packages myself.
Attachments
Graphic.eps

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm
Hmmm, still works fine with TeXLive 2010, on Linux. Did you try exporting your document to "LaTeX (plain)" and running pdflatex on the .tex file?

Yes, I noticed rotfloat.sty file, tried with and without it (though it is exactly the same version as the one installed on my machine).

And, finally, try creating a folder directly on C:\, e.g. C:\Test, put files in that folder and try compiling your doc. I wouldn't be surprised if it turns out that a space in the path to your doc is responsible for the issue.

Brukernavn
Posts: 8
Joined: Mon Jul 11, 2011 3:27 pm
I exported the document to "LaTex (plain)" and ran the pdflatex in the .tex file now. The code is:
%% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.%% Do not edit unless you really know what you are doing.\documentclass[english]{article}\usepackage[T1]{fontenc}\usepackage[latin9]{inputenc}\usepackage{rotfloat}\usepackage{graphicx}\usepackage{babel}\begin{document}\begin{sidewaysfigure}\includegraphics{Graphic} \caption{Text.}\end{sidewaysfigure} \end{document}

At least a pdf showed up this time, but I still got an error, although a different one:
LaTex errors
C:NewFolder\test.tex | 11 | Overfull \hbox (16.11499pt too wide) in paragraph at lines 11--12.

Running the .lyx file from the same folder gives me the same error as before.
I've included the output pdf from the .tex file as well.
Attachments
test.pdf

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm
That's a warning, saying that the image is a little bit too big. Try setting scale option to \includegraphics command, e.g.,
\includegraphics[scale=0.95]{Graphic}`

So, now the figure isn't rotated at all. I'm not sure what the problem is, that code you posted compiles normally on my machine. Try running test.tex from the attachment, which contains all packages used during the compilation process. If the output is OK, try eliminating one package at a time and running pdflatex again to see which one was causing this issue.
Attachments
test.pdf
PDF Output.
Test.zip

Brukernavn
Posts: 8
Joined: Mon Jul 11, 2011 3:27 pm
Thanks a lot, that solved it!

It seems the problem was with my 'rotating.sty' file. It was one of the missing .sty files that I installed manually. The one you provided was different than mine, and when replaced rotating floats worked like a charm. I even tried it in Lyx with .jpeg and .bmp with no problems.

sommerfee
Posts: 500
Joined: Mon Apr 09, 2007 4:20 pm
Brukernavn wrote:It was one of the missing .sty files that I installed manually.

Why aren't you using the MikTeX package manager to install packages? This way you always get the latest versions and can easily update your TeX system (if necessary).

Brukernavn
Posts: 8
Joined: Mon Jul 11, 2011 3:27 pm
As I said in one of my posts it's not working as it should:
Brukernavn wrote:I'm having trouble with MikTex package manager not being able to connect, so I have to install the .sty packages myself.

I created a topic in the MikTex subforum to try to sort out the issue:
viewtopic.php?f=9&t=14111