Hi everyone,
I need to put some equations into a box (one box per equation, or in some cases one box surrounding two equations located on the same line). Can anyone explain how can I do that? I suppose I should add some LateX code, but how exactly?
Thanks a lot in advance!
LyX ⇒ Boxed equations in Lyx
Re: Boxed equations in Lyx
Enter, as usual, in math mode (for example, Insert > Math > Display Formula). Type \boxed and a space. A box appears. Type inside.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Re: Boxed equations in Lyx
Thanks a lot. I tried and it works. However I still have a problem when I need to insert aligned equations (using AMS). Can you please help???
Thanks!!!
Thanks!!!
Re: Boxed equations in Lyx
The strategies differ depending on whether the formulas are numbered or not and whether the frame includes also the equation numbers, if any, or not. Please, write the formulas without frames, export to LaTeX, copy here the code, post also a screenshot to see their appeareance, and explain how you want the frame to be put. It seems to me that, in any case, you will have to use ERT.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Boxed equations in Lyx
The formulas are numbered, but the frame should not include the number.
Here is the code of the equation without frame:
Thanks!!
Here is the code of the equation without frame:
Code: Select all
Code, edit and compile here:
\begin{alignat}{1}\Delta\delta g_{T} & =\frac{1}{l_{m}}\left[\delta\mathbf{g}\cdot\mathbf{nn}\cdot\Delta\mathbf{m}+\delta\mathbf{m}\cdot\mathbf{nn}\cdot\Delta\mathbf{g}-\xi\delta\mathbf{m}\cdot\mathbf{nn}\cdot\Delta\mathbf{m}+\right.\nonumber \\& \left.-\frac{g_{N}}{l_{m}}\left(\delta\mathbf{m}\cdot\mathbf{tn}\cdot\Delta\mathbf{m}+\delta\mathbf{m}\cdot\mathbf{nt}\cdot\Delta\mathbf{m}\right)\right]\label{app-ddgt}\end{alignat}
Boxed equations in Lyx
Use ERT to write this:
If the textwidth were big enough, I would even prefer this:
Please note that in your original code there was a superfluous + at the end of the first line. Likewise, the opening and closing brackets hadn't the same size. The second line must start at the right of the opening bracket. Finally, the alignat environment is not, in this case, the more appropriate one. If you find that the frame is too close to the formula, right before \boxed, add
(or a different length instead 5pt).
LyX is quite helpful, but, when things become more complex, a good understanding of the underlying principles, commands and environments is required. It would be good for you to read some manuals about LaTeX and, in particular, about math mode.
Code: Select all
Code, edit and compile here:
\begin{equation}\label{app-ddgt}\boxed{\begin{aligned}\Delta\delta g_{T}=\frac{1}{l_{m}}\Bigl[&\delta\mathbf{g}\cdot\mathbf{nn}\cdot\Delta\mathbf{m}+\delta\mathbf{m}\cdot\mathbf{nn}\cdot\Delta\mathbf{g}-\xi\delta\mathbf{m}\cdot\mathbf{nn}\cdot\Delta\mathbf{m} \\& -\frac{g_{N}}{l_{m}}\bigl(\delta\mathbf{m}\cdot\mathbf{tn}\cdot\Delta\mathbf{m}+\delta\mathbf{m}\cdot\mathbf{nt}\cdot\Delta\mathbf{m}\bigr)\Bigr]\end{aligned}}\end{equation}
Code: Select all
Code, edit and compile here:
\begin{equation}\label{app-ddgt}\boxed{\begin{aligned}\Delta\delta g_{T}=\frac{1}{l_{m}}\Bigl[&\delta\mathbf{g}\cdot\mathbf{nn}\cdot\Delta\mathbf{m}+\delta\mathbf{m}\cdot\mathbf{nn}\cdot\Delta\mathbf{g} \\& -\xi\delta\mathbf{m}\cdot\mathbf{nn}\cdot\Delta\mathbf{m}-\frac{g_{N}}{l_{m}}\bigl(\delta\mathbf{m}\cdot\mathbf{tn}\cdot\Delta\mathbf{m}+\delta\mathbf{m}\cdot\mathbf{nt}\cdot\Delta\mathbf{m}\bigr)\Bigr]\end{aligned}}\end{equation}
Code: Select all
\addtolength{\fboxsep}{5pt}
LyX is quite helpful, but, when things become more complex, a good understanding of the underlying principles, commands and environments is required. It would be good for you to read some manuals about LaTeX and, in particular, about math mode.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.