On 2011-09-18, Karl Linek wrote:

> I have two files. The first one I wrote with LyX 1.6.7. Then I installed
> LyX 2.0. I copied the file to a USB-stick. Suddenly I got always 4
> errors

On the same machine? What else changed, a new LaTeX distro/version as well?

> "Undefined control sequence."

> for example with the description

> "ist $\unit[1]{\lyxmathsym{\textdegree}C}
>                                               $ gleich $\unit[1]{K}$.
> 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."

> That was not useful. 

It tells, that at this stage, LaTeX does not know the command \unit.

Did you type this command in your document or did LyX insert it?

Did you manually load the package unit.sty (in the user preamble)?
Did you use a module?

> I tried a lot of things. Once I succeeded to reduce
> the error by one.

> The last trial was to copy the text, to make a new file and to paste the
> text. I did the same with all the options and settings. At least I had a
> manually copied file. And...

> It worked. No errors, no complains.

Is the "missing command" /unit still in the exported LaTeX source (you can
check with View>Source or by exporting to LaTeX)?

> I think LyX does not delete all the code if one changes some settings.

It only deletes what it inserts. Also, if you remove a module, LyX will/can
typically not remove code that depends on this module.

Also, if you move a file from one computer to another, LyX will not remove
code that relies on packages only present on the first...

Günter

Reply via email to