LaTeX forum ⇒ LyXRotated 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

Postby Brukernavn » Mon Jul 11, 2011 5:10 pm

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:
- Downloading the *.sty files manually
- 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
(2.61 KiB) Downloaded 179 times
Last edited by Brukernavn on Tue Jul 12, 2011 2:53 pm, edited 1 time in total.

User avatar
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Postby meho_r » Mon Jul 11, 2011 5:58 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

Postby Brukernavn » Tue Jul 12, 2011 8:39 am

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
(80.82 KiB) Downloaded 213 times

User avatar
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Postby meho_r » Tue Jul 12, 2011 9:42 am

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

Postby Brukernavn » Tue Jul 12, 2011 10:23 am

I exported the document to "LaTex (plain)" and ran the pdflatex in the .tex file now. The code is:
  1. %% LyX 2.0.0 created this file. For more info, see http://www.lyx.org/.
  2. %% Do not edit unless you really know what you are doing.
  3. \documentclass[english]{article}
  4. \usepackage[T1]{fontenc}
  5. \usepackage[latin9]{inputenc}
  6. \usepackage{rotfloat}
  7. \usepackage{graphicx}
  8. \usepackage{babel}
  9. \begin{document}
  10. \begin{sidewaysfigure}
  11. \includegraphics{Graphic}
  12.  
  13. \caption{Text.}
  14. \end{sidewaysfigure}
  15.  
  16. \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
(4.88 KiB) Downloaded 142 times

User avatar
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Postby meho_r » Tue Jul 12, 2011 1:26 pm

That's a warning, saying that the image is a little bit too big. Try setting scale option to \includegraphics command, e.g.,
  1. \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.
(41.18 KiB) Downloaded 148 times
Test.zip
(167.57 KiB) Downloaded 96 times

Brukernavn
Posts: 8
Joined: Mon Jul 11, 2011 3:27 pm

Postby Brukernavn » Tue Jul 12, 2011 2:53 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.

Thanks again for your help!

User avatar
sommerfee
Posts: 500
Joined: Mon Apr 09, 2007 4:20 pm

Postby sommerfee » Tue Jul 12, 2011 5:52 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

Postby Brukernavn » Wed Jul 13, 2011 9:06 am

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


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 2 guests