Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Close
From: Stanley <smsutton@iw...>  20040729 00:37:32

Thanks for the help. Now I just need to get rid of the equation number. It's a bit more complicated than I was hoping it would be. I may just go back to putting the last line outside the align* block in a seperate \[ \fbox{ $ ... $ } \] line. It's not aligned or in the same size or format as the rest, but at least it's mosltly centered and easy to type. Thanks, Stanley  On Tue 07/27, Mark Riggs < msr1@... > wrote: From: Mark Riggs [mailto: msr1@...] To: miktexusers@... Date: Tue, 27 Jul 2004 08:24:35 0500 Subject: Re: [MiKTeX] How to box the last line of a multiline equation? Stanley wrote:<br><br>>I'm legally blind, so it's much easier to use the computer than to attempt to write directly. I would like to box the last line of a multiline equation set (homework problems). I would like the box to be aligned with the "=" sign like the rest of the equations, but I haven't figured out how to do that without breaking things. Here's what I currently have, which will work, if there is no simple way to do what I'd like:<br>><br>><br>> <br>><br>Here is an example I found on comp.text.tex; I usually just read from <br>this group since they are a little hard on people who don't research first.<br><br>http://groups.google.com/groups?hl=en&lr=&ie=UTF8&oe=UTF8&group=comp.text.tex<br><br>\documentclass{article}<br>\usepackage{amsmath}<br>\newlength{\testwidth}<br>\newsavebox{\tempbox}<br><br>;% This command sets back the equation counter and then readvances it,<br>% in order to reset the current label string after our strange use of<br>% \tag* has corrupted it with lots of extra junk.<br>%<br>\newcommand{\relabel}[1]{%<br> \addtocounter{equation}{1}%<br> \refstepcounter{equation}%<br> \label{#1}%<br>}<br><br>\begin{document}<br><br>Here is a test boxing the last line, including the equation number:<br>% <br>% Create the frame ahead of time; make it overlap to the left by using<br>% the [r] placement option with a width of zero.<br>% <br>\savebox{\tempbox}[0pt][r]{<br> %<br> % Print a box around an invisible space of the current width<br> % (adjusting for fboxsep on both sides), and a vphantom of the tallest<br> % element (to get the correct height).<br> % <br> \boxed{\hspace{2\fboxsep}\hspace{\linewidth}%<br> \vphantom{\frac{\sin(\omega T)}{\omega T}}%<br> }%<br>}%<br>\begin{align*}<br> X_1(j\omega) & = \int\limits^{+\infty}_{\infty} x_1(t) e^{j\omega<br>t} dt \\<br> & = \frac{v_o}{j\omega T} \left[e^{j\omega t}\right]^T_{T} \\<br> & = \frac{v_o}{j\omega T} \left( 2 j \sin (\omega T) \right) \\<br> X_1(j\omega) & = 2v_o \frac{\sin(\omega T)}{\omega T}<br>%<br>% We need to use \tag*, but that doesn't change the equation counter, so<br>% we increment the counter by hand. Getting the label right takes more<br>% work, see below.<br>% <br>\stepcounter{equation}<br>\tag*{(\theequation)% Normal equation number<br> \hspace{\fboxsep}\usebox{\tempbox}%<br>}<br>\relabel{eq1}<br>\end{align*}<br>And a second test for boxing only the equation body, not the number.<br>This time we can use \texttt{align} and \verb'\notag' because<br>\verb'\tag*' is not necessary.<br>\begin{align}<br> X_1(j\omega) & = \int\limits^{+\infty}_{\infty} x_1(t) e^{j\omega<br>t} dt \notag\\<br> & = \frac{v_o}{j\omega T} \left[e^{j\omega t}\right]^T_{T} \notag\\<br> & = \frac{v_o}{j\omega T} \left( 2 j \sin (\omega T) \right) \notag\\<br>% Skip to the righthand column, see below.<br> &<br>%<br>% Measure the width of the lefthand side, including some adjustments<br>% for the frame.<br>%<br>\settowidth{\testwidth}{\hspace{\fboxrule}\hspace{\fboxsep}$X_1(j\omega)$}<br>%<br>% Print the lefthand side and the righthand side together in the<br>% *righthand column* with negative space to shift it to the left.<br>%<br>\hspace{\testwidth}%<br>%<br>% And now we can use amsmath's \boxed command which is just \fbox for<br>% math with \displaystyle.<br>%<br>\boxed{X_1(j\omega) = 2v_o \frac{\sin(\omega T)}{\omega T}}<br>\end{align}<br><br>\end{document}<br><br><br><br><br>This SF.Net email is sponsored by BEA Weblogic Workshop<br>FREE Java Enterprise J2EE developer tools!<br>Get your free copy of BEA WebLogic Workshop 8.1 today.<br>http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click<br>_______________________________________________<br>MiKTeXUsers mailing list<br>MiKTeXUsers@...<br>https://lists.sourceforge.net/lists/listinfo/miktexusers<br>; _______________________________________________ 
From: Stanley <smsutton@iw...>  20040729 01:19:04

