James Clayton Sutherland <[EMAIL PROTECTED]> writes:

> I don't think that this works with numbered equations, or "dispayed"
> equations.  It seems to work inline equations.  I have resorted to entering
> the whole equation in an "ERT" box to accomplish the fbox on a
> displayed equation.

This is not necessary. Have a look at the pasted .lyx file at the bottom.
You'll have to substitute the two occurrences of the four characters <at>
with a single @ (the email character) in order to use it.

-- 
Enrico

#LyX 1.4.3 created this file. For more info see http://www.lyx.org/
\lyxformat 245
\begin_document
\begin_header
\textclass article
\begin_preamble
% This is for framed equations.
\usepackage{calc}
\newcommand{\eqnbox}[4]{\def\argone{#1}\def\argtwo{#2}%
  \ifx\argone\<at>empty
    \fbox{\parbox{\linewidth-2\fboxsep-2\fboxrule}{#3}}%
  \else
    \hfill%
    \fbox{\parbox{#1}{#3}}%
    \hfill%
    \parbox{\labelwidth}{%
      \ifx\argtwo\<at>empty\begin{eqnarray*}#2\end{eqnarray*}%
      \else\begin{eqnarray}#2\end{eqnarray}\fi%
    }
  \fi
  \par
}
\end_preamble
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single
\papersize default
\use_geometry false
\use_amsmath 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\end_header

\begin_body

\begin_layout Section
Framed equations
\end_layout

\begin_layout Standard
Here is how you can obtain a framed equation in which the frame spans the
 whole page and encompasses the equation number, too (see eq.\InsetSpace ~
(
\begin_inset LatexCommand \ref{eq:framed1}

\end_inset

)).
\newline

\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
eqnbox{
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Standard

}{
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Standard

}{
\end_layout

\end_inset


\begin_inset Formula \begin{equation}
A=\int B\,\mathrm{d}x\label{eq:framed1}\end{equation}

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Standard

}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
If you want to leave the equation number out of the frame, then you have
 to specify the width of the frame and also put the label outside the equation
 (which should not be numbered by itself) as shown in the following example:
\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
eqnbox{
\end_layout

\end_inset

10cm
\begin_inset ERT
status collapsed

\begin_layout Standard

}{
\end_layout

\end_inset


\begin_inset LatexCommand \label{eq:framed2}

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Standard

}{
\end_layout

\end_inset


\begin_inset Formula \begin{eqnarray*}
G_{n}(f) & = & \mathcal{F}\left\{ p(t)p^{*}(t+nT)\right\} \\
 & = & \int_{-\infty}^{\infty}P(f+\nu)P^{*}(\nu)\, e^{-j2\pi n\nu T}d\nu
 \end{eqnarray*}

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Standard

}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
If you want an unnumbered framed equation, simply omit the label:
\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
eqnbox{
\end_layout

\end_inset

10cm
\begin_inset ERT
status collapsed

\begin_layout Standard

}{
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Standard

}{
\end_layout

\end_inset


\begin_inset Formula \begin{eqnarray*}
G_{n}(f) & = & \mathcal{F}\left\{ p(t)p^{*}(t+nT)\right\} \\
 & = & \int_{-\infty}^{\infty}P(f+\nu)P^{*}(\nu)\, e^{-j2\pi n\nu T}d\nu
 \end{eqnarray*}

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Standard

}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Pay attention to not put a space or everything else in place of the label
 otherwise you will get a numbered equation.
\end_layout

\end_body
\end_document


Reply via email to