{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

10
votes
2answers
1k views

Underfull \vbox in each longtable… can it be fixed or must it be ignored?

I got some strange "underfull \vbox (badness 10000) detected at line ..." warnings, obviously at each of my "longtable"s. Is there a way to fix them (I actually don't see the cause) or do I have to ...
10
votes
3answers
1k views

Determining the position of a box (e.g.) on a page

Suppose I have some .tex code like this ... bla bla \framebox{Hello World} bla bla ... I want to read out the position (left and top or bottom, in pts) of the framebox on the page, and store in, ...
10
votes
1answer
14k views

Frame around text and figure

Consider the following TEXT TEXT TEXT TEXT Figure~\ref{fig:foo} TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT \begin{figure} \centering \includegraphics[width=\textwidth]{foo} \caption{This is foo.} ...
10
votes
1answer
5k views

How to move a whole tikzpicture?

I have a tikzpicture, rounded by a fbox, and embedded in a minipage. Is it possible to change the position of the whole picture inside the minipage? for instance, move the picture 1 unit higher and 1 ...
10
votes
1answer
2k views

A few words in a coloured/grey background box

How can I write a few words with a grey highlighting box in the background, as shown in the picture below ("TEXT 4")?
10
votes
1answer
114 views

Measure a very large \vbox

I would like to measure the total height of a \vbox even for boxes which are larger than \maxdimen. It would be enough, if the code would compute the total height correctly only for small boxes. For ...
10
votes
1answer
6k views

How would I make a colored alert box in LaTeX?

I would like to make something similar to the following green alert box http://twitter.github.com/bootstrap/components.html#alerts I have tried various combinations of verbatim without success
10
votes
2answers
707 views

Reading the contents of a box

Is it possible to take a box and retrieve the following information from it: A list of all "top level" internal boxes; All intervening space (kerns and glue: did I forget another type of space?)? ...
10
votes
1answer
103 views

How to set a box to a rubber length width

Problem I'm trying to create fancy section heading using titlesec. I need to put the section name into a \parbox to have line breaks. I want the parbox to extend to the far right margin, but I don't ...
10
votes
1answer
918 views

Create a “yearbook-style” multi-page layout of photos

I would like to create a "yearbook-style" layout of photos in LaTeX. Each photo would have a caption and the objective would be to automatically layout the differently sized rectangular photos to ...
10
votes
1answer
6k views

Relative padding of a minipage's paragraph

Background Created a custom command for rendering quotations (epigraphs). Problem The text in the following image has no space at the border: The word "and" is flush with the right margin. Code ...
10
votes
1answer
1k views

Box or sidebar for additional text

I'm not sure of the name of what I need. I would like to set some text in a box or sidebar, as I've seen in some textbooks. The main text will refer the reader to the sidebar for more details. I would ...
10
votes
1answer
223 views

How do I get an empty box on each page?

I'd like to have an empty box on the bottom of my pages in a certain chapter. I've messed around with wrapfigure and kinda sorta gotten something that looks okay, but I'd like to do it properly so I ...
9
votes
2answers
439 views

Why \usebox (is it vestigial)?

Despite my inflammatory title, I understand that \usebox is employed to display a predefined box. But this question concerns when [the use of the box register, rather than the box content] becomes ...
9
votes
3answers
604 views

Align text on top of a framebox

I am trying to create a series of boxes so that my students can input there id number for there final exam. \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \newsavebox{\idbox} ...
9
votes
2answers
530 views

Framed box, over framed text with image

Hi all, I'm a newby in LaTeX but after researching online, I have seen that it is possible to create boxes and frames adjusted to text and images. I am trying to achieve something like the image, ...
9
votes
3answers
158 views

Box with adaptive length

When I want to put formulas into boxes, I like the box to adapt to the length of my formula. For example, I don't want to put $1+1=2$ in a very large box. To address this, I use the command \encadrer ...
9
votes
3answers
5k views

A version of colorbox that works inside math environments

I'd like to highlight particular parts of an amsmath environment. Here's a minimal working example: \documentclass{article} \usepackage{amsmath,color} \newcommand{\abs}[1]{\lvert#1\rvert} ...
9
votes
5answers
1k views

\newenvironment issues with environment comment

I am trying to setup the formatting for a LaTeX document (it's got the class memoir), so that it would be fairly simple to add to it in the future. Two of the features I'd like are: Be able to mark ...
9
votes
3answers
401 views

Listing background broken by \colorbox and \framebox

I am using listing environment (listings package) with the background parameter. I want to highlight some lines of code and I am using the \colorbox, \makebox and \framebox to achieve this. However, a ...
9
votes
2answers
730 views

Why do I need a '\vspace{0pt}` to align a table and a figure along the bottom line when using '\vbox' and '\hbox'?

Recently, I fiddled with placing a table and a figure next to each other such that their bottom parts aligned with each other. I managed to do by using \vbox and \hbox, but there is one thing that ...
9
votes
2answers
952 views

How to avoid underfull vbox in combination with \vsplit?

In the following example I am using the command \vsplit. I can't see the reason why \vsplit produced an overfull \vbox \documentclass{article} \parindent0pt \def\exampletext{Text Text Text Text Text ...
9
votes
4answers
1k 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 ...
9
votes
2answers
597 views

Beamer: content in box register does not survive \end{frame}

Consider the following example (I edited the example to include LaTeX lrbox environment): \documentclass{beamer} \newsavebox\mybox \newsavebox\myboxb \begin{document} \frame{ \sbox\mybox{Hello ...
9
votes
2answers
1k views

Adjust font size on-the-fly

In my document I want to emphasize some key points by placing them in a box with rounded corners. This I do using the following code: \documentclass{report} \usepackage{fancybox} \begin{document} ...
9
votes
2answers
105 views

Is \c_empty_box intended to be used instead of \mbox{}

At a first glance, I understood \c_empty_box as a replacement of \mbox{} but the following MWE (that points out a weird behavior of \c_empty_box: it is replaced by "æ") gives me serious doubts. ...
9
votes
1answer
294 views

Expansion of macros and box contents

I don't understand the following behavior. Intro First, here is a simplified version of a macro I am using (which is itself a hacked version of a macro found in gloss.tex). If you have a string ...
9
votes
4answers
7k views

Colored box in new environment

I have a problem, I'm fairly new to LaTeX but I think I got the basics. My problem is that wants to create a environment that can create a minipage with a background color and some text in it. I can ...
9
votes
2answers
3k views

Beamer overlay box around text - the correct way?

I have something that "works," but I'm wondering if there's a more elegant solution. I want to box some text after an itemize in beamer, so this is what I'm doing: \documentclass{beamer} ...
9
votes
3answers
197 views

How can I wrap each page of a document with a box that has a caption?

I have a LaTeX document that contains proprietary information. I need to print a version of the document that has a box around the text with a disclaimer (something to the effect of "Proprietary ...
9
votes
1answer
2k 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} } $ ...
9
votes
1answer
735 views

How to create a 'fact box' or pull quote that is tied to the margins of your page?

I'd like to accomplish the following: Ut convallis libero in ------------------- urna ultrices accumsan. | | Donec sed odio eros. | "an important | Donec viverra mi quis ...
9
votes
2answers
1k 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} ...
9
votes
1answer
9k views

What is a “Overfull \hbox (9.89561pt too wide)”?

I have this warnings around, some of them seems to be solved naturally but I never really understand what do they mean. What this means? Edit: I would like to keep the question in more general ...
9
votes
2answers
4k 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
112 views

\hbox_overlap_right:n{} vs. \makebox[0pt][l]{}

I stumbled about some, to my understanding, unexpected behaviour of the expl3 command \hbox_overlap_right:n. I was expecting all examples below to produce the same result, that is, the frame box ...
9
votes
2answers
2k views

Framed text with a float in it

I'd like to frame the text between \startfoo and \stopfoo, but there is a float in it. \documentclass{article} \begin{document} \startfoo \begin{figure}[h] some float with a \caption{...} ...
9
votes
1answer
142 views

Vertically align the top of a box to the top of the tallest box of a line

This is a follow-up question on this thread. I want to mark a line by putting a star to the left of it. If the line contains a box that is tall, the marker should be aligned with the top of this ...
9
votes
1answer
142 views

LaTeX2e \makebox !=\hbox?

The source2e documentation (pg. 233) when describing \makebox states: ... If wid  is missing, then pos is also missing and obj  is put in an \hbox of its natural width... This, ...
9
votes
1answer
584 views

Handling overflows in biblatex bibliographies

I'm finally making the transition to biblatex. This is a remarkable package, and has allowed me to cut out quite a bit of old code I used to use to handle eprints, DOIs, crossref mapping problems, ...
9
votes
1answer
147 views

\ref with tight box surrounding the reference

How can I make the colored box around a reference appear completely tight? MWE: \documentclass[a4paper,twoside,openright,final,12pt]{book} \usepackage{etex} \usepackage[english]{babel} ...
9
votes
1answer
92 views

Measuring a part of the page

I'm trying to measure the height of a part of my page. The complete titlepage, along with the part of the page I'm trying to measure is outlined in red, and the code to compile the page is shown ...
9
votes
1answer
66 views

Peek ahead a \vbox: \vsplit and reassemble again?

I'm wondering if it's possible to implement a peek method to inspect the head of a \vbox without changing the content of the \vbox. It could be done by brute force using a \copy of the original \vbox, ...
8
votes
3answers
238 views

PDF annotations: How to know if “a box is empty”?

Extract from dvipdfmx documentation: Warning: No annotation will be constructed if the content between pdf:bann and pdf:eann is an empty box. My MWE (via xelatex): \documentclass{article} ...
8
votes
3answers
3k 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
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 ...
8
votes
3answers
1k views

Creating uniformly sized boxes around text

I want to put individual words in to boxes next to each other. I've used the \framebox command, but this has produced different sized boxes around each word. How could I get all the boxes to be the ...
8
votes
3answers
204 views

box the size of A containing B

A thing I'd often like to do is put in my document a box the size of some text A and containing some other text B. For instance, I have two tikz nodes, one containing $n$ and one containing $n+1$, and ...
8
votes
2answers
4k views

Sample example of box in latex

Could someone make this picture in sample code in LaTeX and please make it in different style with different colors. Here is my attempt: \fbox{ \parbox{\linewidth}{ This example will show ...
8
votes
2answers
92 views

Is there a way to set a parbox to a minimum height?

I'm looking for a way to make it so that my \parboxes keep a minimum height, similar to CSS min-height, e.g. \mhparbox{\textwidth}{3cm}{...} would ensure that whatever text appears in place of ..., ...