Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm creating a Beamer presentation in which a line in the equation environment should fill the whole screen and should not only be centered arround the equality sign. I think this looks nicer and is much more readable for the audience. Actually using \multline on just one line gives me exactly that. How can I have that behaviour with \align or any other 'equation aligning' environment? Here is a comparison, I want to achieve the above with an alignment like below:

\documentclass{beamer}
\usepackage{amsmath}
\usepackage[thicklines]{cancel}
\usepackage{color} 
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\ccancel}[2]{\renewcommand{\CancelColor}{\color{#2}}\bcancel{#1}}

\begin{document}
\begin{frame}
\begin{multline*}
                                    \frac{\partial s_{\mu}}{\partial x_\mu}=
                                    A \;[\ccancel{ \frac{\partial \phi^*}{\partial x_{\mu}}
                                    \frac{\partial \phi}{\partial x_{\mu}}}{Red}
                                    -\ccancel{\vphantom{\frac{1}{1}}(\square \phi^*)\phi}{Blue} 
                                    +\ccancel{\vphantom{\frac{1}{1}(kk)}\phi^* \square\phi}{Blue} 
                                    -\ccancel{\frac{\partial \phi^*}{\partial x_{\mu}}
                                    \frac{\partial \phi}{\partial x_{\mu}}}{Red}] 
\end{multline*}
\\[2em]
\begin{align*}
            \frac{\partial s_{\mu}}{\partial x_\mu} & = A \;[\ccancel{ \frac{\partial \phi^*}{\partial x_{\mu}}
                                    \frac{\partial \phi}{\partial x_{\mu}}}{Red}
                                    -\ccancel{\vphantom{\frac{1}{1}}(\square \phi^*)\phi}{Blue} 
                                    +\ccancel{\vphantom{\frac{1}{1}(kk)}\phi^* \square\phi}{Blue} 
                                    -\ccancel{\frac{\partial \phi^*}{\partial x_{\mu}}
                                    \frac{\partial \phi}{\partial x_{\mu}}}{Red}] \\
                                                    & = 0 
    \end{align*}

\end{frame}
\end{document}

enter image description here

share|improve this question
    
the first equation has an extremely lousy typesetting which you shouldn't use. –  Herbert Jan 13 '13 at 19:02
    
I don't think it's lousy if you consider it for a beamer presentation. As stated above my opinion is that it's more readable in that case. For a common article I would agree with you, but not for a presentation! –  user24357 Jan 13 '13 at 19:16
2  
This might be a matter of personal taste but I find the second one far more readable than the first which IMHO more looks like single fragments than like a whole equation... –  cgnieder Jan 13 '13 at 19:23
add comment

2 Answers 2

up vote 5 down vote accepted

I don't like very much cancellation signs. However here's a proposal; notice that I defined two new commands: one for simplifying the input, the second one to get the right spacing for the Laplacian.

\documentclass{beamer}
\usepackage{amsmath}
\usepackage[thicklines]{cancel}
\usepackage{color} 
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\ccancel}[2]{\renewcommand{\CancelColor}{\color{#2}}\bcancel{#1}}
\newcommand{\pder}[2]{\frac{\partial#1}{\partial#2}}
\DeclareMathOperator{\lapl}{\square}

\begin{document}
\begin{frame}
\begin{align*}
\pder{s_{\mu}}{x_\mu} &=
   A\biggl[
     \ccancel{\pder{\phi^*}{x_{\mu}}\pder{\phi}{x_{\mu}}}{Red}
    -\ccancel{\vphantom{\dfrac{1}{1}}\bigl(\lapl\phi^*\bigr)\phi}{Blue} 
    +\!\ccancel{\hphantom{\big(}\vphantom{\dfrac{1}{1}}\phi^*\lapl\phi\hphantom{\big)}}{Blue}\!
    -\ccancel{\pder{\phi^*}{x_{\mu}}\pder{\phi}{x_{\mu}}}{Red}
  \biggr]
\\[3ex]
&=0
\end{align*}

\end{frame}
\end{document}

I made also some adjustments for getting the same inclination of the blue bars.

enter image description here

share|improve this answer
    
and to fill more of the width it is possible to enclose the align* in a group with \Large. But then, there isn't that much room left for additional material on the frame... but if it is a presentation, I hope the room has an old-fashioned blackboard so that the true explanations can be given with the chalk... –  jfbu Jan 14 '13 at 20:05
    
This is the way I've done it now, with a \Large in front. Thank you everybody contributing to this question! –  user24357 Jan 27 '13 at 10:19
add comment

I have to agree with Herbert for two reasons i) The location of terms might indeed be more readable but also more ambigous, ii) small brackets look like a condition that renders the partial expression is equal to A and you are reminding it similar to a(t)=b(t) [almost everywhere]

I would suggest the following where the cancellation is slightly more obvious and color free.

\documentclass{beamer}
\usepackage{mathtools,lmodern,xcolor}


\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\ccancel}[2]{\renewcommand{\CancelColor}{\color{#2}}\bcancel{#1}}

\begin{document}
\begin{frame}

\begin{align*}
\frac{\partial s_{\mu}}{\partial x_\mu} & = A \left(
              \underbracket[0.5pt][3pt]{\frac{\partial \phi^*}{\partial x_{\mu}}\frac{\partial \phi}{\partial x_{\mu}}
             -\underbracket[0.5pt][3pt]{\vphantom{\frac{\partial}{\partial_\mu}}\square \phi^*\phi+\phi^* \square\phi}_{0}{}
             -\frac{\partial \phi^*}{\partial x_{\mu}}\frac{\partial \phi}{\partial x_{\mu}}}_{0}\right) \\[2em]
    & = 0 
    \end{align*}

\end{frame}
\end{document}

enter image description here

share|improve this answer
3  
And may be \Biggl( and \Biggr) instead of those looong parenthesis? I like this answer, but personally, I don't like \left and \right here. By the way, you need to add {} after the first undergracket in order to get correct spacing between the minus and the last object. –  Manuel Jan 13 '13 at 19:45
    
@Manuel I actually made it on purpose to draw the attention to the cancellations. Otherwise it looks like drawn later on top of the expression (or at least that's how I feel) but you are right on the minus sign. –  percusse Jan 13 '13 at 21:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.