Herbert Voss wrote:
also no problem, but a lot of restrictions in LyX writing correct math code ...
The restriction, that one can't create a formula inside another formula, is a bug in my opinion:
http://bugzilla.lyx.org/show_bug.cgi?id=1435
Or do you see other restrictions?
Attached only one of different solutions.
Thanks for your help. But just a question to your solution:
When I want to use a length instead of the plain TeX command \wd, why does this work:
\newlength{\slength}
\settowidth{\slength}{$P_{3}+P_{2}-P_{1}$}but this not:
\newlength{\slength}
\settowidth{\slength}{\lW}see attached example
regards Uwe
#LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass article \language english \inputencoding default \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 4 \tocdepth 4 \paragraph_separation indent \defskip medskip \quotes_language german \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
newsavebox{
\backslash
lW}
\newline
\backslash
sbox{
\backslash
lW}{$P_{3}+P_{2}-P_{1}$}
\end_inset
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
newlength{
\backslash
slength}
\end_inset
\layout Itemize
first function
\newline
\begin_inset ERT
status Open
\layout Standard
\backslash
settowidth{
\backslash
slength}{$P_{3}+P_{2}-P_{1}$}
\end_inset
\begin_inset ERT
status Collapsed
\layout Standard
$
\backslash
displaystyle
\backslash
makebox[
\backslash
slength][l]{$P_1$}=
\backslash
sum_a
\backslash
in A$
\end_inset
\newline
\begin_inset ERT
status Open
\layout Standard
\backslash
settowidth{
\backslash
slength}{
\backslash
lW}
\end_inset
\begin_inset ERT
status Collapsed
\layout Standard
$
\backslash
displaystyle
\backslash
makebox[
\backslash
slength][l]{$P_1$}=
\backslash
sum_a
\backslash
in A$
\end_inset
\layout Itemize
but another one
\newline
\begin_inset ERT
status Collapsed
\layout Standard
$
\backslash
makebox[
\backslash
wd
\backslash
lW][l]{$
\backslash
sin
\backslash
left(P_1
\backslash
right)$}=blabla$
\end_inset
\layout Itemize
or perhaps
\newline
\begin_inset Formula $P_{3}+P_{2}-P_{1}=blablub$
\end_inset
\the_end
