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 was wondering was is the best method in (general) I guess to stack text on top of text in very small areas as in this example:

enter image description here

I used the \stackrel (which I think is for math more so) command but with this LaTeX makes some pre-determined assumptions and makes the top argument smaller than the bottom as seen above. I wanted all the text to be the same size. I tried several ways, but only to come up with this way which works, but is not optimal.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted
\[
\left.\begin{aligned}
  f(\theta) & = \cos(2\theta)\\
  g(\theta) & = \sin(\theta)
\end{aligned}\right\rbrace
\begin{tabular}{l}
  Are continuous\\
  everywhere
\end{tabular}
\]

One might write \begin{tabular}{@{}l} to avoid the small space at the left of the tabular. A bit of visual formatting is always necessary: the final effect depends on many factors (for instance, the font size used).

Using \parbox or minipage here has a serious drawback: it uses up all the dedicated space, thus spoiling the global formula centering.

share|improve this answer
    
Thanks. I did not know you can do a right brace delimiter as so by \rbrace, interesting. You always have some nifty commands to present in your answers. I like that. Also, did not know about aligned environment. Is that anything different from \begin{align}...\end{align}? –  night owl Nov 24 '11 at 12:34
1  
@nightowl The difference is not in syntax inside the environment; but align (and align*) create an object as wide as the text width, while aligned occupies only the needed horizontal space. –  egreg Nov 24 '11 at 16:55
add comment

You could use a \parbox. The rcases environment is provided by mathtools.

enter image description here

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\[
\begin{rcases}
f(\theta) = \cos(2\theta) \\
g(\theta) = \sin(\theta)
\end{rcases}
\parbox{7em}{\small Are continous \\ everywhere}
\]
\end{document} 
share|improve this answer
1  
Alternative to a \parbox with explicit width, you may use a tabular: \begin{tabular}{@{}l@{}}Are continous\\everywhere\end{tabular}. One more Alternative may by using package varwidth. –  Schweinebacke Nov 24 '11 at 9:17
    
Torbjorn: Very nice. I did not know about parbox. How useful is that command because it may actually make alot of things I try to accomplish much easier. And if you could, can you provide just some brief detail on what's its use in LaTeX. Thank Again. –  night owl Nov 24 '11 at 9:47
1  
@nightowl It simply creates a box of the specified width (here 7em) in which you can put text. You can read more about it in lshort or this document. Both of these are part of MikTeX and TeXlive, and available via texdoc: In a terminal or command line (or the search field in the start menu of Windows 7) write texdoc lshort for the first, and texdoc latex2e for the second. (This works in TeXLive, at least.) –  Torbjørn T. Nov 24 '11 at 10:10
    
Thanks! That helps alot. And the commands worked on command line, but the document was in a non-english language. hehe. So it couldn't help me much. –  night owl Nov 24 '11 at 10:17
1  
@nightowl Oh. Well, you can find the English versions on CTAN (the two links I posted). –  Torbjørn T. Nov 24 '11 at 10:19
add comment

You can juse use two aligned environments and a brace. Adding some modification to the line spacing you can get the lines closely packed:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  \[\left.
  \begin{aligned}
      f(\theta) & = \cos(2\theta)\\[.5\baselineskip]
      g(\theta) & = \sin(\theta)
  \end{aligned}
  \right \}
  \begin{aligned}
      &\text{are continuous}\\[-.3\baselineskip]
      &\text{everywhere}
  \end{aligned}
  \]
\end{document}

tightly packed text after brace

Edit: You can of course repace the second aligned with a parbox of sufficient width. That's probably better, actually. It would then become:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  \[\left.
  \begin{aligned}
      f(\theta) & = \cos(2\theta)\\[.5\baselineskip]
      g(\theta) & = \sin(\theta)
  \end{aligned}
  \right \}
  \parbox{3cm}{
      Are continuous\\[-.3\baselineskip]
      everywhere
  }
  \]
\end{document}

With the same result.

share|improve this answer
    
Thanks.A bit more of a dragged out way of doing things, but it makes sense systematically going through the process of what you want to accomplish. I think I might be starting to like this parbox command, kind of seeing what it can do comparing the difference in the two versions. :). –  night owl Nov 24 '11 at 9:56
    
Here a \parbox is surely worse than aligned, unless you guess exactly the required width. –  egreg Nov 24 '11 at 11:48
    
@egreg: Unless you want to put something else behind it, what's the problem with using a greater width than required? EDIT: nevermind, the centering will of course be off. –  Roelof Spijker Nov 24 '11 at 12:13
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.