Answering my own question, but I think this could be considered a bug, or at
least picky behavior that causes problems that are really, really hard to
find!

I worked through a backup file that worked piece by piece to find the
problem. It had nothing to do with Figures per se, which made it hard to
find (that's where I figured the problem would be given the LaTeX errors
below).

The trouble was that I had a \thispagestyle{blah} after a chapter title that
was set in the 'addsec' environment (this is KOMA-Script book). The
pagestyle ERT box was on its own line between the title and the next addsec
environment, the real one with the section heading. Changing the environment
in LyX associated with that ERT box to 'standard' fixed the problems.

A bug in behavior? I don't know. I think I might have had the ERT box inline
just before the text for the section heading, then hit enter at some point
to get it on its own line - easier to find when browsing the LyX file. That
such a simple change could bomb the whole compilation is annoying for sure,
but maybe it's just something to be aware of (I am now!).

Thanks


David Hewitt wrote:
> 
> This is a new one for me. I'm hoping this rings a bell with someone. I'm
> on LyX 1.5.3 on WinXP. I've updated my MikTeX packages, refreshed the file
> name database and updated formats, then reconfigured LyX, to no avail.
> 
> The file was producing glorious PDFs this morning. I didn't make anything
> more than minor edits and some hours later LaTeX now throws a fit about
> the Figures when compiling. Nothing changed with the Figures. I've had odd
> LaTeX errors show up with other little tweaks I inserted, but I can't find
> anything for this one.
> 
> LaTeX gets through run #1, BibTeX finishes, and run #2 throws the
> following errors, repeated in this order for each Figure float in the
> document. It also throws a hissy on the Table float, but I think it's all
> related so I'll go with this for now.
> 
> - Improper \prevdepth
> + \end{figure}
>                   
> You can refer to \spacefactor only in horizontal mode;
> you can refer to \prevdepth only in vertical mode; and
> neither of these is meaningful inside \write. So
> I'm forgetting what you said and using zero instead.
> 
> - You can't use `\prevdepth' in horizontal mode
> + \end{figure}
>                   
> Sorry, but I'm not programmed to handle this case;
> I'll just pretend that you didn't ask for it.
> If you're in the wrong mode, you might be able to
> return to the right one by typing `I}' or `I$' or `I\par'.
> 
> - Missing number, treated as zero
> + \end{figure}
>                   
> A number should have been here; I inserted `0'.
> (If you can't figure out why I needed to see a number,
> look up `weird error' in the index to The TeXbook.)
> 
> 
> -Illegal unit of measure (pt inserted)
> +  \end{figure}
>                   
> Dimensions can be in units of em, ex, in, pt, pc,
> cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
> I'll assume that you meant to say pt, for printer's points.
> To recover gracefully from this error, it's best to
> delete the erroneous units; e.g., type `2' to delete
> two letters. (See Chapter 27 of The TeXbook.)
> 
> ...
> 
> The preview source for the first Figure float looks like this:
> 
> % Preview source code for paragraph 23
> 
> \begin{center}
> %
> \begin{figure}
> \begin{centering}
> \includegraphics[width=5in]{Figures/landingsCBSAC}
> \par\end{centering}
> 
> \caption[Commercial landings of blue crab in Chesapeake Bay,
> 1945-2006]{\label{Fig:landingshistory}History of commercial landings of
> blue
> crab in Chesapeake Bay, 1945-2006 (data from
> \citealt{cbsac2007advreport}).}
> 
> 
> 
> \end{figure}
> 
> \par\end{center}
> 
> 
> Thanks for any help,
> Dave
> 


-----
David Hewitt
Virginia Institute of Marine Science
http://www.vims.edu/fish/students/dhewitt/
-- 
View this message in context: 
http://www.nabble.com/LaTeX-error%2C-%5Cprevdepth-with-Figure-tp15705637p15716599.html
Sent from the LyX - Users mailing list archive at Nabble.com.

Reply via email to