2

Hi I'm using LateX. I have a block of text that I'd like to have a small box like space highlighting the are (just like a \begin{equation} but for text).

Is there such a thing in LateX?

2 Answers 2

6

I'm not 100% sure what you're asking I'm afraid, but if you just want to indent text with a margin on each side of the page to make it stand out, you can use...

\begin{quotation} Quotation is good for long blocks of text that you want highlighted \end{quotation}

\begin{quote} Quote is suited to a single block of quoted text. \end{quote}

If you actually want to have a physical black box around the text, you might want to consider wrapping it in a tabular / table, or you might want to delve into minipages and/or par box environments...

0

Is \makebox what you're looking for?

To create boxes of text that behave differently from the rest of the text, we can use

\makebox[width][pos]{text}

The width sets the width the of the box. The pos sets the positioning of the text - either r (right justified text), l (left justified), or s (stretched to fill the box). If the pos parameter is left out, as in \makebox[1in]{centerme}, the text is centered. The text is placed in the box. If you want to draw a box around the text, use \framebox just as you would use \makebox.

\mbox{text} and \fbox{text} are quick versions of \makebox and \framebox, which create a box to fit the size of the text.

There are some more examples at http://www.artofproblemsolving.com/wiki/index.php?title=LaTeX:Layout#Boxes

2
  • It's actually parbox[] that was shown in your article. Is there something similar to parbox but also creates a border with the box?
    – user402642
    Sep 24, 2010 at 1:29
  • (Not my article, just something I found on the web.) To create a border, maybe \framebox is what you want. To put the text inside, you might need to use a minipage, as John Wordsworth said. Sep 24, 2010 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.