## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Major problem compiling to .pdf Topic is solved

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

### Major problem compiling to .pdf

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\subfloat                [Is this is?\label{subfig-1:subfloats}]{The control sequence at the end of the top lineof your error message was never \def'ed. If you havemisspelled it (e.g., \hobx'), type I' and the correctspelling (e.g., I\hbox'). Otherwise just continue,and I'll forget about whatever was undefined. Missing $inserted ...e=0.3]{C:/Users/Tobias/Dropbox/DRCMR/Dice_ paper/figures/scheme.png}I've inserted a begin-math/end-math symbol since I thinkyou left one out. Proceed, with fingers crossed.Extra }, or forgotten$.  ...opbox/DRCMR/Dice_paper/figures/scheme.png} I've deleted a group-closing symbol because it seems to bespurious, as in $x}$'. But perhaps the } is legitimate andyou forgot something else, as in \hbox{$x}'. In such casesthe way to recover is to insert both the forgotten and thedeleted material, e.g., by typing I$}'. Missing } inserted.  \end{figure} I've inserted something that you may have forgotten.(See the <inserted text> above.)With luck, this will get me unwedged. But if youreally didn't forget anything, try typing 2' now; thenmy insertion and my current dilemma will both disappear.

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

\begin{figure}[H]   	\subfloat[Is this is?\label{subfig-1:subfloats}]{     		\includegraphics[scale=0.3]{C:/Users/Tobias/Dropbox/DRCMR/Dice_paper/figures/scheme.png}   }   	\hfill   	\subfloat[Is this is?\label{subfig-2:subfloats}]{     		\includegraphics[scale=0.3]{C:/Users/Tobias/Dropbox/DRCMR/Dice_paper/figures/scheme.png}   }   	\caption{}  	\label{fig:sub-floats} \end{figure}

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.

T
Last edited by cgnieder on Thu Mar 21, 2013 12:48 pm, edited 1 time in total.
Reason: added code markup for log messages and changed inline to block for the code

Tags:

cgnieder
Site Moderator
Posts: 1990
Joined: Sat Apr 16, 2011 7:27 pm
Since the error message says that \subfloat is undefined: did you insert
\usepackage{subfig}

Regards
site moderator & package author

TMorville
Posts: 16
Joined: Thu Mar 14, 2013 4:58 pm
Hi Clement!

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

svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am
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)

TMorville
Posts: 16
Joined: Thu Mar 14, 2013 4:58 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:

\begin{figure}[H]   	\subfloat[fig.a test\label{subfig-1:subfloats}]{     		\includegraphics[scale=0.09]{path_to_picture}   }   	\hfill   	\subfloat[fig.b text\label{subfig-2:subfloats}]{     		\includegraphics[scale=0.09]{path_to_picture}   }   	\caption{This is a figure}  	\label{fig:sub-floats} \end{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.

Thanks.
Last edited by cgnieder on Thu Mar 21, 2013 8:00 pm, edited 1 time in total.
Reason: changed inline code markup into block code markup

TMorville
Posts: 16
Joined: Thu Mar 14, 2013 4:58 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.

### Who is online

Users browsing this forum: No registered users and 3 guests