{boxes} are the units used by (La)TeX to construct a page by pasting them together horizontally or vertically. A single character from a font is a box, as are the lines of type and the eventual page.

learn more… | top users | synonyms

2
votes
2answers
260 views

Why wasn't \fbox defined to enclose its contents based on the most left, right, bottom, top parts of its contents?

Case 1: \fbox cannot enclose characters tightly Why don't \fbox and PSTricks \psframebox enclose its contents accurately? In my opinion, every edge should exactly touch the outer part of its ...
11
votes
2answers
10k views

Attractive Boxed Equations

I often used \boxed{...} from the AMS math package to place a box around important equations. However, this approach often produces somewhat awkward looking output. Consider \documentclass{article} ...
4
votes
2answers
845 views

Exact height of \hbox

I have problems controlling the exact height of an \hbox; what is wrong with this example? \documentclass{article} \newcommand{\mybox}[2]{ \fbox{ \vbox to #1cm{ \vfil\hbox to 1cm {\hfill #2 ...
6
votes
3answers
1k views

Using TikZ, how do I draw a box having an adjustable width?

I want to box text using TikZ and adjust the box width such that the text is appropriately put on different lines within the box. I also want the text on each to be centered within the box. As this is ...
4
votes
2answers
1k views

How to access toc entries with titletoc

I'm bit lost with the content of titletoc.sty. I'd like to access toc entries, meaning chapter title, section title and so on to put them in a colorbox. I think it is somewhere in the ...
2
votes
1answer
342 views

How to put part of a TikZ graphic into a box to measure its size

After adding support for tooltips today in pdfcomment (\pdftooltip) I wanted to make a TikZ example with tooltip annotations. Within \pdftooltip the annotated element is set into a box to measure the ...
11
votes
1answer
331 views

How can I use an hbox inside a TikZ environment for text dimension measurement?

I'm trying to use an \hbox to measure the dimensions of a certain text. This is working in normal text as in the following example: \setbox37=\hbox{this is a text that I want to measure} text width ...
8
votes
2answers
747 views

Expandable Nested Boxes with TikZ

Could someone please post a minimal tikz example to draw this: I am currently doing this with nested tables, but would like to see how it can be done with tikz. The nodes would ideally have a ...
5
votes
3answers
986 views

Extra space above boxed multi-line equation

Well, this question is not new. It was asked back in 2007 in texhax, and answered at the same time. However, I couldn't apply the patch as mentioned in the answer, so I decided to ask it here. ...
0
votes
3answers
464 views

add vdots to a listing without breaking the box

I have a problem when I try to add \vdots in an escaped string inside of a listing environment. The box is cut. How can I avoid the break of the box? The code is this: ...
8
votes
1answer
238 views

Curious effect with \newsavebox

The following code fails with the error ! LaTeX Error: Command \mybox already defined. Or name \end... illegal, see p.192 of the manual. despite the fact that \mybox has been ...
5
votes
1answer
987 views

Boxed equation with empheq: adding text outside box

I'm trying to have a box around my align environment, so I do the following: \usepackage{empheq} \begin{empheq}[box=\fbox]{align} equations \end{empheq} This works fine, but I would like to have ...
14
votes
1answer
1k views

What is the command to highlight bad boxes in pdf?

I seem to remember a command to show bad boxes in a PDF when using latex, but googling is not helping me to remember. How can I show bad boxes in my PDF?
4
votes
3answers
412 views

Parbox as an initial

Similar to my last question Initial with wrapfigure -- other idea? I would like to create a wrapped environment in which I can take a \parbox or minipage environment. The following code shows the ...
7
votes
1answer
2k views

How do I put a paragraph in a box that is some percentage of the width of the page I'm putting it in?

I have a document that should contain a bordered box with a paragraph of explanatory text. The box's width should be a percentage of that of the page's body. I don't want to make the box a fixed ...
1
vote
1answer
364 views

Align a parbox at the bottom of a table

Below, how can I align the \tiny text in the \parbox at the end of the right column table so that its last line is on level with the last row of the left column table? In general, it would not be a ...
7
votes
3answers
3k views

How to box verbatim to prevent page break?

If I try \mbox{ \begin{verbatim} Some looooong text... \end{verbatim} } Then some compilation errors occur.
4
votes
3answers
1k views

Get a box with zero depth including some text

How to get a box including some text in text mode, which depth 0pt?
8
votes
1answer
729 views

fancy text boxes like in Redhat documentation or mercurial book

I would like to have framed texts with an Icon on the side like the ones here http://www.centos.org/docs/5/html/5.5/Release_Notes/ar01s06.html or ...
1
vote
1answer
417 views

Covington Gloss in Parbox/Makebox/Minipage

I am using LyX and I'm trying to place a Convington Gloss (Covington usage) inside a \parbox, \makebox, or minipage but I get the error: http://pastie.org/1814468 Here is the file: ...
3
votes
1answer
247 views

Problem with babel, ragged2e and parbox

I have the following code: \documentclass{minimal} \usepackage[french]{babel} \usepackage[newcommands]{ragged2e} \begin{document} \begin{center} \parbox{9cm}{ \textsc{ Jesus a dit~: \og ...
1
vote
2answers
1k views

\fbox command destroys margin

I included a graphic the following way: \includegraphics[width=1\textwidth]{questionnaire1.png} Then I changed it so that a frame is drawn around the graphic: ...
5
votes
2answers
627 views

Underfull hbox with \hbox to <dimen> but not with \halign

When using the \halign primitive, cells in the same column all have the same width. Hence, if one entry is very large (abcdefg below), the others will be stretched to the same size. If an entry ...
12
votes
2answers
398 views

Why is \baselineskip not inserted before an \unvbox?

It seems that \setbox0=\vbox{\hbox{abc}}\unvbox0 is not equivalent to \hbox{abc}: the former does not insert a \baselineskip in the following situation. \vbox{% \hbox{XY}% \hbox{abc}% ...
2
votes
2answers
1k views

Draw a rectangle

How to draw a highlighted box around a bulleted item.
2
votes
2answers
2k views

Ovalbox with fixed corner diameter

I wish to use \Ovalbox with a fix corner diameter. How can it be done? The problem is when I got a lot of text in the box, the corners run over the text.
6
votes
3answers
814 views

amsthm environment and colorbox

I'd like to customize the amsthm command a little bit but I cannot find the relevant lines in the (undocumented?) .sty. How can I put a colorbox on the name of the environment ...
4
votes
1answer
562 views

\fbox inside listings

I am trying to highlight a specific line inside a listing with listinline. The code I am currently using looks like this: \begin{lstlisting}[escapechar=!] class A { void m() { B b = ... ...
8
votes
5answers
2k views

Set \strut height

I'm using quite a few \colorbox and \colorfbox in a document but they weren't sitting at the same heights (because some words contained g and this seemed to push the box down. The solution I found ...
6
votes
2answers
2k views

Create empty box sized according to imaginary content

In LaTeX, is it possible to create an empty box that has exactly the dimensions of some content given? Example: \emptybox{abc} would insert an empty box of the size as if "abc" was printed there.
6
votes
2answers
916 views

How can the \textmu symbol be used in math mode and resize correctly?

I wish to use an upright mu character in various places in my document, and so I've put the following in my preamble: % textcomp, for its upright mu \usepackage{textcomp} % some user macros ...
5
votes
3answers
4k views

Change border color of a \boxed equation?

I recently asked this question. The solution worked for me but I have a problem. cropped images are as small as possible. I would like to have a gif that bounds to borders of box of the equation. so I ...
3
votes
1answer
883 views

Top-align two parboxes with tables

I am looking for a two-column solution: The left column contains one table, the right column several tables. I was thinking of using parboxes as follows: \parbox[t]{2cm}{\vspace{0pt} ...
5
votes
1answer
2k views

Preparing a beamer poster: how to create a border box?

I am preparing a poster with LaTeX using beamerposter, following the examples of the beamerposter site. In these examples, the title is themed with a background color. I would like to have the title ...
18
votes
2answers
4k views

Highlight an equation within an align environment

I would like to define a command that puts a red box around an equation with yellow highlighting. I have the basics working pretty well. What I am unable to figure out is: How to keep the alignment ...
4
votes
3answers
1k views

Flush a left-flushed box right

I would like to put an address in my document as follows: | | | Name | | Street #| | City | | ...
5
votes
1answer
2k views

How to continue the framed text box on multiple pages?

I am using framed package to create text boxes using begin{framed} and end{framed}. My problem is that my framed box goes on for two pages, and I don't want the text box to complete itself at the end ...
9
votes
1answer
900 views

Text in subscript

For my text-in-mathmode needs in LaTeX, I use \mbox. However, it does not seem to behave well in subscripts. How can I write text that adjusts its height? $ 3 \mbox{dB} = f_{ 3 \mbox{dB} } $ ...
6
votes
2answers
206 views

Stacking two hboxes

I am trying to write the macro \foo{...}{...} that creates an hbox made up of both \hbox{#1} and \hbox{#2}, such that both hboxes are stacked one on top of the other. The width of the resulting hbox ...
7
votes
2answers
1k views

Vertical spacing of framed environment

Here is an MWE that shows the problem: \documentclass{article} \usepackage{framed} \setlength{\FrameSep}{3pt} \setlength{\parindent}{0pt} \begin{document} \fbox{Foo} \fbox{Foo} \begin{framed} Foo ...
4
votes
2answers
862 views

\parbox “textwidth” for the combined width of a subset of table cells

I would like the parbox width of the text in a multicolumn to be calculated automatically from the combined width of the cells that the multicolumn spans. (Their width will vary in different copies of ...
2
votes
1answer
189 views

Documentclass user macros

I wanted to create a documentclass for a complex template. I ran into the following problem: I want to have user macros to store content in boxes which are then displayed by the template in the ...
6
votes
2answers
679 views

Stretching a framebox over the whole page

Does anyone know how to stretch a (framed) box down to the end of the page? In effect something like \documentclass{scrartcl} \begin{document} sometext ...
3
votes
1answer
593 views

Table cell overflow

Consider this document example: \documentclass[a4paper,draft]{article} \usepackage{calc} \usepackage[demo]{graphicx} \usepackage{tabularx,multirow} \usepackage{geometry} \geometry{hmargin=0cm} ...
5
votes
1answer
589 views

Vertically align two boxes based on their top borders, not on baseline

I have two boxes which to shows text to the left and right of a document. \begin{minipage}[t][1in][t]{2in} {\Huge First line box 1}\\ {\footnotesize Second line box 1} \end{minipage} \hfill ...
3
votes
1answer
1k views

Measuring height of fixed-width text box

Suppose some text is put inside a fixed width box. The text will then continue in vertical direction. How can you measure the total height of that text? Original text: text text text text text ...
12
votes
3answers
1k views

Why doesn't \settoheight of \parbox work?

Consider the following code: \documentclass[a4paper]{letter} \usepackage{calc} \usepackage{printlen} \newsavebox{\foobox} \newlength{\fooboxheight} \savebox{\foobox}{ ...
3
votes
2answers
401 views

Problem with box width

I have the following code, that draws a dashed box: \documentclass{book} \usepackage{lipsum} \usepackage{arydshln,paralist} \setlength{\parindent}{0pt} \newenvironment{mybox}[1] ...
9
votes
2answers
990 views

How do I backcolor in verbatim?

I have some code I want to typeset as verbatim (lstlisting would be ok as well) - but I want to highlight some parts of it via a different background color, i.e. something like this: \begin{verbatim} ...
8
votes
3answers
1k views

Create a series of connected, list-filled boxes (flowchart?)

I would like to create a series of horizontally linked 'text boxes', with arrows between each one. Each box will contain some text (probably a list with a title). I would like it to look something ...

1 4 5 6 7 8