hi,

we had discussions about lyx mathbox and limits for the sum and
int-symbol. there are some irritating behaviour in lyx math
box with the commands
\limits
\displaystyle
\textstyle
\scriptstyle
\scriptscriptstyle

on the other hand there are some important facts to remember
where are the differences between the math-array and math-
eqnarray-environment.
i summerized all these facts and wrote a mini-faq. if you are
interested in it, please have a look and feel free to comment 
it in any way. maybe that i'm totally wrong and that there
are some better solutions.

Herbert

 

-- 
[EMAIL PROTECTED]
http://perce.de/voss/lyx/
#LyX 1.1 created this file. For more info see http://www.lyx.org/
\lyxformat 2.16
\textclass article
\begin_preamble
\newcommand{\bigmath}[1]{\displaystyle{#1}}
\newcommand{\normalmath}[1]{\textsyle{#1}}
\newcommand{\smallmath}[1]{\scriptstyle{#1}}
\newcommand{\tinymath}[1]{\scriptscriptstyle{#1}}
\newcommand\myLimits{\limits}
\let\newcommand=\providecommand
\end_preamble
\language default
\inputencoding latin1
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Subsection*

Inlinemath
\layout Standard

Mathstuff 
\begin_inset Formula \( \left( \begin{array}{cc}
a & b\\
c & d
\end{array}\right)  \)
\end_inset 

 in a textline is called 
\series bold 
inlinemode.

\series default 
 They are always vertically centered and in fact of big linespacing 
\begin_inset Formula \( \int _{3}^{5}\sin \frac{1}{x}dx \)
\end_inset 

 limits should appear only as super- or subscript.
 Latex allows both modes over/under 
\begin_inset Formula \( \int\limits _{3}^{5}\sin \frac{1}{x}dx \)
\end_inset 

 and super/sub 
\begin_inset Formula \( \ \sum _{i=0}^{17}i \)
\end_inset 

.
 Toggling between these modes is possible with 
\series bold 
Alt-m-l
\series default 
 (the cursors position must be before or behind the symbol).
 
\layout Subsection*

Displaymath
\layout Standard

Another mathmode is the 
\series bold 
displaymode
\series default 
, where the equation is like a parbox.
 Now equation-numbering is possible with 
\series bold 
Alt-m-n
\series default 
 and toggling off with 
\series bold 
Alt-m-N
\series default 
:
\layout Standard


\begin_inset Formula \begin{equation}
\label{Gl1}
\sum _{i=0}^{\infty }\sin \frac{1}{x}\neq \int _{3}^{5}\sin \frac{1}{x}dx=\int\limits 
_{3}^{5}\sin \frac{1}{x}dx
\end{equation}

\end_inset 


\layout Standard

In displaymath the big-symbols are used and the limits can be write in both
 modes.
 
\layout Subsection*

array-environment
\layout Standard

Matrizes can be construct as tables (arrays), where each cell is a centered
 mathmode-text like the inlinemode.
 The following equation shows this:
\layout Standard


\begin_inset Formula \begin{equation}
\label{Gl2}
\underline{A}=\left( \begin{array}{cccc}
a_{11} & \ \sum\nolimits \myLimits _{i=0}^{5}(i+1) & \sum _{i=0}^{5}(i+1) & \int 
_{0}^{5}(i+1)dx\\
a_{21} & a_{22} & a_{23} & a_{24}
\end{array}\right) 
\end{equation}

\end_inset 


\layout Standard

The problem is, that lyx don't write the 
\latex latex 

\backslash 
verb/
\backslash 
limits/
\latex default 
-command for the sum, therefore the limits are only super/subscript.
 Inserting the 
\latex latex 

\backslash 
verb/
\backslash 
limits/
\latex default 
-command by hand don't solve the problem.
 Saving and rereading the lyx-file the 
\latex latex 

\backslash 
verb/
\backslash 
limits/
\latex default 
-command: the 
\latex latex 

\backslash 
verb/
\backslash 
limits/
\latex default 
-command get lost! A solution for this behaviour is to write a limit-macro.
\layout Subsection*

eqnarray-environment
\layout Standard

A special mathemode is the equanarray-environment, which has per line three
 parts:
\layout Standard
\align center 
left formula- middleformula -rightformula
\layout Standard


\begin_inset Formula \begin{equation}
\begin{array}{ccc}
left & middle & right
\end{array}
\end{equation}

\end_inset 


\layout Standard

This environment is construct with ctrl-enter in the blue lyx math-box.
 
\layout Standard

left and right formula are the same as a single displaymath, so there is
 the same behaviour as in Eqn 
\begin_inset LatexCommand \ref{Gl1}

\end_inset 

.
 The only difference is that the left formula is formattted right and the
 right formula formatted left.
 But the middle part is different, it's centered and there are always the
 small math-symbols and toggeling between super/subscript and above/under-limits
 is always possible:
\layout Standard


\begin_inset Formula \begin{eqnarray}
\textstyle \sum _{i=0}^{\infty }\sin \frac{1}{x} & \int _{3}^{5}\sin \frac{1}{x}dx & 
\int _{3}^{5}\cos \frac{1}{x}dx\\
\sum _{i=0}^{\infty }\sin \frac{1}{x} & \ \sum\limits _{i=0}^{\infty }\sin \frac{1}{x} 
& \sum _{i=0}^{\infty }\sin \frac{1}{x}\\
\smallmath {\sum _{i=0}^{5}\frac{i}{3}} & \bigmath {\int _{0}^{5}(i+1)di} & \smallmath 
{\sum\limits _{i=0}^{\infty }\sin \frac{1}{x}}\label{Gl6} \\
\int _{0}^{5}(i+1)di & \ \int\limits _{\bigmath {0}}^{5}(i+1)di & \oint 
_{0}^{5}(i+1)\tinymath {di}
\end{eqnarray}

\end_inset 


\layout Standard

With the 
\latex latex 

\backslash 
verb/
\backslash 
displaystyle/
\latex default 
-command it's possible to change the size to the displaymath-format but
 it's the same behaviour, lyx ingores this command after saving and rereading.
 It's the same with the other mathfonts-commands:
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
textstyle/
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
scriptstyle/
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
scriptscriptstyle/
\layout Standard

Therefore four new macros are defined in the latex preamble:
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
newcommand{
\backslash 
bigmath}[1]{
\backslash 
displaystyle{#1}}/
\latex default 
 
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
newcommand{
\backslash 
normalmath}[1]{
\backslash 
textsyle{#1}}/
\latex default 
 
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
newcommand{
\backslash 
smallmath}[1]{
\backslash 
scriptstyle{#1}}/
\latex default 
 
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
newcommand{
\backslash 
tinymath}[1]{
\backslash 
scriptscriptstyle{#1}}/
\layout Itemize


\latex latex 

\backslash 
verb/
\backslash 
newcommand{
\backslash 
myLimits}{
\backslash 
limits}/
\layout Standard

With these macros the style of the formulas can be changed and lyx don't
 forget this one (Eqn 
\begin_inset LatexCommand \ref{Gl6}

\end_inset 

).
\layout Subsection*

Mathboxes in tablecells
\layout Standard

Another way is useful, if no equantionnumbers are needed.
 Working with a table and single formulas in the cells is sometimes the
 better way:
\layout Standard


\latex latex 

\backslash 
renewcommand
\backslash 
arraystretch{2.0}
\layout Standard

With 
\latex latex 

\backslash 
verb/
\backslash 
renewcommand
\backslash 
arraystretch{2.0}/
\latex default 
 it's possible to change the vertical space in the table.
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
multicol5
2 4 0 0 -1 -1 -1 -1
0 0 0 0
0 0 0 0
8 0 0 "" ""
8 0 0 "" ""
8 0 0 "" ""
8 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""


\begin_inset Formula \( \frac{1}{2}+\sum\limits _{3}^{3}\sin \alpha  \)
\end_inset 


\newline 

\begin_inset Formula \( \frac{1}{2}+\sum\limits _{3}^{3}\sin \alpha  \)
\end_inset 


\newline 

\begin_inset Formula \( \frac{1}{2}+\sum _{3}^{3}\sin \alpha  \)
\end_inset 


\newline 
0 
\newline 
1
\newline 
2
\newline 
3
\newline 
1
\layout Standard


\latex latex 

\backslash 
renewcommand
\backslash 
arraystretch{1.0}
\layout Standard

Resetting the vertical tablespace with 
\latex latex 

\backslash 
verb/
\backslash 
renewcommand
\backslash 
arraystretch{1.0}/
\latex default 
 Here is the same table with borders:
\layout Standard


\latex latex 

\backslash 
renewcommand
\backslash 
arraystretch{2.0}
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
multicol5
2 4 0 0 -1 -1 -1 -1
1 0 0 0
1 1 0 0
8 1 1 "" ""
8 0 0 "" ""
8 1 1 "" ""
8 0 1 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""
0 8 1 0 0 0 0 "" ""


\begin_inset Formula \( \frac{1}{2}+\sum _{3}^{3}\sin \alpha  \)
\end_inset 


\newline 

\begin_inset Formula \( \frac{1}{2}+\sum _{3}^{3}\sin \alpha  \)
\end_inset 


\newline 

\begin_inset Formula \( \frac{1}{2}+\ \sum\limits _{3}^{3}\sin \alpha  \)
\end_inset 


\newline 
0 
\newline 
1
\newline 
2
\newline 
3
\newline 
1
\layout Standard


\latex latex 

\backslash 
renewcommand
\backslash 
arraystretch{1.0}
\layout Standard
\added_space_top vfill 
[EMAIL PROTECTED]
\layout Standard


\latex latex 

\backslash 
today
\the_end

Reply via email to