LaTeX forum ⇒ Graphics, Figures & TablesMajor problem compiling to .pdf Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Posts: 16
Joined: Thu Mar 14, 2013 4:58 pm

Major problem compiling to .pdf

Postby TMorville » Thu Mar 21, 2013 12:25 pm

Hi everyone,

im currently writeing a paper in Lyx, and i have a weird problem:

I have a number of ERT boxes with tex code for subfloats. It's been working fine, until now, where suddenly none of them work.

When compiling to pdflatex, i get these errors:

Undefined control sequence
               [Is this is?\label{subfig-1:subfloats}]{
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Missing $ inserted
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

Extra }, or forgotten $.
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

Missing } inserted.
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

ALL of these mistakes are for JUST one small piece of code:

	\subfloat[Is this is?\label{subfig-1:subfloats}]{     
	\subfloat[Is this is?\label{subfig-2:subfloats}]{     

And have to underline, that this worked JUST fine. Further, if i take that tex code just posted, and put into NEW document it does NOT work. But if i put into another old document with similair boxes already inserted, it works just fine!

I have to say that i am utterly confused about this. It seems like theres an error for every line in that small piece of code above, and then it works just fine in another document with the same settings..

Any, and all input is appriciated.

Last edited by cgnieder on Thu Mar 21, 2013 12:48 pm, edited 1 time in total.

User avatar
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Thu Mar 21, 2013 12:51 pm

Since the error message says that \subfloat is undefined: did you insert

to your preamble?

site moderator & package author

Posts: 16
Joined: Thu Mar 14, 2013 4:58 pm

Postby TMorville » Thu Mar 21, 2013 2:00 pm

Hi Clement!

Yes i do. I even tried to reinstall the package.

User avatar
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Postby svend_tveskaeg » Thu Mar 21, 2013 3:20 pm

Then you must produce a minimal (non-)working example if $P(\text{help}) > 0$.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)

Posts: 16
Joined: Thu Mar 14, 2013 4:58 pm

Postby TMorville » Thu Mar 21, 2013 3:34 pm

But won't that be a problem when im using Lyx?

Should i convert it all to Tex, and then make the minimal package?

If anyone can confirm that the piece of code i pasted in, works with a picture of their choice, the problem must be with my lyx?

If i start a completely fresh lyx document, add \usepackage{subfig} to my preamble, this peice of code does NOT work:

	\subfloat[fig.a test\label{subfig-1:subfloats}]{     
	\subfloat[fig.b text\label{subfig-2:subfloats}]{     
	\caption{This is a figure}  

... which is weird, because i works fine in another document - and i can't seem to find the difference.

Anyway. I will try to make a minimal package so you can see the entire script. I just need to know how to do it when im using Lyx.

Last edited by cgnieder on Thu Mar 21, 2013 8:00 pm, edited 1 time in total.

Posts: 16
Joined: Thu Mar 14, 2013 4:58 pm

Postby TMorville » Thu Mar 21, 2013 4:05 pm

And the plot thickens..

I manually added a "float" in the beginning of the document via Insert->Float-Figure, and added a random piece of graphics.

That works just fine, and now - when compiling - i dont get the same error messages, but Lyx just completely ignores every instance of ERT!

:!: Edit: Solution:

Manually adding a float in its own still produces errors.

Adding a picture to that float made every other ERT float work.

Together with "Add here, and def. here" option for float objects everything works again.

So no explaination, but this works if someone should have similair problems.

Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests