I'm away from my lyx setup now, so my reply will be out of memory.
> Have had some problems with your preamble:
> > \Newassociation{sol}{Svar}{ans}
> > {\theorembodyfont{\upshape} \newtheorem{uppg}{Uppgift}}
> > \newenvironment{ug}{\begin{uppg}\normalfont}{\end{uppg}}
>
> Which gave an "Undefined control sequence." error:
>
> {\theorembodyfont
> {\upshape} \newtheorem{uppg}{Uppgift}}
> 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.
>
> This example from the answers package documentation works:
>
> \Newassociation{sol}{Solution}{ans}
> \newtheorem{ex}{Exercise}
I might have missed something in the copy process. But if that works for you,
great!
> Also can't get the bind file to be recognized by lyx. I created a
> myShortcuts.bind file in ~/.lyx/bind with the text you gave. And I put the
> layouts text in ~/.lyx/layout/myLayout.layout. But LyX didn't seem to pick
> them up automatically. Tried Tools -> Reconfigure and restarted LyX but
> that made no difference either.
Ah, perhaps you should add an include line in the bind file that is used by
default. cua.bind perhaps?