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 want something like this: enter image description here

two narrow equations/words equally distributed along the linewidth. I used next code:

\documentclass{beamer}
\usetheme{Warsaw}
\begin{document}
\begin{frame}
\begin{block}{My block}
\hfill$a+a=a$\hfill$a\cdot a=a$\hfill\phantom{.}
\end{block}
\end{frame}
\end{document}

As you can see I've used a \phantom{.} to force end of line \hfill. My question is do you know a better solution? Probably Werner's answer in Standard math environment for equally-spaced columns of expressions? is a better way to do it, but I think it's to much code.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

TeX removes a glue item at the end of a paragraph, so

\hfill$a+a=a$\hfill$a\cdot a=a$\hfill

doesn't work. You have to use space that doesn't disappear:

\hspace*{\fill}$a+a=a$\hfill$a\cdot a=a$\hspace*{\fill}

(The one at the start might be \hfill, but it's good practice to use \hspace* when one really wants space at the beginning and at the end of a line).

share|improve this answer
    
Just what I wanted! –  Ignasi Feb 3 '12 at 17:16
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.