{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.
113
votes
6answers
23k views
Remove ugly borders around clickable cross-references and hyperlinks
I know that I can use hyperref to make cross-references and hyperlinks clickable. That makes the clickable areas outlined in fluorescent green, however. How can I make the green boxes go away?
24
votes
2answers
1k views
How to keep a constant baselineskip when using minipages (or \parboxes)?
When a minipage is used to box a text paragraph, the first line of the minipaged text and the last line of the previous text paragraph are closer than two consecutive lines in a standard text ...
36
votes
3answers
12k views
What are underfull hboxes and vboxes and how can I get rid of them?
Often, TeX outputs underfull hbox and vbox warnings when running and in the generated log file. What are these and how can I get rid of them?
19
votes
4answers
3k views
Faded drop-shadow using tikz-based rounded rectangle?
Background
Epigraphs are in a box with rounded corners. The boxes have a drop-shadow.
Example
Picture #1 shows a shadow, while Picture #2 shows a shadow that fades out (soft blur):
Problem
...
6
votes
1answer
1k views
Rounded corner colored box around figure
I'm trying to get Rounded corner grey-colored box around figures.
One solution would be to use
\usepackage{float}
\floatstyle{boxed}
\restylefloat{figure}
but this results in black box around a ...
21
votes
4answers
1k views
Fit text into given box by adjusting the fontsize
I would like to fit text (potentially several paragraphs) into a box of given size. This should be done by adjusting the fontsize of the contained text.
Clarification edit: The given dimensions are ...
25
votes
1answer
3k views
Function and usage of \leavevmode
I am beginner of LaTeX. From many examples I found, I notice that it's very common to use command \leavevmode. I can't find any information about this command. Could anyone tell me what's the function ...
7
votes
3answers
391 views
A \boxed alternative with minimal spacing?
The following code comes from this post. The problem is that I would like a way to automate the size of the box so as to be very small with a few of spacing, but the following solution doesn't work ...
4
votes
3answers
3k views
dynamic signature/date line
I'm trying to create a signature and date line in a document. I need the date line to always be in the same spot on the page no matter what name is under the signature line, such as:
...
45
votes
5answers
2k views
Is there no easier way to float objects and set margins?
I come from a HTML / CSS background and am used to a particular way of setting margins, floats, etc. As a beginner in TeX, I am having a hard time positioning elements, probably because my mindset is ...
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 ...
27
votes
3answers
1k views
How to create Highlight Boxes in LaTeX?
I am writing an Article in LaTeX.
Please suggest me how to create a highlight boxes like the ones shown below in LaTeX:
50
votes
2answers
11k views
What does “overfull hbox” mean?
I often see output from TeX with the warning overfull hbox, badness 10000. What does this message mean?
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 ...
12
votes
2answers
852 views
Fitting text into a box over-a-pic
I am trying to fit a text into a box within an overpic environment. kongo09 had a similar question fit-text-into-given-box-by-adjusting-the-fontsize, and a highly workable solution was provided by ...
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}
...
23
votes
1answer
1k views
Definition of \strut explained
Can anyone explain me the fine details of the \strut macro. Why is the box \copyied in mathmode but \unhcopyied otherwise?
% latex.ltx, line 484, but identical in plainTeX
...
9
votes
4answers
580 views
A \boxed alternative with nicer spacing?
I like using \boxed to emphasize my answers in homework problem sets. However, whenever I use superscripts/exponents inside the box, the box becomes taller than it seems it should. This causes two ...
59
votes
1answer
2k views
What are the different kinds of boxes in (La)TeX?
I've seen hbox, vbox, mbox, parbox and others used in various code samples. What are the different kinds of box in (La)Tex? Which are suitable for use in LaTeX, as opposed to plain TeX?
13
votes
1answer
496 views
How to choose which sides of the border to draw in a `framebox`?
If, for example, you only want to draw the top and bottom border of a box, or perhaps the left and bottom only, is there a simple package to do this or must one resort to using tables or heavy-weight ...
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
1answer
218 views
Create a two column static small box
how can I create a new command to make a static true and false as labels of the first and two columns. This columns are lanes of small boxes. This small boxes would depend on the questions created. If ...
8
votes
2answers
750 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 ...
25
votes
4answers
835 views
Bounding box for each letter
How can I take input text and replace each character with a solid (and/or hollow) rectangle representing the bounding box for that character? In the case where two characters are closer together from ...
6
votes
2answers
680 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
...
25
votes
1answer
2k views
\setbox vs. \sbox and \savebox - What are the differences I need to know about?
What's the difference between using TeX's \setbox and LaTeX's \sbox and \savebox?
15
votes
2answers
164 views
Write content of box to a file
I would like to take the contents of a box generated with \begin{lrbox} ... \end{lrbox} and write it to a file.
The use case is a question and answer environment, where the answer should be collected ...
19
votes
2answers
4k views
What's the difference between \strut, \mathstrut and \vphantom?
What's the difference between \strut, \mathstrut and \vphantom? When would I prefer one of them to the others, and why?
6
votes
1answer
349 views
Repeat scaled version of slide, \savebox and \usebox in multi-slide frame?
I have a frame where I uncover a tikz-diagram in 12 slides.
In the next frame, I want to repeat a scaled-down version of the full diagram (slide 12).
I've tried to use a combination of \savebox, ...
4
votes
1answer
2k views
Make an invisible vbox
I'm placing a PDF meta information in a \vbox in a plain XeTeX document, and I would like it to behave as if there were no box at all (so any additional \vskip after the \vbox will appear). Right now, ...
18
votes
1answer
541 views
Caption parbox 6.0 pt too wide
For my listings, I use this caption setup:
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
...
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 ...
3
votes
2answers
475 views
Centering contents after \unvbox
Trying to build a complex macro, I managed to compute what I need in a vbox.
Now, I want to \unvbox this box to allow page breaks, and would like each element it contains to be centered.
I can't find ...
11
votes
4answers
2k views
Make an Example and shaded box like in the book
I want to make Examples in the book as in the following book
http://www.analogmachine.org/Books/Chapter1.pdf
See Page 2...
Also shaded box as in the page 3... Pictures can be seen below.
...
8
votes
1answer
664 views
Breakable vboxes
In Plain TeX how can I make vboxes breakable, and can I handle/measure them separately? What I'm trying to do, is that I have a portion of text, that is treated separately (no indention, narrower, ...
11
votes
1answer
469 views
how to draw a container box in latex around automata?
This is my tikz code :
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,shapes.geometric,arrows,fit,calc,positioning,automata,}
\usepackage{amsmath}
\begin{document}
...
8
votes
2answers
587 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?)?
...
9
votes
5answers
2k views
Dashed box environment
I am new to LaTeX and I'm having a hard time trying to create a dashed box environment without success. Can someone please share a code for a dashed box environment such as the one in the image?
I ...
5
votes
1answer
428 views
Is it possible to use \newsavebox with more accurate bounding box?
I have 2 cases here. First case, I want to set the paper size to the size of $\displaystyle E=mc^2$ and second case it is set to the size of \fbox{$\displaystyle E=mc^2$}.
Unfortunately, in both ...
2
votes
1answer
282 views
Background color of breakable box: removing thin blank lines
The purpose of the mybox environment in the following document is to
typeset a box in a yellow background. The box may be split by page
breaks. The algorithm used is similar to the one found in the ...
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}{
...
9
votes
1answer
123 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
2answers
2k views
How to highlight important parts (with a gray background)
In the below link
http://www.math.uiowa.edu/~goodman/algebrabook.dir/bookmt.pdf
the author highlights anything which is important using a greyish color background. For example, if you see ...
7
votes
5answers
809 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 ...
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.
4
votes
1answer
1k views
How to make a textbox with this TikZ code ?
I made this with TikZ :
\usetikzlibrary{calc}
\def\banlen{3}
\xdefinecolor{mycolor}{RGB}{62,96,111} % Neutral Blue
\def\bancolor{mycolor}
\begin{tikzpicture}
\draw (0.25,0.25) rectangle (5,-2); %
...
9
votes
2answers
401 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
852 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{...}
...
6
votes
3answers
171 views
New command for a height-flexible rect
I'm trying to create a command that will take in one argument and create a rectangle around that number of empty lines. I have the following:
\newcommand{\putansbox}[1]{
\framebox[\textwidth]{
...
5
votes
2answers
286 views
Highlight an equation within an align environment with color option
I'd really like to do exactly what's being asked for in this question: Highlight an equation within an align environment, but with the ability to change the color when I call it, so that I could have ...


