3

I have a slightly strange question. On my laptop, I run my code (using TeXstudio v2.9.4), and it all outputs fine; on my desktop computer (v2.10.2) it won't compile saying that there is an issue with \being{figure}[c] saying "unknown float option". If I take away the [c], then this gives an output different to what I'm wanting.

I've pretty much finished my document -- just some typos etc to change -- so I don't want to have to change all the formatting. I was wondering if it's something blindingly obvious that I've done wrong, or if this is an actual change? Online advice that I've seen hasn't updated, ie is still showing \being{figure}[c].

Any advice would be most appreciated.


Update: I appear to have fixed this by changing [c] to [b]. I had thought that b would mean "bottom of page", but it's putting all my figures at the end of the document (even after the references). This is what I wanted, but it does seem odd (to me) that this command should work...

  • Add \listfiles to the preamble, compile on both machines, and compare the versions of the packages you've loaded (see end of respective .log files). – jon Oct 12 '15 at 18:11
  • Could you provide a small code that reproduces the error (on your desktop computer) so that other people can try the same code and see if they get the same error? I am guessing that the error appears due to the different computers having different versions of packages. Try updating your packages – Grimler Oct 12 '15 at 18:12
  • @jon -- will do after tea! – Sam T Oct 12 '15 at 18:43
  • @Grimler -- yeah, I'm pretty sure it is a version thing. I have an older version on my laptop (it was new when I downloaded it). However, taking away the "[c]" does actually change it. This is what I was using as a help: sharelatex.com/learn/Inserting_Images#Positioning. – Sam T Oct 12 '15 at 18:45
  • Please see update. :) – Sam T Oct 12 '15 at 18:57
4

In standard LaTeX, there is no [c] placement option for figures. There might be a package that provides such an option, but I can't think of one. Older versions of LaTeX ignored invalid placement options and switched to the default ([tbp] I think). However, the 2015 version automatically includes the bug fixes that were once part of the fixltx2e package. This causes LaTeX to flag an error when it encounters an invalid figure placement option. You can use the latexrelease package to emulate the behaviour of an older kernel on your laptop.

This is demonstrated in the example below, which requires the 2015 version.

\documentclass[10pt]{article}
\usepackage[2014/05/01]{latexrelease} % <--- Try removing this 
\begin{document}
\begin{figure}[c] % <--- Invalid option
\centering
\rule{4cm}{4cm}
\end{figure}
\end{document}
  • Hmm... the odd thing is that it does actually make a difference. The difference is that in the older version (with the [c]), the figures 'have the page to themselves'. In the newer version (without the [c]), the figures are at the top of the page and then there is text underneath them. If I take away the [c] and run it on the old version, then it gives a different output (to if I leave in the [c]). – Sam T Oct 12 '15 at 18:47
  • Please see update. :) – Sam T Oct 12 '15 at 18:57
  • @SmileySam --- what document class are you using? – Ian Thompson Oct 12 '15 at 19:12
  • Ah yes, I do indeed see the difference. Thank you. – Sam T Oct 12 '15 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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