Simply changing the align to align* takes care of the equation number in the second example. Now to figure out how to write a command so I only have to type the equation once. :) Stanley  On Tue 07/27, Mark Riggs < msr1@... > wrote: From: Mark Riggs [mailto: msr1@...] To: miktexusers@... Date: Tue, 27 Jul 2004 08:24:35 0500 Subject: Re: [MiKTeX] How to box the last line of a multiline equation? Stanley wrote:<br><br>>I'm legally blind, so it's much easier to use the computer than to attempt to write directly. I would like to box the last line of a multiline equation set (homework problems). I would like the box to be aligned with the "=" sign like the rest of the equations, but I haven't figured out how to do that without breaking things. Here's what I currently have, which will work, if there is no simple way to do what I'd like:<br>><br>><br>> <br>><br>Here is an example I found on comp.text.tex; I usually just read from <br>this group since they are a little hard on people who don't research first.<br><br>http://groups.google.com/groups?hl=en&lr=&ie=UTF8&oe=UTF8&group=comp.text.tex<br><br>\documentclass{article}<br>\usepackage{amsmath}<br>\newlength{\testwidth}<br>\newsavebox{\tempbox}<br><br>;% This command sets back the equation counter and then readvances it,<br>% in order to reset the current label string after our strange use of<br>% \tag* has corrupted it with lots of extra junk.<br>%<br>\newcommand{\relabel}[1]{%<br> \addtocounter{equation}{1}%<br> \refstepcounter{equation}%<br> \label{#1}%<br>}<br><br>\begin{document}<br><br>Here is a test boxing the last line, including the equation number:<br>% <br>% Create the frame ahead of time; make it overlap to the left by using<br>% the [r] placement option with a width of zero.<br>% <br>\savebox{\tempbox}[0pt][r]{<br> %<br> % Print a box around an invisible space of the current width<br> % (adjusting for fboxsep on both sides), and a vphantom of the tallest<br> % element (to get the correct height).<br> % <br> \boxed{\hspace{2\fboxsep}\hspace{\linewidth}%<br> \vphantom{\frac{\sin(\omega T)}{\omega T}}%<br> }%<br>}%<br>\begin{align*}<br> X_1(j\omega) & = \int\limits^{+\infty}_{\infty} x_1(t) e^{j\omega<br>t} dt \\<br> & = \frac{v_o}{j\omega T} \left[e^{j\omega t}\right]^T_{T} \\<br> & = \frac{v_o}{j\omega T} \left( 2 j \sin (\omega T) \right) \\<br> X_1(j\omega) & = 2v_o \frac{\sin(\omega T)}{\omega T}<br>%<br>% We need to use \tag*, but that doesn't change the equation counter, so<br>% we increment the counter by hand. Getting the label right takes more<br>% work, see below.<br>% <br>\stepcounter{equation}<br>\tag*{(\theequation)% Normal equation number<br> \hspace{\fboxsep}\usebox{\tempbox}%<br>}<br>\relabel{eq1}<br>\end{align*}<br>And a second test for boxing only the equation body, not the number.<br>This time we can use \texttt{align} and \verb'\notag' because<br>\verb'\tag*' is not necessary.<br>\begin{align}<br> X_1(j\omega) & = \int\limits^{+\infty}_{\infty} x_1(t) e^{j\omega<br>t} dt \notag\\<br> & = \frac{v_o}{j\omega T} \left[e^{j\omega t}\right]^T_{T} \notag\\<br> & = \frac{v_o}{j\omega T} \left( 2 j \sin (\omega T) \right) \notag\\<br>% Skip to the righthand column, see below.<br> &<br>%<br>% Measure the width of the lefthand side, including some adjustments<br>% for the frame.<br>%<br>\settowidth{\testwidth}{\hspace{\fboxrule}\hspace{\fboxsep}$X_1(j\omega)$}<br>%<br>% Print the lefthand side and the righthand side together in the<br>% *righthand column* with negative space to shift it to the left.<br>%<br>\hspace{\testwidth}%<br>%<br>% And now we can use amsmath's \boxed command which is just \fbox for<br>% math with \displaystyle.<br>%<br>\boxed{X_1(j\omega) = 2v_o \frac{\sin(\omega T)}{\omega T}}<br>\end{align}<br><br>\end{document}<br><br><br><br><br>This SF.Net email is sponsored by BEA Weblogic Workshop<br>FREE Java Enterprise J2EE developer tools!<br>Get your free copy of BEA WebLogic Workshop 8.1 today.<br>http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click<br>_______________________________________________<br>MiKTeXUsers mailing list<br>MiKTeXUsers@...<br>https://lists.sourceforge.net/lists/listinfo/miktexusers<br>; _______________________________________________ 